I am trying to read a geodatabase using Fiona, but I keep coming across the error:

  fiona.errors.UnsupportedGeometryTypeError: 12L

Which I am very unsure why it is happening.

I've done the following background checks:

  {'ESRI Shapefile': 'raw', 'OpenFileGDB': 'r', 'SUA': 'r', 'ARCGEN': 'r', 'GeoJSON': 'rw', 'GPKG': 'rw', 'Idrisi': 'r', 'GPX': 'raw', 'SEGY': 'r', 'BNA': 'raw', 'AeronavFAA': 'r', 'GPSTrackMaker': 'raw', 'DGN': 'raw', 'PCIDSK': 'r', 'MapInfo File': 'raw', 'DXF': 'raw'}

  Going_in = fiona.open(SourceDatabasePolygons) #this is the geodatabase
  print Going_in.meta

which gives:

  {'crs': {'init': u'epsg:28353'}, 'driver': u'OpenFileGDB', [//////OP 
  omitted///////]', 'schema': {'geometry': 'MultiPolygon',[//////OP 

Multipolygon is listed as a possibly geometry type at Fiona docs.

When I open the database to check the data it does list the individual components as polygons (which are also supported).

I am completely at a loss as to why I can get it to work as I am attempting to get this segment of code to run:

  with fiona.open(SourceDatabasePolygons, layer=0) as Poly:
      with fiona.open(SourceDatabasePoints, layer=0) as F_Point:
              if shape(F_Point['geometry']).within(shape(Poly['geometry'])):  
                  print "true"       

Any ideas?

  • Maybe worth trying to read it using the OGR to isolate the problem (that is, is it fiona related error or the GEOS related error) Feb 17 '18 at 6:00

I have had this error too. I believe the culprits were a single multipolygon feature intersecting itself, and features with Bezier curves created in ArcMap. The former was resolved by correcting topology, and the latter was resolved by exporting the feature class to a shapefile and then importing it as a feature class back into the geodatabase.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.