Opened 12 years ago

Closed 12 years ago

#4637 closed defect (fixed)

VRT driver does not implement GetFIDColumn()

Reported by: kyngchaos Owned by: warmerdam
Priority: normal Milestone: 1.10.0
Component: OGR_SF Version: 1.9.0
Severity: normal Keywords: vrt
Cc:

Description (last modified by warmerdam)

The VRT driver does not implement the GetFIDColumn() method for cases when the <FID> tag is used to specify a source attribute to use as FID.

Change History (5)

comment:1 by warmerdam, 12 years ago

Keywords: vrt added

William,

This is not an actionable bug report.

If I'm in autotest/ogr and issue the following command I see FID's reported by ogrinfo through the VRT driver based on the FID column.

warmerdam@gdal:~/gdal/autotest/ogr$ ogrinfo data/vrt_test.vrt test4
INFO: Open of `data/vrt_test.vrt'
      using driver `VRT' successful.

Layer name: test4
Geometry: Point
Feature Count: 2
Extent: (12.500000, 17.000000) - (100.000000, 200.000000)
Layer SRS WKT:
(unknown)
fid: Integer (8.0)
other: String (8.0)
x: Real (8.3)
y: Real (8.3)
z: Real (8.3)
wkt: String (30.0)
OGRFeature(test4):1
  fid (Integer) = 1
  other (String) = First
  x (Real) =   12.500
  y (Real) =   17.000
  z (Real) =    1.200
  wkt (String) = POINT(12.5 17 1.2)
  POINT (12.5 17.0 1.2)

OGRFeature(test4):2
  fid (Integer) = 2
  other (String) = Second
  x (Real) =  100.000
  y (Real) =  200.000
  z (Real) =    0.000
  wkt (String) = POINT(100 200 0)
  POINT (100 200 0)

So obviously there is something specific about your problem that you are going to have to support.

comment:2 by Even Rouault, 12 years ago

Well, William meant that the *name* of the FID column is not reported. See http://lists.osgeo.org/pipermail/gdal-dev/2012-April/032584.html

comment:3 by warmerdam, 12 years ago

Description: modified (diff)
Summary: vrt driver does not report FID column infoVRT driver does not implement GetFIDColumn()

Subject and text updated accordingly.

Note that I suspect the result of a VRT does not have to have all the attributes of the source and so the FID column from the source might not actually appear in the virtual layer. In such a case GetFIDColumn() should *not* return the name.

comment:4 by warmerdam, 12 years ago

Milestone: 1.9.1

comment:5 by Even Rouault, 12 years ago

Milestone: 2.0.0
Resolution: fixed
Status: newclosed

r24311 /trunk/ (4 files in 3 dirs): VRT: implement GetFIDColumn() (#4637)

Frank, I agree with your restriction that the "FID column from the source might not actually appear in the virtual layer. In such a case GetFIDColumn() should *not* return the name". But actually that's not always respected by other drivers.

For example, see the PG driver where the FID column is 'hidden' in the regular fields, but exposed at the FID column by GetFIDColumn(). But in that situation, what is reported by the GetFIDColumn() can be queried with ExecuteSQL() (as it is directly interpreted by the PG driver engine.

$ ogrinfo pg:dbname=autotest poly -so -al
INFO: Open of `pg:dbname=autotest'
      using driver `PostgreSQL' successful.

Layer name: poly
Geometry: Multi Polygon
Feature Count: 9
Extent: (478315.531250, 4762880.500000) - (481645.312500, 4765610.500000)
Layer SRS WKT:
(unknown)
FID Column = ogc_fid
Geometry Column = wkb_geometry
area: Real (12.3)
eas_id: Real (0.0)
prfedea: String (16.0)

But that's a bit of the particular case, and I haven't tried to address that.

Note: See TracTickets for help on using tickets.