Ticket #4253 (closed defect: wontfix)
OGR FileGDB driver: 'OBJECTID' not recognised as an available field.
| Reported by: | peifer | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | default | Version: | unspecified |
| Severity: | normal | Keywords: | FileGDB |
| Cc: | pramsey |
Description
OGR's -where switch seems to be aware of the OBJECTID field in a FileGDB, whereas the -sql option reports: 'OBJECTID' not recognised as an available field, see (0) below.
I observed a potentially related behaviour for another FileGDB, which has 2 layers: a simple table without geometry (FSTA2009_grid) and a Feature Class with a polygon geometry (eea_1Kgrid). Table FSTA2009_grid seems to have a FID column which has 2 names at the same time: OBJECTID_1 and OBJECTID, see (1)
ogrinfo -where understands both: OBJECTID_1 and OBJECTID, see (2)
ogrinfo -sql only understands OBJECTID, see (3)
(0) $ ogrinfo -q -geom=no out.gdb eea_1Kgrid -where OBJECTID=1 Layer name: eea_1Kgrid OGRFeature(eea_1Kgrid):1 CELLCODE (String) = E1647N1038 Shape_Length (Real) = 0.0383874724895616 Shape_Area (Real) = 9.18055152110593e-05 $ ogrinfo -q -geom=no out.gdb -sql "select * from eea_1Kgrid where OBJECTID=1" ERROR 1: 'OBJECTID' not recognised as an available field.
(1)
$ ogrinfo -al -so FSTA2009_grid.gdb
INFO: Open of `FSTA2009_grid.gdb'
using driver `FileGDB' successful.
Layer name: FSTA2009_grid
Geometry: None
Feature Count: 4735968
Layer SRS WKT:
(unknown)
FID Column = OBJECTID_1
OBJECTID: Integer (0.0)
CELLCODE: String (0.0)
FGA1_M: Real (0.0)
FGA1_S: Real (0.0)
FGA2_M: Real (0.0)
FGA2_S: Real (0.0)
FGB2_M: Real (0.0)
FGB2_S: Real (0.0)
Layer name: eea_1Kgrid
Geometry: Multi Polygon
Feature Count: 4948506
Extent: (1547000.000100, 940999.999400) - (6525999.999900, 5416162.796700)
Layer SRS WKT:
PROJCS["ETRS89 / LAEA Europe",
GEOGCS["ETRS89",
DATUM["European_Terrestrial_Reference_System_1989",
SPHEROID["GRS 1980",6378137,298.257222101,
AUTHORITY["EPSG","7019"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6258"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4258"]],
PROJECTION["Lambert_Azimuthal_Equal_Area"],
PARAMETER["latitude_of_center",52],
PARAMETER["longitude_of_center",10],
PARAMETER["false_easting",4321000],
PARAMETER["false_northing",3210000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["Y",NORTH],
AXIS["X",EAST],
AUTHORITY["EPSG","3035"]]
FID Column = OBJECTID
Geometry Column = Shape
CELLCODE: String (0.0)
Shape_Length: Real (0.0)
Shape_Area: Real (0.0)
(2) $ ogrinfo -q FSTA2009_grid.gdb FSTA2009_grid -where OBJECTID_1=1 Layer name: FSTA2009_grid OGRFeature(FSTA2009_grid):1 OBJECTID (Integer) = 1 CELLCODE (String) = E1647N1038 FGA1_M (Real) = 365.10730848 FGA1_S (Real) = 2.73892079609 FGA2_M (Real) = 71.7346430224 FGA2_S (Real) = 13.9402659282 FGB2_M (Real) = 71.7751336583 FGB2_S (Real) = 13.9324017808 $ ogrinfo -q FSTA2009_grid.gdb FSTA2009_grid -where OBJECTID=1 Layer name: FSTA2009_grid OGRFeature(FSTA2009_grid):1 OBJECTID (Integer) = 1 CELLCODE (String) = E1647N1038 FGA1_M (Real) = 365.10730848 FGA1_S (Real) = 2.73892079609 FGA2_M (Real) = 71.7346430224 FGA2_S (Real) = 13.9402659282 FGB2_M (Real) = 71.7751336583 FGB2_S (Real) = 13.9324017808
(3) $ ogrinfo -q FSTA2009_grid.gdb -sql "select * from FSTA2009_grid where OBJECTID_1=1" ERROR 1: 'OBJECTID_1' not recognised as an available field. $ ogrinfo -q FSTA2009_grid.gdb -sql "select * from FSTA2009_grid where OBJECTID=1" Layer name: FSTA2009_grid OGRFeature(FSTA2009_grid):1 OBJECTID (Integer) = 1 CELLCODE (String) = E1647N1038 FGA1_M (Real) = 365.10730848 FGA1_S (Real) = 2.73892079609 FGA2_M (Real) = 71.7346430224 FGA2_S (Real) = 13.9402659282 FGB2_M (Real) = 71.7751336583 FGB2_S (Real) = 13.9324017808
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

