In this example we create a project for andorra's data.
We'll create a project with two sub parts. one for pois and the other for ways.
-
We have the following lua scripts:
simple.lua
- representing the whole project style and used on the initial creation.sub-simple-pois.lua
- used for appending the pois sub partsub-simple-ways.lua
- used for appending the ways sub part
-
We'll create the project from an initial dump file taken from geofabrik,
andorra-latest.osm.pbf
the sequence number of the dump file represents the statring point of the project. -
Create a bucket and put the lua style files and a
state.txt
containing the dump sequence number with the project's unique id prefix as key.
The bucket looks like that:
andorra/
state.txt
simple.lua
sub-simple-pois.lua
sub-simple-ways.lua
-
Set the s3 and postgres authentication environment variables.
-
Run create command
index.js create -e https://s3-endpoint.com -b andorraBucket -p andorra -t local-file -s ./andorra-latest.osm.pbf -l simple.lua
-
From now on we can append replications to the project we'll fetch minute replications from global osm. on append command we'll provide a config specifing for each sub part the lua script key on the bucket and the expiration tiles zoom levels, a range or minimum.
-
Run append command
index.js append -e https://s3-endpoint.com -b andorraBucket -p andorra -a public-read -c ./example-config.json -r https://planet.openstreetmap.org/replication/minute
-
We haven't set a limit on the append command (-l) so the project is up to date with the global osm and the expired tiles for each append are located on the bucket with a key of
/andorra/{pois or ways}/{sequenceNumber}/expire.list
theexpire.list
contains the expired tiles in the zoom level specified on the config provided in the append command