On Wed, Jan 11, 2012 at 7:53 AM, Roald de Wit <[email protected]> wrote:

>  Hi list,
>
> It's great to see the WFS 2.0 paging/sorting implemented for WFS 1.0/1.1
> in GeoServer!
>
> I've had a play with it and it works great. I did find a couple of
> problems though:
>
> 1) When *not* specifying the "service=WFS" KVP in the GET request
> (/geoserver/wfs?...), I get the following error:
>
> java.lang.ClassCastException: java.lang.Integer cannot be cast to
> java.math.BigInteger
> java.lang.Integer cannot be cast to java.math.BigInteger
>
> Whether or not "service=WFS" should be included in /geoserver/wfs might be
> a separate discussion. Fact is that the error is confusing.
>

To address this one we'd need to commit a patch that I developed in my
spare time
over one year ago, and that never got applied because of lack of time
(unfortunate destiny
of various things developed without a contract and a deadline, and on
weekends, if they don't get in
rigth away weeks pass by and they get forgotten):

http://osgeo-org.1803224.n2.nabble.com/Happy-Halloween-my-dear-Dispatcher-p-td6151915.html

This patch also had the trouble of being a large modification in a code
path shared by all OGC requests
(so it's a risky one). Also, one year of changes means the patch is likely
not to apply anymore.


>
> 2) I've had trouble getting the sorting/paging to work with XML POST
> requests. It looks like sortBy gets ignored:
>
> <wfs:GetFeature service="WFS" version="1.0.0" maxFeatures="100"
> startIndex="0" sortBy="topp:STATE_NAME" ...
>
> jgarnett on IRC seemed to think that the schema might not have been
> modified when backporting this functionality to WFS 1.x.
> Is this a bug or a feature and should KVP always be used?
> POSTing KVPs works fine btw, so this is a possible workaround.
>

Hum, there are various issues here. The following one pages for me:

<wfs:GetFeature service="WFS" version="1.0.0"
outputFormat="GML2"
startIndex="10" maxFeatures="2"
xmlns:topp="http://www.openplans.org/topp";
xmlns:wfs="http://www.opengis.net/wfs";
xmlns:ogc="http://www.opengis.net/ogc";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd";>
  <wfs:Query typeName="topp:states">
    <wfs:PropertyName>STATE_NAME</wfs:PropertyName>
  </wfs:Query>
</wfs:GetFeature>

That is, startIndex and maxFeatures are definitely taken into account.
SortBy is not an attribute of GetFeature, it's an element, so the right
request should be:


<wfs:GetFeature service="WFS" version="1.0.0"
outputFormat="GML2"
startIndex="10" maxFeatures="2"
xmlns:topp="http://www.openplans.org/topp";
xmlns:wfs="http://www.opengis.net/wfs";
xmlns:ogc="http://www.opengis.net/ogc";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd";>
  <wfs:Query typeName="topp:states">
    <wfs:PropertyName>STATE_NAME</wfs:PropertyName>
    <wfs:SortBy>STATE_NAME</wfs:SortBy>
  </wfs:Query>
</wfs:GetFeature>

But as far as I can see the XML parser ignores sortBy when parsing
WFS 1.0 requests. This could indeed be improved, adding support
for the vendor parameter there too (mind, adding it, as well as the
extra attributes, makes the requests schema invalid, that's why we normally
prefer to handle these extensions at the GET request level, it does not
break the request validity).

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to