<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19120">
</head>
<body>
<div><font size="2" face="Arial"><span class="361554506-12102011">Hi,</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">I managed to make the BBOX filter to work.&nbsp; My original troubles came probably from a combination of two client errors.&nbsp; First one is that it creates a &quot;Bbox&quot; filter which does not exist.&nbsp;It
 is &quot;BBOX&quot; instead.&nbsp; Another client error was to build the filter with polygon geometry even only envelope is accepted. This belief is based on these e</span></font><font size="2" face="Arial"><span class="361554506-12102011">xcerpts from Filter Encoding 1.1
 standard</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font face="Arial"><font size="2"><span class="361554506-12102011">&quot;</span>&nbsp;The &lt;BBOX&gt; 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 &lt;Not&gt;&lt;Disjoint&gt; &#8230; &lt;/Disjoint&gt;&lt;/Not&gt; meaning that the &lt;BBOX&gt; operator should identify all geometries that spatially interact with the box. If the optional &lt;propertyName&gt; element is not specified, the calling service must determine which spatial
 property is the spatial key and apply the BBOX operator accordingly.&nbsp;<span class="361554506-12102011">&quot;</span></font></font></div>
<div><font face="Arial"><font size="2"><span class="361554506-12102011"></span></font></font>&nbsp;</div>
<div><font face="Arial"><font size="2"><span class="361554506-12102011">&lt;xsd:complexType name=&quot;BBOXType&quot;&gt;<br>
&lt;xsd:complexContent&gt;<br>
&lt;xsd:extension base=&quot;ogc:SpatialOpsType&quot;&gt;<br>
&lt;xsd:sequence&gt;<br>
&lt;xsd:element ref=&quot;ogc:PropertyName&quot; minOccurs=&quot;0&quot;/&gt;<br>
&lt;xsd:element ref=&quot;gml:Envelope&quot;/&gt;<br>
&lt;/xsd:sequence&gt;<br>
&lt;/xsd:extension&gt;<br>
&lt;/xsd:complexContent&gt;<br>
&lt;/xsd:complexType&gt;</span></font></font></div>
<div><font face="Arial"><font size="2"><span class="361554506-12102011"></span></font></font>&nbsp;</div>
<div><font face="Arial"><font size="2"><span class="361554506-12102011">An interesting additional point is that the&nbsp;geometry property name is optional&nbsp;with BBOX.</span></font></font></div>
<div><font face="Arial"><font size="2"><span class="361554506-12102011"></span></font></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">But I am still puzzled.&nbsp; Now I have both Intersects and BBOX filter which are returning me results from the &quot;france&quot; layer but those filters seem to require different x-y coordinate order.</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">This Intersects sends features with Easting-Northing order</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">&lt;wfs:GetFeature xmlns:ogc=&quot;<a href="http://www.opengis.net/ogc">http://www.opengis.net/ogc</a>&quot;
<br>
xmlns:gml=&quot;<a href="http://www.opengis.net/gml">http://www.opengis.net/gml</a>&quot; xmlns:wfs=&quot;<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a>&quot;
<br>
service=&quot;WFS&quot; version=&quot;1.1.0&quot; maxFeatures=&quot;1000&quot; outputFormat=&quot;text/xml; subtype=gml/3.1.1&quot;&gt;<br>
&lt;wfs:Query xmlns:tows=&quot;<a href="http://www.tinyows.org/">http://www.tinyows.org/</a>&quot;
<br>
srsName=&quot;urn:ogc:def:crs:EPSG::27582&quot; typeName=&quot;tows:france&quot;&gt;<br>
&lt;wfs:PropertyName&gt;tows:the_geom&lt;/wfs:PropertyName&gt;<br>
&lt;ogc:Filter&gt;&lt;ogc:Intersects&gt;&lt;ogc:PropertyName&gt;tows:the_geom&lt;/ogc:PropertyName&gt;<br>
&lt;gml:Surface srsName='urn:ogc:def:crs:EPSG::27582'&gt;<br>
&lt;gml:patches&gt;<br>
&lt;gml:PolygonPatch&gt;<br>
&lt;gml:exterior&gt;&lt;gml:LinearRing&gt;&lt;gml:posList srsDimension='2' count='5'&gt;500117.5483503982 2150739.771331058 500117.5483503982 2315484.2195676905 658849.4254835041 2315484.2195676905 658849.4254835041 2150739.771331058 500117.5483503982 2150739.771331058&lt;/gml:posList&gt;&lt;/gml:LinearRing&gt;&lt;/gml:exterior&gt;&lt;/gml:PolygonPatch&gt;<br>
&lt;/gml:patches&gt;<br>
&lt;/gml:Surface&gt;<br>
&lt;/ogc:Intersects&gt;&lt;/ogc:Filter&gt;&lt;/wfs:Query&gt;&lt;/wfs:GetFeature&gt;</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">With BBOX I must use Northing-Easting instead</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">&lt;wfs:GetFeature xmlns:ogc=&quot;<a href="http://www.opengis.net/ogc">http://www.opengis.net/ogc</a>&quot;
<br>
xmlns:gml=&quot;<a href="http://www.opengis.net/gml">http://www.opengis.net/gml</a>&quot; xmlns:wfs=&quot;<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a>&quot;
<br>
service=&quot;WFS&quot; version=&quot;1.1.0&quot; maxFeatures=&quot;1000&quot; outputFormat=&quot;text/xml; subtype=gml/3.1.1&quot;&gt;<br>
&lt;wfs:Query xmlns:tows=&quot;<a href="http://www.tinyows.org/">http://www.tinyows.org/</a>&quot;
<br>
srsName=&quot;urn:ogc:def:crs:EPSG::27582&quot; typeName=&quot;tows:france&quot;&gt;<br>
&lt;wfs:PropertyName&gt;tows:the_geom&lt;/wfs:PropertyName&gt;<br>
&lt;ogc:Filter&gt;&lt;ogc:BBOX&gt;&lt;ogc:PropertyName&gt;tows:the_geom&lt;/ogc:PropertyName&gt;<br>
&lt;gml:Envelope srsName='urn:ogc:def:crs:EPSG::27582'&gt;<br>
&lt;gml:lowerCorner&gt;2150739 500117&lt;/gml:lowerCorner&gt;<br>
&lt;gml:upperCorner&gt;2315484 658850&lt;/gml:upperCorner&gt;<br>
&lt;/gml:Envelope&gt;<br>
&lt;/ogc:BBOX&gt;&lt;/ogc:Filter&gt;&lt;/wfs:Query&gt;&lt;/wfs:GetFeature&gt;</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">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.</span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011">Filters can be tested by sending them with POST into
<a href="http://188.64.1.61/cgi-bin/tinyows">http://188.64.1.61/cgi-bin/tinyows</a></span></font></div>
<div><font size="2" face="Arial"><span class="361554506-12102011"></span></font><font size="2" face="Arial"><span class="361554506-12102011"></span></font>&nbsp;</div>
<div><font size="2" face="Arial"><span class="361554506-12102011">-Jukka Rahkonen-</span></font></div>
</body>
</html>