Hi,
I'm working on http://jira.codehaus.org/browse/GEOS-6187 and as part
of it I've noticed that we are sometimes returning -1 as numberMatched.

Now, this is happening in situations in which we legitimately know the
actual numberMatched,
so it's a bug on its own, but, generally speaking, we might be in a
situation where we don't
know numberMatched at all:
* we are using app-schema, that cannot do counts
* we are using a complex filter in which part of the filter cannot be
encoded in SQL (e.g., using
  filter functions), or we are working against a shapefile and we have an
attribute filter, in both
  cases featureSource.getCount(...) will return -1 to state "sorry, too
hard to compute"

However the spec defines the numberMatched type as follows:

<xsd:simpleType name="nonNegativeIntegerOrUnknown">
<xsd:union>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="unknown"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="xsd:nonNegativeInteger"/>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>

So, in this case, we should be generating "unknown" as the output, not -1.
As far as I can see the WFS 2.0 FeatureCollectionTypeImpl takes this into
account and
defines numberMatched to be "Object", but in
gs-wfs FeatureCollectionResponse
has:

    public abstract BigInteger getTotalNumberOfFeatures();
    public abstract void setTotalNumberOfFeatures(BigInteger n);

Now, I see a couple ways to amend this:
* change totalNumberOfFeatures to be Object too, and set it to "unknown" in
case
  we have a -1
* change the feature collection binding to make an exception for
numberMatched,
  and if it's null or a negative number, return "unknown" instead

Do you have a preference?

Cheers
Andrea


-- 
== Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to