[gdal-dev] WFS 1.1 and axis orientation - wrong coordinates interpretation

Jachym Cepicky jachym.cepicky at gmail.com
Fri Feb 17 04:31:26 EST 2012


Hi,
sorry for delay

I see the point and I managed to get proper output from the WFS using
ogr2ogr

with

 ogr2ogr okresy.shp
"WFS:http://gis.bnhelp.cz/ows/crwfs?seice=wfs&version=1.1.0&request=getfeature&typename=okresy"
--config GML_INVERT_AXIS_ORDER_IF_LAT_LONG YES --config
GML_CONSIDER_EPSG_AS_URN YES


but, I did not find a way, how to pass those two options to MapServer
Mapfile - any hint there?

+axis (which should IMHO solve the problem too) did not help in the
PROJECTION section

Thanks

Jachym

P.S. I know, this should possibly go the mapserver mailing list, just
trying to continue the thread and hope, it will end successfully - thanks

On 9.2.2012 20:22, Even Rouault wrote:
> Le jeudi 09 février 2012 20:00:03, Jachym Cepicky a écrit :
>> Hi,
>>
>> I think, OGR (and therefore MapServer too), is not taking care about
>> axis orientation of incomming data, acting as WFS 1.1 client. Result is
>> flipped data and I do not know, how the software recognizes, that axes
>> order is different (apperently, it does not).
>>
>> We have setuped generic WFS 1.1 server with MapServer (6.0.1). Data are
>> published in WGS84.
>>
>> With very simple request, you get the data and the axis order is Y,X
>> (lat, lon) (imho correct)
>>
>> http://gis.bnhelp.cz/ows/crwfs?service=wfs&version=1.1.0&request=getfeature
>> &typename=okresy
>>
>> Now, when try to get this data with OGR and convert them to e.g. Shapefile
>>
>> ogr2ogr okresy.shp
>> "WFS:http://gis.bnhelp.cz/ows/crwfs?service=wfs&version=1.1.0&request=getfe
>> ature&typename=okresy"
>>
>> Resulting shapefile has inverted coordinates  (wrong)
> 
> Jachym ,
> 
> As always with axis ordering issues, the situation is complex. If not already 
> done, I'd encourage you to first carefully read 
> http://gdal.org/ogr/drv_gml.html , and particularly the CRS section.
> 
> I've looked at your server output and I believe this is more a bug (well, this 
> can be discussed) in MapServer than in OGR. The issue is that in its 
> GetFeature output, MapServer indicates  srsName="EPSG:4326" but reports 
> coordinates in lat, long order.
> 
> The GML driver assumes that SRS expressed in EPSG:XXXX form are in long, lat 
> order (which was the convention used in WFS 1.0 where most servers didn't 
> respect the EPSG advertized axis order). Whereas if they are expressed as 
> urn:ogc:EPSG::XXXX (which is now the popular form for WFS 1.1), they are in 
> the axis order expressed by EPSG, which is lat, long in the case of EPSG 4326. 
> I had created http://trac.osgeo.org/mapserver/ticket/3576 about that some time 
> ago.
> 
> When the GML driver recognizes that the coordinates of a SRS are in lat, long 
> order in the GML, it will flip them by default so that the consuming 
> application see them in the usual long, lat order. This can be overriden with 
> the GML_INVERT_AXIS_ORDER_IF_LAT_LONG config option.
> 
> Best regards,
> 
> Even

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120217/e9d75a9a/signature.bin


More information about the gdal-dev mailing list