[gdal-dev] Re: OGR FileGDB driver: ERROR 1: 'OBJECTID' not recognised as an available field.

Hermann Peifer peifer at gmx.eu
Thu Sep 15 03:06:22 EDT 2011


On 15/09/2011 06:17, Paul Ramsey wrote:
> Interesting. I wonder if this is a mismatch between FGDB considering
> the fid to be a column and ogr considering it to be something more
> intrinsic... I think it warrants a ticket unless other layer types
> misbehave in a similar way.
>
> P.
>

Being an (innocent) GDAL user, I wouldn't know where the (mis-)behaviour 
comes from. I will file a ticket. I just noted another issue related to 
column OBJECTID:

In another FileGDB, I have 2 layers: a simple table without geometry 
(FSTA2009_grid) and a FeatureClass with 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]

Hermann


[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


More information about the gdal-dev mailing list