-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Append support for MultiPolygons in shapefiles #18
Comments
Here is a possible, a bit hackish: I also improved the error output if the property schema differs. |
I feel that this is an important issue. It is quite common to have shapefiles that contain multipolygons. Here is a convoluted workaround for processing Shapefiles that contain MultiPolygon geometries.:
|
(Info copied from #26) See http://www.gdal.org/ogr/drv_shapefile.html:
When reading from a "polygon" type shapefile, you might get polygons or multi-polygon features. TBD: whether to coerce geometries or just relax the single-type constraint in Fiona for just the Shapefile format. |
Use some of the code provided by olt in #18, add several tests, see the LineWritingTest in test_collection.py.
Shapefiles have no type
MultiPolygon
, but they support them anyway (all rings are stored in one polygon). See: http://www.gdal.org/ogr/drv_shapefile.htmlFiona/OGR handles everything right when I create a new Shapefile with geometry type
MultiPolygon
, but when I open it for appending the type changes toPolygon
. Fiona will then refuse to write additional MultiPolygons (seeWritingSession.writerecs
).How should we handle that? Ignore the
Multi
prefix when checking the geometry type for 'ESRI Shapefile' drivers?The text was updated successfully, but these errors were encountered: