[TinyOWS-users] BBOX/Intersects filter oddities

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Oct 12 02:57:23 EST 2011


Hi,

I managed to make the BBOX filter to work.  My original troubles came probably from a combination of two client errors.  First one is that it creates a "Bbox" filter which does not exist. It is "BBOX" instead.  Another client error was to build the filter with polygon geometry even only envelope is accepted. This belief is based on these excerpts from Filter Encoding 1.1 standard

" The <BBOX> element is defined as a convenient and more compact way of encoding the very common bounding box constraint based on the gml:Envelope geometry. It is equivalent to the spatial operation <Not><Disjoint> ... </Disjoint></Not> meaning that the <BBOX> operator should identify all geometries that spatially interact with the box. If the optional <propertyName> element is not specified, the calling service must determine which spatial property is the spatial key and apply the BBOX operator accordingly. "

<xsd:complexType name="BBOXType">
<xsd:complexContent>
<xsd:extension base="ogc:SpatialOpsType">
<xsd:sequence>
<xsd:element ref="ogc:PropertyName" minOccurs="0"/>
<xsd:element ref="gml:Envelope"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

An interesting additional point is that the geometry property name is optional with BBOX.

But I am still puzzled.  Now I have both Intersects and BBOX filter which are returning me results from the "france" layer but those filters seem to require different x-y coordinate order.

This Intersects sends features with Easting-Northing order

<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs"
service="WFS" version="1.1.0" maxFeatures="1000" outputFormat="text/xml; subtype=gml/3.1.1">
<wfs:Query xmlns:tows="http://www.tinyows.org/"
srsName="urn:ogc:def:crs:EPSG::27582" typeName="tows:france">
<wfs:PropertyName>tows:the_geom</wfs:PropertyName>
<ogc:Filter><ogc:Intersects><ogc:PropertyName>tows:the_geom</ogc:PropertyName>
<gml:Surface srsName='urn:ogc:def:crs:EPSG::27582'>
<gml:patches>
<gml:PolygonPatch>
<gml:exterior><gml:LinearRing><gml:posList srsDimension='2' count='5'>500117.5483503982 2150739.771331058 500117.5483503982 2315484.2195676905 658849.4254835041 2315484.2195676905 658849.4254835041 2150739.771331058 500117.5483503982 2150739.771331058</gml:posList></gml:LinearRing></gml:exterior></gml:PolygonPatch>
</gml:patches>
</gml:Surface>
</ogc:Intersects></ogc:Filter></wfs:Query></wfs:GetFeature>

With BBOX I must use Northing-Easting instead

<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs"
service="WFS" version="1.1.0" maxFeatures="1000" outputFormat="text/xml; subtype=gml/3.1.1">
<wfs:Query xmlns:tows="http://www.tinyows.org/"
srsName="urn:ogc:def:crs:EPSG::27582" typeName="tows:france">
<wfs:PropertyName>tows:the_geom</wfs:PropertyName>
<ogc:Filter><ogc:BBOX><ogc:PropertyName>tows:the_geom</ogc:PropertyName>
<gml:Envelope srsName='urn:ogc:def:crs:EPSG::27582'>
<gml:lowerCorner>2150739 500117</gml:lowerCorner>
<gml:upperCorner>2315484 658850</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX></ogc:Filter></wfs:Query></wfs:GetFeature>

Obviously there is something wrong with BBOX because EPSG:27582 (which does not exist any more but is renamed to 27572?) is an Easting-Northing system.
Filters can be tested by sending them with POST into http://188.64.1.61/cgi-bin/tinyows

-Jukka Rahkonen-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/tinyows-users/attachments/20111012/66278adf/attachment.htm 


More information about the TinyOWS-users mailing list