Skip to main content
5 of 5
replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/

OGR - Weird GeomType -2147483645 on polygon shapefile

I am trying to import a shapefile (multipolygon) in an app with ogr but I got an error about invalid geom type. If I inspect the data with ogr like this:

datasource = ogr.Open("c:\\temp\\data.shp")
layer = datasource.GetLayer(0)
print(layer.GetGeomType())

The print returns: >> -2147483645

I wonder what Geom Type is this. Is it an error in the data or is it a real Geom Type?

Edit: After using ogrinfo as elrobis suggested I have this output:

INFO: Open of C:\\ArcGIS data\\Mun_region.shp' using driver ESRI Shapefile' successful.

Layer name: Mun_region Geometry: 3D Polygon Feature Count: 2 Layer SRS WKT: (unknown) OGR_GEOMETRY: String (0.0) OGRFeature(Mun_region):0
OGR_GEOMETRY (String) = MULTIPOLYGON

OGRFeature(Mun_region):1 OGR_GEOMETRY (String) = POLYGON

Below the Radar
  • 3.6k
  • 1
  • 31
  • 60