Skip to content

How to filter (postgis) Multipolygon in LUA #2357

Answered by joto
tordans asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tordans
Comment options

Answer selected by tordans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants