[Geoserver-users] MaxFeatures/Count+Startindex broken?

Hi,

I was reading the WFS 2.0.0 standard http://portal.opengeospatial.org/files/?artifact_id=39967 and

according to standard having startIndex=0 shoud not have an effect on the order of features.

I can confirm that GS 2.5 in strict CITE mode fulfills this requirement with WFS 2.0.0 and features come always in order states.1, states.10, states.11…

When not in strict mode Geoserver is changing the feature order from 1, 2, 3… into 1, 10, 11 even with WFS 2.0.0. With WFS 1.0.0 and 1.1.0 that change happens also with the strict CITE mode but the whole startindex support for those WFS versions is only a nice Geoserver extra.

I am not after any action to change the behaviour, I was just curious to understand what happens and why.

The startIndex test for startIndex is on page 124 of WFS 2.0.0 standard:

(OK, a nit-picky person could say that “Verify that the response document begins at the feature whose index is the value of the startIndex” is fulfilled because response begins with states.1, it is only the second feature and after that which are different…)

A.2.16

Standard presentation parameters

A.2.16.1

startIndex parameter

a)

Test Purpose: Verify that the server correctly handles the startIndex parameter.

b)

Test Method: Devise and execute a GetFeature request without the startIndex parameter and note the response. Execute the same GetFeature request a second time including the startIndex parameter. Verify that the response document begins at the feature whose index is the value of the startIndex.

c)

Reference: 7.6.3.4

d)

Test Type: Basic

-Jukka Rahkonen-

···

Lähettäjä: Rahkonen Jukka (Tike) [mailto:jukka.rahkonen@…486…]
Lähetetty: 4. toukokuuta 2014 17:50
Vastaanottaja: GeoServer Mailing List List
Aihe: Re: [Geoserver-users] MaxFeatures/Count+Startindex broken?

Hi,

Then the last thing to do would be to make Simone to edit the previously mentioned blog http://www.geo-solutions.it/blog/wfs-for-the-masses-adding-support-for-paging-and-sorting-in-geoserver/. The blog is quite high on search results of “geoserver+startindex” and but the examples do not work in the same way with current Geoserver versions. Text should emphasize that for reading the first page of features user must explicitly use “startindex=0”. Editing the text would be better than to add a comment because all users do not read the comments.

Geoserver documentation mentions that startindex exists in http://docs.geoserver.org/stable/en/user/services/wfs/basics.html. However, there is nothing about it in WFS reference http://docs.geoserver.org/stable/en/user/services/wfs/reference.html. Startindex is included in the WMS manual http://docs.geoserver.org/stable/en/user/services/wms/vendor.html but text is not totally up to date. Startindex works nowadays with all stores and it would be worth telling also here that startindex=0 may give different results than request that does not have startindex at all.

-Jukka Rahkonen-

Andrea Aime wrote:

On Sun, May 4, 2014 at 1:55 PM, Rahkonen Jukka (Tike) <jukka.rahkonen@…486…> wrote:

Hi,

OK, with the startindex values I did not see that startindex is changing the sorting to alphabetical. Plain GetFeature with maxFeatures returns features in order states.1, states.2, states.3 but adding startindex is really changing the order into states.1, states.10, states.11.

I perhaps agree that current behaviour is acceptable bu it is not logical, and Geoserver users must know that they must load data in pages always with startindex because startindex=0 does not return the sama data than if parameter is not used at all.

It may be counter-intuitive, I agree, but forcing a sort is the only way to get stable paging across all data sources.

But of course, we initiate that only if the client shows an intent to page, without a startIndex we avoid it to get better performance.

Cheers

Andrea

==

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK

for more information.

==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it