Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 2.91 KB

README.md

File metadata and controls

29 lines (15 loc) · 2.91 KB

Tegola OpenStreetMap Carto

This repository contains a sample configuration for Tegola that was built from the openstreetmap-carto CartoCSS project using the script in App-CartoCSS2Tegola.

Usage

In order to use this sample, you'll need a render database setup according to the INSTALL.md documentation. Please make sure that your database is created using UTF8 encoding (createdb -E UTF8 -T template0 gis) and that the PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE environment variables provide the necessary information to access the render database (or change these values accordingly). Tegola can then be started as usual and should listen on port 8080:

PGHOST=localhost PGPORT=5432 PGUSER=gis PGPASSWORD=gis PGDATABASE=gis tegola serve --config openstreetmap-carto.toml

The Tangram-based rendering and the docker-compose setup need the Git submodule in the openstreetmap-carto directory, so you have to make sure it is present and up-to-date as well:

git submodule update --init

Tangram-based rendering

This repository also contains a very basic Tangram style below tangram which can be used to render some data in the web browser. This is best done by serving the tangram directory with some local web server and then opening the contained index.html file in a browser. If your render database contains data from Liechtenstein, you should see some buildings, colorful streets, green trees and some POIs. If you don't have data from Liechtenstein, you can change the parameters to the map.setView() call in index.html.

Mapbox-gl-based rendering

This repository also contains a very basic mapbox-gl style below mapboxgl which can be used to render some data in the web browser. This is best done by serving the mapbox directory with some local web server and then opening the contained index.html file in a browser. If your render database contains data from Liechtenstein, you should see some buildings, streets and some water bodies. If you don't have data from Liechtenstein, you can change the center parameter to the mapboxgl.Map() call in index.html.

docker-compose

There is a basic docker-compose.yml configuration that is intended to be used in conjunction with the docker-compose setup of openstreetmap-carto. Once this setup is up and running, a command like

docker-compose -f openstreetmap-carto/docker-compose.yml -f docker-compose.yml up -d webserver tegola

should also start up nginx and Tegola containers. Once they are running, the Tangram-based sample should be available on http://localhost:3000/tangram/index.html and the Mapbox-GL one on http://localhost:3000/mapboxgl/index.html.