When I use the GetGeomType() with GDAL/OGR it returns an integer. I want to know what geometry type each integer represents.
driver = ogr.GetDriverByName("FileGDB")
gdb = r"C:\Users\******\Documents\ArcGIS\Default.gdb"
ds = driver.Open(gdb, 0)
input_lyr_name = "Birmingham_Burglaries_2016"
lyr = ds.GetLayerByName(input_lyr_name)
# access the schema info
lyr_def = lyr.GetLayerDefn()
print lyr_def.GetGeomType()
Output: 1
I already know an alternative way to get the geometry type as below, but I am interested to match integers to the correct geometry type. Is there a list somewhere?
first_feat = lyr.GetFeature(1)
print first_feat.geometry().GetGeometryName()
Output: POINT
But this won't work on an empty dataset.
print ogr.GeometryTypeToName(lyr_def.GetGeomType())