NAS: better support for wfsext:Replace
|Reported by:||jef||Owned by:||warmerdam|
Description (last modified by )
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.