[gdal-dev] “AttributeError: getZ” error when trying to get the elevation of DXF linestrings

Even Rouault even.rouault at mines-paris.org
Sun Jun 24 10:59:23 PDT 2012


>       myElevation = myFeature.GetGeometryRef().getZ(0)
> -----------
> 
> But I get an "AttributeError: getZ" error when executing it.

The method name is GetZ(). And due to how the memory management of the python 
bindings work, I'd encourage you storing the geometry in a temporary variable 
before calling GetZ()

myGeom = myFeature.GetGeometryRef()
myElevation = myGeom.GetZ()


More information about the gdal-dev mailing list