Opened 11 years ago

Closed 11 years ago

#4555 closed enhancement (fixed)

NAS: better support for wfsext:Replace

Reported by: jef Owned by: warmerdam
Priority: normal Milestone: 1.10.0
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: nas
Cc: astrid_emde

Description (last modified by jef)

The attached patches improves support for NAS updates (NBA) in GDAL/OGR and PostNAS (unfortunately their TRAC seems to be readonly).

The patch extends the virtual "delete" feature class with following fields:

  • context - that contains the context of the delete ('delete' or 'replace')
  • replacedBy - gml:id of the feature the phased out feature is replaced with
  • safeToIgnore - value of the corresponding wfsext::Replace attribute

The fields are collected when processing the "delete" layer. The patch also arranges that "delete" is always the last layer and therefore also is processed last by ogr2ogr.

There's also a workaround for a common error in NAS data, where a single Z value is transported in a gml:pos element. The function now interprets those as 3D-Point (0,0,Z) and produces a warning instead of an error.

The postnas patch:

  • all feature classes get a 'endet' with the end date of deleted or replaced feature
  • the delete_feature function is now a trigger that is run on INSERT. It updates the "endet" field of phased out features (either with the current timestamp on 'delete' or with the 'beginnt' timestamp of the replacing feature) and also relies on the "identifier" field.
  • the manual updates to geometry_columns were replaces with calls to AddGeometryColumn() (for PostGIS 2.0; columns that contain more than one geometry type are now GEOMETRY)
  • the gml_id indices now also include "beginnt".
  • s/character varying/varchar/
  • "ax_punktortau" is now a 3D point (possibly other tables need to be updated, too)

ogr2ogr should now work without -skipfailures, if the data is correct.

Attachments (2)

postnas.diff (197.2 KB ) - added by jef 11 years ago.
PostNAS 0.7 changes
gdal-nas.diff (11.7 KB ) - added by jef 11 years ago.
GDAL/OGR changes

Download all attachments as: .zip

Change History (8)

by jef, 11 years ago

Attachment: postnas.diff added

PostNAS 0.7 changes

comment:1 by jef, 11 years ago

Description: modified (diff)

comment:2 by Even Rouault, 11 years ago

Is there a sample to test the OGR patch ? I'm a bit skeptical about the hack in ParseGMLCoordinates(). Unless it is legal GML (and in which case I'd put the coordinate in X not in Z), I'm afraid it is a bit too specific for general GML decoding. Couldn't it be detected before calling OGR_G_CreateFromGMLTree() ?

For the postnas patch, I assume you are aware we are not in a position to do anything with it, but I also saw so hopefully, the relevant people will be able to take care about that.

comment:3 by warmerdam, 11 years ago

Cc: astrid_emde added

Adding Astrid. I'd like to see test data and an extension to the test suite for this. I too am concerned about the changes to the core <pos> handling.

by jef, 11 years ago

Attachment: gdal-nas.diff added

GDAL/OGR changes

in reply to:  2 comment:5 by jef, 11 years ago

Description: modified (diff)

Replying to rouault:

Couldn't it be detected before calling OGR_G_CreateFromGMLTree()?


comment:6 by Even Rouault, 11 years ago

Milestone: 2.0.0
Resolution: fixed
Status: newclosed

Patch applied in r24105 with minor changes. I've extended a bit the to test for the new fields.

Note: See TracTickets for help on using tickets.