Example tiles
Cold render without cache
threads = 8, metaTileSize = 1024, store ssd
How it works?
- To start, you need to install the mapnik dynamic library and the osm2pgsql utility
- Clone the repository and install the npm install packages
- It is necessary to download a file with geodata in pbf format
- Adjust the config.json file to suit your parameters
- Run the initial boot script: npm run init -- --file=path_to_file.pbf
- Start the server: npm run start
- The project has an index.html file for checking the map
How run in docker?
- Copy data.pbf to docker folder
- Change working directory to docker
- Run docker build ./ -t tag_name
- Run container docker run -p 3000:3000 -t tag_name
- Go to page http://127.0.0.1:3000/
How to tune performance?
The main load is caused by the rendering of tiles and queries to the database The size of the meta tile must be 2 times larger than the size of a regular tile, i.e. 1, 2, 4, 8 times larger
- Large meta tile size, increases the load on the render
- Large meta tile size, reduces the load on database queries
- The more threads, the faster the tiles are rendered, but the load on the render and database queries increases
- When changing threads and size, observe the load in htop and select the optimal
To prepare the styles, the code was used https://github.com/gravitystorm/openstreetmap-carto. Thanks to them for providing the template engine.
Where to get geodata?
- You can download ready-made cuts. For example: https://needgeo.com/
- You can download a world map and cut it yourself