[gdal-dev] Ogr2ogr, WFS 1.1.0, -spat and gml:Box

Even Rouault even.rouault at mines-paris.org
Mon Jan 2 14:18:42 EST 2012

Le lundi 02 janvier 2012 16:39:17, Jukka Rahkonen a écrit :
> Hi,
> Ogr2ogr WFS driver seems to create this kind of request when I use it with
> -spat option
> http://server.org/wfs?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME
> =lv:type_name&FILTER=%3CFilter%20xmlns=%22http://www.opengis.net/ogc%22%20x
> mlns:lv=%22http://lv.org/%22%20xmlns:gml=%22http://www.opengis.net/gml%22%3
> E%3CBBOX%3E%3CPropertyName%3Elv:the_geom%3C/PropertyName%3E%3Cgml:Box%3E%3C
> gml:coordinates%3E2539023.0000000000000000,6677580.0000000000000000%2025546
> 79.0000000000000000,6689397.0000000000000000%3C/gml:coordinates%3E%3C/gml:B
> ox%3E%3C/BBOX%3E%3C/Filter%3E
> So it is WFS 1.1.0 request with the BBOX filter. But is it OK to give BBOX
> as GML2 gml:Box if the service is WFS version 1.1.0? I have been thinking
> it should be using GML3 and gml:Envelope instead.

I suppose you're right. I didn't recall all the details, so I had a look at 
the code, and here's the answer :

    /* This is a heuristic to detect Deegree 3 servers, such as */
    /* http://deegree3-demo.deegree.org:80/deegree-utah-demo/services */
    /* that are very GML3 strict, and don't like <gml:Box> in a <Filter><BBOX> 
    /* request, but requires instead <gml:Envelope>, but some servers (such as 
MapServer) */
    /* don't like <gml:Envelope> so we are obliged to detect the kind of 
server */

So basically it seems that most servers are tolerant and will accept gml:Box. 
But some servers that should accept gml:Envelope don't. So the default 
behaviour is to use gml:Box, except in cases where we know it won't be 
accepted (but the server mentionned in the comment is no longer online, and I 
cannot find another one that doesn't accept <gml:Box>)

It would perhaps be more reasonable to implement the reversed logic from a 
theoretical point of view, but unless you can point me to a server that 
doesn't like the current logic, I'm quite hesitant to change that :-)

> -Jukka Rahkonen-
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

More information about the gdal-dev mailing list