OGRLayer::GetFIDColumn() and GetGeometryColumn() just return empty strings from Python bindings
|Reported by:||jjr8||Owned by:||warmerdam|
I tried this with both the shape and pgeo drivers and they both returned empty strings. I did not try this with any other language bindings, so I don't know if it is a problem with the Python bindings or with the drivers themselves. I looked through previous bugs and came across #2013, which suggests these functions are supposed to work for Python bindings in 1.5.0. I'm assuming the problem is with the drivers. Please reassign as appropriate.
- On Windows, follow steps 1 and 2 on #2688 to install Python 2.5.2, GDAL 1.5.0, and the Python bindings.
- Download the attached ZIP and uncompress to C:\. It will create a directory C:\TestPGeo with a shapefile and personal geodatabase in it.
- From a CMD shell, run C:\Python25\python.exe and run this:
>>> ds = ogr.Open('C:\\TestPGeo\\TestPoints.shp') >>> layer = ds.GetLayer(0) >>> layer.GetFIDColumn() '' >>> layer.GetGeometryColumn() '' >>> del layer,ds >>> ds = ogr.Open('C:\\TestPGeo\\MyGeoDB.mdb') >>> layer = ds.GetLayerByName('TestPoints') >>> layer.GetFIDColumn() '' >>> layer.GetGeometryColumn() ''
This is not a critical bug for my application. For my next release, I only need to read shapefiles and PGDBs, and the names of the FID and geometry columns are well-known for these formats. I can just hard code them. But the overall usability of OGR would be improved if all drivers returned these consistently. (I do understand there are some issues for formats that support multiple geometry columns, but it seems straightforward to implement it for all drivers that support just one column.)
Thanks for looking at this.