Skip to content

OpenTransitTools/omt_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omt_server

The omt_server project is:

  1. a build / run environment atop OpenMapTiles https://github.com/openmaptiles/openmaptiles
  2. it includes scripts to build tiles (mbtile file) from OSM data
  3. it also includes scripts to run a GL server based off a built .mbtiles file
  4. there are also a set of gl styles that GL can consume
  5. finally, there scripts to manage (nuke) docker, etc...

build tile *.mbtiles file from OSM:

  1. cd ~/omt_server/
  2. scripts/git_update.sh
  3. cp <your_OSM_data>.osm.pbf openmaptiles/data/
  4. scripts/import.sh
  5. openmaptiles/data/*.mbtiles file is generated(as well as some meta data files) NOTE: import.sh is configured to generate 16 layers of data, which takes ~2 hours for a sub-state region (NW Oregon, SW Washington) larger regions should probably ramp down the layers parameter. See scripts/yml_updates.sh

run tile server:

  1. cd ~/omt_server/gl
  2. ls ./data -> borders or-wa.dc-config.yml or-wa.mbtiles
  3. tmux new-session -d -s my_session 'run.sh >> out.txt 2>&1'
  4. http://localhost:8080

edit styles:

  1. mapnik
  2. Might have to understand underlying data: https://openmaptiles.org/schema/#poi
  3. Finally, the editor might muck with the data and font URLs. So good to have an script to fix that... "glyphs": "http://localhost:8080/fonts/{fontstack}/{range}.pbf", "glyphs": "{fontstack}/{range}.pbf", "url": "http://localhost:8080/data/or-wa.json" "url": "mbtiles://or-wa.mbtiles"

validate style.json

  1. https://github.com/mapbox/mapbox-gl-js/tree/main/src/style-spec
  2. npm install @mapbox/mapbox-gl-style-spec --global # caution global
  3. gl-style-validate gl/style/trimet.json

add fonts:

  1. download the font file (e.g., https://fonts.google.com/specimen/Source+Sans+Pro#standard-styles)
  2. run the font converter:
  3. cp ./_output/* ../omt_tiles/gl/fonts/

ws endpoints