-
I will be more active in this forum shortly I hope, but there has been questions about mixing polygons and multi-polygons with GDAL. Some drivers within GDAL support multiple geometry types, and If however you are using Python and not the GDAL tools then this is the fastest way I know to promote a polygon to a multi-polygon and requires a little bit of knowledge of the WKB spec.
Where g is the original WKB geometry, if g[1] == 3 then you know you have a polygon that needs to be promoted, 6 is the WKB code for multi-polygon. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks Norman - both tips are appreciated. I'm curious if you have a question or issue to raise for discussion, or were you more just trying to share this knowledge? |
Beta Was this translation helpful? Give feedback.
-
Mainly I was looking to share this knowledge as it has been asked in a few blog posts I have seen. I have been working a lot with the buildings dataset and I have feedback for discussion but I will share that in a separate topic with a different header. A single geometry type in the distribution might be easier but it was easy enough to code around. |
Beta Was this translation helpful? Give feedback.
Mainly I was looking to share this knowledge as it has been asked in a few blog posts I have seen. I have been working a lot with the buildings dataset and I have feedback for discussion but I will share that in a separate topic with a different header.
A single geometry type in the distribution might be easier but it was easy enough to code around.