Giter Site home page Giter Site logo

cuongkma / kartotherian_docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qwant/kartotherian_docker

0.0 0.0 0.0 782 KB

Docker deployment for Qwant Maps tile server, based on Kartotherian (https://github.com/kartotherian/kartotherian)

License: Apache License 2.0

Shell 2.94% Python 81.04% Smarty 0.52% PLpgSQL 6.31% Dockerfile 9.20%

kartotherian_docker's Introduction

kartotherian_docker

docker images for the kartotherian project

They use a mixed architecture of Kartotherian and openmaptiles You need a docker version > 18.06

"Quick" Start for local testing

Use these commmands to download, import data and create tiles jobs for Luxembourg:

(Optional) First, delete all related containers and volumes (from an older import):

If sudo required, use "-E"!!

./exec.py clean

Download, import and start the tiles generation (of Luxembourg by default):

./exec.py load-db # it runs the build command as a dependency on 'load-db'

Once all tiles are generated, the map is visible on http://localhost:8585! (If not, take a look at docker ps and see what the port of the image qwantresearch/erdapfel is.)

If you want to see the list of all available commands, use -h or --help option on exec.py.

Workflow

If you want to update the generation process, you need to edit Qwant/openmaptiles then update the openmaptiles submodule.

running

To launch kartotherian just do:

./exec.py kartotherian

(you might need sudo permissions depending on your setup)

Import in Postgres

to download a pbf and load data in postgres and generate tiles you need:

./exec.py load-db

Note that you can specify the PBF you want to give by using the --osm-file option.

The different way to configure the import can be seen in this readme.

Note: the first import might be quite long are some additional data will be downloaded (cf load_db)

If you want to use already downloaded data (especially usefull for a quicker dev cycle), you can use a mounted docker volume.

The file local-compose.yml gives an example of how to bind a named docker volume (the file uses a ./data directory but you can change it if you want).

To use a locally mounted volume add the local-compose.yml with the -f docker-compose option.

For an easier dev experience, you can use the docker-compose additional file local-compose.yml that forward ports, use a locally ./data mounted volume (to avoid some unnecessary download) and run a front end to view the tiles.

For example with this setup you can also provide an already downloaded pbf (it needs to be in the ./data volume) with --osm-file:

./exec.py --osm-file /data/input/luxembourg-latest.osm.pbf load-db

Note: even if the local directoy in ./data the osm file path is "/data/input/" because it's the directory path inside the container.

You can also specify a download url:

./exec.py --osm-file https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf load-db

Tiles generation

The tiles generation is also handle by the load_db container.

To only generate 1 tile, you can set --tiles-coords [[x, y, z]]. x, y, and z are based on the Slippy Map Tile name system and you can use Geofabrik's tool to generate these for a specific location.

The different ways to configure the tiles generation can be seen in the default configuration file.

If you have forwarded the port, you can check the tile generation at http://localhost:16534/jobs and check a vector tile based map on http://localhost:8585

Updating tiles

During the initial creation of the PG database, state and configuration files is initialized in the update_tiles_data volume from the .pbf metadata. To launch the tiles update, run the update-tiles task (defined in load_db tasks):

./exec.py update-tiles

During this task:

  • osmosis will fetch latest changes from openstreetmap.org
  • imposm will apply these changes in the pg databse, and write a file with expired tiles
  • tilerator jobs will be created to generate new tiles

archi

The tile server architecture can be seen at QwantMaps

sub-folders

Normally you shouldn't need to change anything in the subfolders: everything is handled inside the docker files through exec.py. However, if you're interested in what these sub-folders are used for, go take a look to their README.md file.

configuration files

The SQL and imposm mapping generation is quite straigthforward (cf. generate-sql and generate-imposm3 in the documentation).

The data_tm2source_*.xml generation is a bit more complex. We use generate-tm2source to generate a Carto project .yml file. This file is transformed to a Mapnik .xml project using kosmtik.

See more details on https://github.com/Qwant/openmaptiles

kartotherian_docker's People

Contributors

amatissart avatar antoine-de avatar bbecquet avatar codeurimpulsif avatar dependabot[bot] avatar guillaumegomez avatar jbgriesner avatar liek0s avatar nlehuby avatar reddoxster avatar remi-dupre avatar sdrll avatar tcitworld avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.