-
Some context: We are doing some work of our processing in LUA and some in SQL.
We want to process the Polygons and insert them in a table with geometry type Polygon. (The data we are working with are small areas (parking spaces), not large relations, so osm2pgsqls auto-splitting (ref) is no concern here.) What is the best way to do this?
Our current approach:
I this the way you would solve this? A different approach might be to check the Update the docs? If this is the recommended approach, would this be something for the docs?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't understand why you just ignore multipolygons with more than one polygon in it. You'll loose data that way. It seems to me it would be much simpler to iterate over all polygons in the multipolygon and insert each one on its own (example). That way you have all the data and don't need to mess around with multipolygons in the database. If you really want to ignore multipolygons with more than one polygon in it, the |
Beta Was this translation helpful? Give feedback.
I don't understand why you just ignore multipolygons with more than one polygon in it. You'll loose data that way. It seems to me it would be much simpler to iterate over all polygons in the multipolygon and insert each one on its own (example). That way you have all the data and don't need to mess around with multipolygons in the database.
If you really want to ignore multipolygons with more than one polygon in it, the
num_geometries() == 1
is the correct way of doing this. Any other check (with members and roles and so on) will not work for all cases.