Repository navigation
|
Afternoon! Quick question regarding creating feature classes with a mixture of both single and multi geometries (i.e. loading a country dataset where some countries are single polygons, whereas others are multi-polygons). What should a user set the fc = gpkg.create_feature_class(
'test', srs, fields=fields, shape_type=GeometryType.polygon
)or fc = gpkg.create_feature_class(
'test', srs, fields=fields, shape_type=GeometryType.multi_polygon
)Additionally, assuming this is something we can do, I assume there's no issue passing a list of mixed-type geometries to the Thanks! |
Answered by
jlhumber
Aug 9, 2022
Replies: 1 comment 1 reply
|
You could use either approach above but would not recommend trying to mix geometry types, probably depends on your use case which you choose.
|
1 reply
Answer selected by
jlhumber
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could use either approach above but would not recommend trying to mix geometry types, probably depends on your use case which you choose.
GeometryType.polygonit would be one polygon for each part of a country (e.g. the USA would be a record for Lower 48, a record for Hawaii (each island), a record for Alaska, ... and so on).GeometryType.multi_polygonthen each record you insert needs to be aMultiPolygon, even is there is just one polygon you'd still make it aMultiPolygon(look attest_multi_polygonfor an example of creating aMultiPolygon)