0

I am looking at the best/efficient way to decompose OSM relations and store as geography, currently I am using:

https://raw.githubusercontent.com/tyrasd/osmtogeojson/gh-pages/osmtogeojson.js

to first get the relevant ways and nodes, put the tags into proper format and use this function in my SQL to return the geometry in GeoJSON format and then using ST_GEOGFROMGEOJSON on that, however, this seems to not be robust and I think some polygons are not stored correctly, namely the multipolygons with polygons inside a polygon,

As an example:

https://www.openstreetmap.org/relation/9321672

In my geography it is stored as a LINESTRING, instead of a MULTIPOLYGON, I think hence the geometry is not constructed properly, what are your suggestions regarding this? I'd like to preferably keep my solution in SQL.

1
  • There is no standard method for handling that kind of OSM geometry. The multipolygon relation is not tagged according to the rules wiki.openstreetmap.org/wiki/Relation:multipolygon but that happens in OpenStreetMap. I would suggest to edit the relation in OSM but unfortunately I don't know how to tag it correctly.
    – user30184
    Commented Jun 12 at 18:51

0