Casper generates static map images from hybrid map sources (e.g. raster tiles and mapbox vector tiles) and geojson data from postgres.
go build . && ./casper
id
: The flight id in the weglide DBth
: Thickness of line string
go test
The test cases cover the following scenarios (can be executed without a connection to a weglide DB):
- Flight from Berlin to New York
- Flight from Berlin to Hamburg
- Flight from Berlin to Barcelona
- Flight from Berlin to Rio
- Flight from Frankfurt to Marburg
-
Clone the
wg_main
repository -
Start all the services
-
Make sure that you expose the postgres database with a port mapping: e.g.
ports: - 5432:5432
With this approach you can connect during the development to the database and don't have to create a docker container separately just to connect to the database.
-
Define the following environment variables:
export LOCAL=TRUE export POSTGRES_HOST=127.0.0.1 export POSTGRES_DB=weglide export POSTGRES_USER=weglide_user export POSTGRES_PASS=test export POSTGRES_PORT=5432
- Canvas starts at top left corner!
- Get Flight ID
- Get bbox (bounding box) and linestring from weglide DB
- Calculate required tiles based on bbox
- Download tiles
- Merge all downloaded tiles to one image
- Plot flight
- Crop image