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 looks like this behaviour has changed since 2012 and Geoserver 2.1.3 and the 
example used in this blog does not work any more in a similar way 
http://www.geo-solutions.it/blog/wfs-for-the-masses-adding-support-for-paging-and-sorting-in-geoserver/.

-Jukka Rahkonen-


________________________________
Andrea Aime wrote:

On Fri, May 2, 2014 at 2:31 PM, Rahkonen Jukka (Tike) 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

I am getting results which look faulty to me from my local Geoserver 2.5 and 
also from demo.opengeo.org<http://demo.opengeo.org> which is running some 2.4 
snapshot version.

http://demo.opengeo.org/geoserver/wfs?service=wfs&version=2.0.0&request=getfeature&typename=topp:states&count=2&startindex=30
http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=topp:states&STARTINDEX=20&MaxFeatures=2

First fid with startindex=30 should be states.31 and with startindex=20 
states.21, shouldn't? I am getting first features as states.37 and states.28, 
respectively.

Hi Jukka,
first an observation, in general you cannot assume you will get the features in 
any particular particular order unless you apply an explicit sort by clause.
That said, let me try a local request with a startindex=0:

http://localhost:8080/geoserver/wfs?service=wfs&version=2.0.0&request=getfeature&typename=topp:states&propertyname=STATE_NAME&startIndex=0

The result is that I get the features sorted by fid, so I have states.1, 
states.11, states.12, ... states.20, states.21, ... states.30, states.31 and so 
on.
And if I add a startIndex > 0, then I get the data properly shifted.
Order and position of returned features is not changing if I modify the version.

Long story short, it seems it's working as it should

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

-------------------------------------------------------
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to