Ticket #3010 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

WFS transactions should work for features with null geometry

Reported by: tschaub Owned by: tschaub
Priority: minor Milestone: 2.11 Release
Component: Format.WFST Version: 2.10
Keywords: Cc:
State:

Description

Ticket #2033 dealt with features that have no geometry field in the schema.

It is also acceptable to have a geometry field and issue transactions with null geometry.

Attachments

3010.patch Download (2.7 KB) - added by tschaub 2 years ago.
handle null geometry
3010-more.patch Download (2.0 KB) - added by tschaub 2 years ago.
omit wfs:Value element for all null values

Change History

Changed 2 years ago by tschaub

handle null geometry

Changed 2 years ago by tschaub

  • state set to Review

Tests pass. Thanks for any review.

Changed 2 years ago by ahocevar

  • state changed from Review to Commit

Thanks for the verbose tests. Great work. Please commit.

Changed 2 years ago by tschaub

  • status changed from new to closed
  • state Commit deleted
  • resolution set to fixed

Thanks for the review. Closed w/ r11031.

Changed 2 years ago by tschaub

  • status changed from closed to reopened
  • resolution fixed deleted

Ok, so it turns out that while GeoServer accepts <wfs:Value></wfs:Value> as a null for Geometry, the correct way to do an update with a property value of null is to omit the <wfs:Value> element altogether.

Changed 2 years ago by tschaub

omit wfs:Value element for all null values

Changed 2 years ago by tschaub

  • state set to Review

We already had the correct behavior in the <wfs:Property> writer. Where this writer encounters null values, it writes a <wfs:Name> but not a wfs:Value element. The exception with geometry was because we were waiting to set the format's srsName property until the geometry was written. By setting srsName earlier, we can pass the geometry along to the <wfs:Property> writer and this does the right thing if the geometry is null.

Tests passing. Thanks for review.

Changed 2 years ago by ahocevar

  • state changed from Review to Commit

Looks like a simple fix, but I can imagine it took some quite some time to find this very elegant solution! Thanks for the hard work on this. Assuming that tests pass, please commit.

Changed 2 years ago by tschaub

  • status changed from reopened to closed
  • state Commit deleted
  • resolution set to fixed

Thanks for the review. Closed w/ r11034.

Note: See TracTickets for help on using tickets.