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:
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.