Replies: 1 comment
-
Lets answer the specific questions first:
Now to the wider question of how to approach processing OSM public transport data with osm2pgsql: The support for special types of relations in osm2pgsql is not great. What it boils down to is that in the first stage you identify all I am open to suggestions for adding functionality to osm2pgsql to make all of this easier. But the architecture of osm2pgsql, which essentially is built around the idea that you only look at one OSM object at a time, limits what can be done. Two-stage processing lifts this limitation a little bit, but it is quite difficult to use. Maybe this is something which could be added to the |
Beta Was this translation helpful? Give feedback.
-
I am completely new to osm2pgsql and I'm trying to bring the Openptmap scripts up to date.
The way that it works right now is that it uses Osmfilter to keep only certain tags and only objects with certain tags before importing the planet/region file with osm2pgsql. I am trying to rewrite this into an osm2pgsql flex output Lua script so that I can apply deltas to the database later. One thing that I'm struggling to implement is that the osmfilter file removes any objects with a
railway=platform
tag. Because the removal happens before the import toosm2pgsql
, such objects will also be omitted from the geometries of relations that contain objects with such tags, because the members simply cannot be found in the imported data.I'm struggling to implement this in my Lua script. I successfully manage to ignore ways with
railway=platform
in myosm2pgsql.process_way
script, but if those ways are a member of any relation, they still end up in the geometry of that relation.Right now I’m trying to reproduce the layout of the previous pgsql output with 3 tables, one for points, one for lines and one for polygons. From what I read online, one way to do it would be to instead create tables for nodes, ways and relations and make the relations table not contain any actual geometries, but make it reference the nodes/ways and pull them in using joins in mapnik.xml. I'm imagining I would have to create a
nodes
,ways
,routes
,routes_members
,polygons
andpolygons_members
table, whereroutes
andpolygons
would contain the relations with their tags androutes_members
andpolygons_members
tables would reference the relation members. However, I’m not sure what the SQL query to construct the actual relation geometries would actually look like. Specifically, I'm wondering about:Is there maybe some example code somewhere that already does this?
Beta Was this translation helpful? Give feedback.
All reactions