Uploaded image for project: 'GeoServer'
  1. GeoServer
  2. GEOS-8042

WFS-T Insert FeatureIds being returned in incorrect order

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.9.4, 2.10.2, 2.11-RC1
    • Fix Version/s: 2.9.5, 2.10.3, 2.11.1
    • Component/s: WFS
    • Labels:
      None

      Description

      From Dave Blasby on geoserver-devel:

      I was looking at the WFS-T response for Inserts (it's a list of FIDs). The spec says these should be in the same order as the features in the request's Insert elements.

      However, I'm seeing these in a "strange" order. I think I've tracked it down to the DefaultFeatureCollection implementation. This stores the features in a SortedMap<String, SimpleFeature>, and the iterator just returns them in the text-natural-id-order (ie. "new0", "new1", "new11", "new2", "new3",... – "new11" is in the wrong order). This messes up the order of the new fids for the inserted features.

      Here's it using the DefaultFeatureCollection;
      https://github.com/geoserver/geoserver/blob/2.9.x/src/wfs/src/main/java/org/geoserver/wfs/InsertElementHandler.java#L98

      and the passing it (incorrectly ordered) off to the underlying datastore;
      https://github.com/geoserver/geoserver/blob/2.9.x/src/wfs/src/main/java/org/geoserver/wfs/InsertElementHandler.java#L189

      Here's the DefaultFeatureCollection implementation;
      https://github.com/geotools/geotools/blob/master/modules/library/main/src/main/java/org/geotools/feature/DefaultFeatureCollection.java#L330

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                Alex Alex Goudine
                Reporter:
                jody.garnett jody.garnett
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: