Skip to content

Latest commit

 

History

History
110 lines (70 loc) · 2.89 KB

INSTALL.md

File metadata and controls

110 lines (70 loc) · 2.89 KB

Install

These instructions are for installing the shortbread code, not street spirit itself.

Requirements

Installing dependencies

Install tilekiln into a Python virtualenv with

python3 -m venv venv
venv/bin/pip install tilekiln

Themepark

Install themepark to somewhere on your system, e.g. $HOME/osm2pgsql-themepark

git clone https://github.com/osm2pgsql-dev/osm2pgsql-themepark.git $HOME/osm2pgsql-themepark

Set your LUA_PATH to include themepark, e.g.

export LUA_PATH="$HOME/osm2pgsql-themepark/lua/?.lua;;"

Loading Data

Data can be loaded to create tiles for Street Spirit, Shortbread, or both.

OpenStreetMap Data

You need OpenStreetMap data loaded into a PostGIS database. These stylesheets expect a database generated with osm2pgsql using the flex backend with the supplied Lua scripts.

Start by creating a database and enabling PostGIS

sudo -u postgres createuser -s $USER
createdb spirit
psql -d spirit -c 'CREATE EXTENSION postgis;'

Grab some OpenStreetMap data. It's probably easiest to grab a PBF of OSM data from Geofabrik. Once you've done that, import with osm2pgsql:

osm2pgsql --output flex --style shortbread.lua -d spirit ~/path/to/data.osm.pbf

If you are only creating Shortbread tiles, instead of --style shortbread.lua use --style spirit.lua

Scripted download

Some features are rendered using preprocessed shapefiles.

To download them and import them into the database you can run the following script

scripts/get-external-data.py

The script downloads shapefiles, loads them into the database and sets up the tables for rendering. Additional script option documentation can be seen with scripts/get-external-data.py --help.

Serving tiles

Once tilekiln is installed, run it in development mode with

venv/bin/tilekiln dev --config shortbread.yaml --source-dbname spirit

To create shortbread tiles, instead use --config spirit.yaml. If only creating shortbread tiles you do not need to serve sprites or view the style.

Street spirit notes

You only need these if not generating shortbread

Install charites with

npm install @unvt/charites @basemaps/sprites

Serving sprites

In another terminal window, run

node_modules/.bin/basemaps-sprites sprites && python3 serve.py

Viewing the style

With tiles being served in one terminal session, run a local style server with

node_modules/.bin/charites serve style.yaml