On 18/09/18 06:37, Nuno Oliveira wrote: > Hi, > > This is interesting, but is not clear to me to which parts of the code > you are referring too: are you using GeoServer integrated with GeoTools > ? are you referring to GeoTools WFS client ? are you referring to > GeoTools WFS data store ?
I'm running geoserver as a test server, and using a standalone wfs client (geotools) to query it - so two separate jvm processes and two separate code bases. > > A WFS 2.0.0 GetFeature operation send to GeoServer with the startIndex > parameters works as expected: > https://demo.geo-solutions.it/geoserver/tiger/ows?service=WFS&version=2.0.0&request=GetFeature&typeNames=tiger%3Atiger_roads&startIndex=3 Yes, it works beautifully for me as long as I use a layer that's backed by postgis (and not a shapefile). The issue is a lack of support for startIndex in the WFS client. I patched the support in to a few of the WFS classes and everything sprang in to life. The only confusing part was the name maxFeatures - it seems to be more of an endIndex than a maxFeatures. > > > Regards, > > Nuno Oliveira > > On 09/12/2018 09:22 AM, Nick Griffiths wrote: >> >> Hi list, >> >> I've been looking at paging through features from a WFS server using the >> gt-wfs-ng plugin (v0.19.2) as well as geoserver 2.13.1. I've hit some >> issues, so I guess I'm looking for some kind of "Yeah, we know, patches >> welcome" or "You're doing it wrong" or some other kind of statement >> before I start patching things all over the shop. >> >> I set up a test to page through some features, adding the feature ids to >> both a set and a list, to check whether it was paging through properly >> (a mismatch in collection size would mean the ids aren't unique and >> something is fishy). >> >> The first issue I came across, after skimming through the specs, blog >> posts, and eventually the source, was that there's no support for >> startIndex in the WFS 2.0 strategy and surrounding code. This was >> easily fixed, and seemed to sort things on the client side - I can see >> the startIndex and count going through in the GetFeatures request over >> the wire. >> >> Once that was sorted, I had issues with trying to page through a large >> shapefile (2 million rows), so I imported this in to postgis, as I >> assumed this would be more suited to this kind of operation. This >> seemed seemed to fix things, although I was initially getting a mismatch >> in size between collections, possibly down to the haphazard way I added >> the layer in to geoserver - My initial import didn't add a primary key, >> I added one after publishing the layer. A geoserver restart stopped >> this from happening again, so I've put this down to a possible bug in >> the feature type reloading code. Moving on, but a little but worrying. >> I might try and turn on some logging somewhere to validate the SQL >> that's being generated (or try and get a breakpoint in there). >> >> So if this all sounds plausible, I'll prepare a patch for the startIndex >> support on the WFS client code, and I'd also like to submit some docs on >> 'how to' and touch on some of the issues I came across, to ease the path >> of other weary travellers - I just need to know where to put it! >> >> Cheers, >> Nick >> >> PS Sorry if this is rambling, it's getting late... >> >> >> > -- Nick Griffiths Catalyst IT - Open Source Technologists +64 4 897 7457 | ni...@catalyst.net.nz | www.catalyst.net.nz _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users