OGC   Home |  List Services 

[wfs-dev] what to return when GetFeature returns nothing

Rob Atkinson rob@socialchange.net.au
Fri, 24 Jan 2003 11:05:20 +1100


Looking into this - its quite a tricky issue...

This seems to require a response from the WFS and GML RWG .  I think 
that clarifications are required in both specs.

Rob

Jeff Fitzgerald wrote:

>Hey Guys:
>
>    Here's the scenario. . . You submit a GetFeature request to a WFS using
>a BBox filter. There are no features that are contained within or intersect
>the BBox. What do you return? I have a feeling, from similar discussions,
>that this does not warrant a service exception report. Instead, it should
>probably return an empty GML document. So, I guess my question really is,
>what does an empty response to a GetFeature request look like?
>
A featureCollectiuon with no members, as you suggest.

>
>    Obviously, there would be no featureMembers, since the collection is
>empty. Am I correct in assuming that the boundedBy coordinates would all be
>0?
>
This seems to be left to the GML specification, and that introduces an 
ambiguity as far as I can see: The semantics of a FeatureCollection 
requires a boundedBy element. This does not seem to be explicitly defined:

GML 3.0 :7.4.1.3  The value of the gml:boundedBy property describes an 
envelope that encloses the entire feature instance

GML 3.0: 7.5.1.5 Envelope defines an extent using a pair of positions 
defining opposite corners in arbitrary dimensions.
Note: Envelope is often referred to as a minimum bounding box or 
rectangle. Regardless of dimension, an envelope can be represented 
without ambiguity as two direct positions (coordinate points).

Issues:
A) this does may not specify how "tightly" it encloses the feature 
instance - is the "Note" actually normative? Doesnt look like it.
B) Does the feature instance represent the search area - the semantics 
of the collection - or the result set?
C) What is the envelope of an empty set?


Options:

1)FeatureCollection should record the spatial envelope of the query
 - this better preserves semantics - ie, this is an empty  feature set 
covering this area, but needs thought how to apply to a spatial operator 
other that a bounding box query? Could enforce envelope of any query to 
be calculated by WFS.  Result set might be larger than query of course 
if an overlaps operation is used.
Means that "minimum bounding rectangle" semantics does not work - it 
would need to be consistently applied.
Should we also record the nature of the spatial operator? And property 
value filters?

2) No boundedby in an empty set:
GML spec would need changing

3) bounding box given a default value?
But what value would make sense? Zeros puts a "zoom to result set" into 
an ineresting bit of ocean using a degrees based SRS!
I think this is fraught with danger.





>
>    Thanks in advance.
>
>Fitz
>
><?xml version="1.0" encoding="UTF-8"?>
><featureCollection xmlns:myns="http://www.somewhere.com/myns"
>xmlns:gml="http://www.opengis.net/gml"
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>  <gml:boundedby>
>    <gml:Box gml:srsName="EPSG:32100">
>      <gml:coordinates decimal="." cs="," ts=" ">0,0 0,0</gml:coordinates>
>    </gml:Box>
>  </gml:boundedby>
></featureCollection>
>
>---------------------------------------------------------------------
>Jeff Fitzgerald
>Technical Consultant, CARIS Spatial Fusion
>jeff.fitzgerald@caris.com
>CARIS Spatial Components Division
>(506) 458-8533
>http://www.spatialcomponents.com
>---------------------------------------------------------------------
>
>_______________________________________________
>wfs-dev mailing list
>wfs-dev@opengis.org
>http://mail.opengis.org/mailman/listinfo/wfs-dev
>