Opened 18 years ago

Last modified 15 years ago

#1017 closed defect

[OGR-GML] fids written by the GML driver are not read back correctly — at Version 2

Reported by: sebastien.grignard@… Owned by: chaitanya
Priority: normal Milestone: 1.7.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: GML
Cc: gdal@…, warmerdam

Description (last modified by warmerdam)

All fids written by the GML driver (F...) are ignored by the reader.

Change History (3)

by sebastien.grignard@…, 18 years ago

Attachment: patch.diff added

This patch tries to detect if the GML fid was written by the OGR driver to assign it correctly

comment:1 by warmerdam, 18 years ago

Sebastian,

I'm still not comfortable with the FID handling.  It seems like we could
get very screwy FID values in some situations, and non-unique fids could be
pretty bad karma. 

I'll leave this bug report open for the time being and think about it a bit. 

comment:2 by warmerdam, 15 years ago

Cc: gdal@… warmerdam added
Description: modified (diff)
Keywords: GML added
Owner: changed from warmerdam to chaitanya
Priority: highnormal
Status: assignednew

Chaitanya,

Could you please revise the patch to work properly against trunk, and to do some more careful evaluation of the FID values. In particular I would like:

  • The FID values to be more completely scanned to ensure they are strictly a string of numeric digits, potentially prefixed by "F", and with no other characters, spaces, etc.
  • Each time an FID value is extracted, iNextGMLId should be set to the maximum of the existing iNextGMLId value, and the FID value plus 1 - the objective here is to keep track of the next safe FID we could assign if we need to switch to serial fid assignment, without risk of conflicting with any existing FIDs.
  • Keep a flag indicating whether we have encountered any illegal FIDs, in which case we will assign the FIDs serially even if the current FID seems legitimate.

If/when you are satisfied with these changes, please then extent autotest/ogr/ogr_gml_read.py to test these new capabilities and special cases, including introducing new (small) test files as needed.

Note: See TracTickets for help on using tickets.