I've recently realized that OpenStreetMap is more than just roads and boundaries. It's incredible. I had no idea. A true masterpiece of community collaboration. However, that creates a small problem. I'm looking to stand up a basic vehicle routing service without all the additional data bells and whistles. (Very cool never the less). I found osmfilter - https://journocode.com/2018/01/08/extract-geodata-openstreetmap-osmfilter/ As well as the categories - https://wiki.openstreetmap.org/wiki/Map_Features That's a lot of possible combinations and potential relationships within the data that if I remove may have unexpected consequences. I'd be looking for some direction on what categories to keep and drop to hit the goal below. Goals:
Thank you for your help. Casey Ref URLs: asked 01 Jul '19, 18:06 chavenor1 |
Routing and tile rendering are entirely separate toolchains. OSM data can power both, but you'll need to process it separately for each application, and run two different servers (those servers can, of course, be on the same box!). Typically to render raster map tiles you'll use the switch2osm workflow, loading data into a PostGIS database with osm2pgsql, and then rendering as tiles with Mapnik, renderd and mod_tile. For routing, you'll use software like OSRM, Graphhopper or Valhalla, each of which has a preparation step and then a route server. Note that OSRM's fast Contraction Hierarchies routing algorithm is very memory-hungry, so if "smaller is better in RAM", you might prefer to choose a tool which offers a slower but more memory-efficient algorithm. By default, each tool chooses a set of features from OSM to render or route along. You can change these by redesigning the stylesheet for the tileserver, or the "routing profile" for the routing tool. The tools have their own filtering abilities so you probably won't need osmfilter. answered 02 Jul '19, 14:28 Richard ♦ Can I slim down the Postgres DB by filtering out stuff I don't need for the tile server? Like I don't need to know where all the bus stops are and so on. Any advice on how to trim it down. For the OSRM -- is one better than the other?
(02 Jul '19, 16:14)
chavenor1
Yes, you can slim the Postgres db by editing the "style file" which tells osm2pgsql which columns to import. Note, however, that you'll then need to edit the stylesheet so that it doesn't try to retrieve data from the columns you've dropped, and that's not necessarily trivial. When you say "is one better than the other", one what?
(02 Jul '19, 20:30)
Richard ♦
|