[mapserver-users] WFS axis order in Mapserver 7.0

Even Rouault even.rouault at spatialys.com
Sat Oct 31 08:00:14 PDT 2015


Le vendredi 30 octobre 2015 22:28:58, Rahkonen Jukka (MML) a écrit :
> Hi Even,
> 
> OK, now I undestand that this issue is a side effect of my attempt to study
> the Github issue https://github.com/mapserver/mapserver/issues/3126 when I
> added CRS:84 into my mapfile.
> 
> CRS:84 is OK to be used in mapfile because it belongs to WMS 1.3.0 and no
> ordinary user can guess that it might have bad effects to WFS.
> 
> From our documentation http://mapserver.org/ogc/wfs_server.html:
> 
> "The OGC WFS 1.1 and 2.0 specifications allow more than one SRS to be
> advertised, and one of the SRSs will be advertised as the default SRS (the
> default SRS will be the first in the list specified in the METADATA
> wfs_srs / ows_srs)."
> 
> I would say that if I put CRS:84 into firs SRS on the ows_srs list then it
> should be advertised as the defaultSRS in WFS 1.1.0 and 2.0.0
> GetCapabilities (perhaps in suitable WVS versions as well), and all
> requests without srsName should then send data in CRS:84 and use
> longitude-latitude axis order in output geometries and when evaluating
> filters which are used in requests. The CRS:84 example of
> http://geonames.nga.mil/nameswfs/default.htm looks good to me "MBR within
> Filter - request EPSG:4326 response CRS:84 "

You can probably create an issue to track this. The skipping solution would 
probably be the easiest one. I'm not sure to remember what would be involved 
to properly support CRS:84. Probably would require gulping several aspirin 
pills as with all axis ordering issues.

As a workaround, you could have distinct wfs_srs and wms_srs lists.

> 
> Alternatively CRS:84 should just be skipped totally in all places where it
> does not work correctly. Can Proj4 seems to recognize CRS:84 so it might
> be possible to handle it correctly.
> 
> gdalsrsinfo crs:84
> 
> PROJ.4 : '+proj=longlat +datum=WGS84 +no_defs '
> 
> OGC WKT :
> GEOGCS["WGS 84",
>     DATUM["WGS_1984",
>         SPHEROID["WGS 84",6378137,298.257223563,
>             AUTHORITY["EPSG","7030"]],
>         AUTHORITY["EPSG","6326"]],
>     PRIMEM["Greenwich",0,
>         AUTHORITY["EPSG","8901"]],
>     UNIT["degree",0.0174532925199433,
>         AUTHORITY["EPSG","9122"]],
>     AUTHORITY["EPSG","4326"]]
> 
> -Jukka Rahkonen-
> 
> ________________________________________
> Even Rouault wrote:
> 
> Le vendredi 30 octobre 2015 17:10:41, Rahkonen Jukka (MML) a écrit :
> > Hi,
> > 
> > I am testing with the latest MS4W:
> > MapServer version 7.0.0 (MS4W 3.1.0)
> > 
> > I put test data and mapfile to
> > http://latuviitta.org/downloads/MS_axis_test.zip Map file may have some
> > dirt from the original one that I simplified but I did test that it shows
> > the issue for me with request:
> > http://localhost:8060/cgi-bin/mapserv.exe?map=c:/ms4w/apps/axis_test.map&
> > s ervice=WFS&version=2.0.0&request=getfeature&typename=states_shp
> > 
> > Part of the response:
> > <gml:posList srsDimension="2">-88.071564 37.510990 -88.087883 37.476273
> > -88.311707 37.442852
> > 
> > Same lon-lat order comes with WFS 1.1.0 and of course with WFS 1.0.0.
> > 
> > If it works for you then perhaps the issue is in MS4W.
> 
> It didn't work for me either. I had a hard time figuring out what's wrong
> and what's wrong is the  following line:
> 
> "ows_srs" "CRS:84 EPSG:4326 EPSG:32634 EPSG:3857 EPSG:2923"
> 
> and more particularly the CRS:84 at the beginning. It confuses mapserver to
> think the order is lon/lat. If you remove it, everything's fine again. This
> might be a bug, or nut, as I recall there's a quite complex explanation
> somewhere in the doc describing the precedence between MAP projection,
> LAYER projection, ows_srs at MAP level, wfs_srs at LAYER level...
> 
> (I finally found
> https://github.com/mapserver/msautotest/blob/master/wxs/wfs_200_allgeoms.ma
> p which is a test with EPSG:4326 data and requests without explicit srsName
> and the results are correct :
> https://github.com/mapserver/msautotest/blob/master/wxs/expected/wfs_200_al
> lgeoms_getfeature.xml )
> 
> > -Jukka Rahkonen-
> > 
> > Even Rouault wrote:
> > 
> > Le vendredi 30 octobre 2015 16:15:29, Rahkonen Jukka (MML) a écrit :
> > > Hi,
> > > 
> > > I am getting EPSG:4326 data with wrong axis order from Mapserver 7.0
> > > and WFS 1.1.0 and 2.0.0 with my demo data. However, I believe that
> > > there are automatic tests which must be passed before new Mapserver
> > > releases are published. Where could I find data, mapfiles, and tests
> > > so I could compare them with my own tests?
> > 
> > https://github.com/mapserver/msautotest/tree/master/wxs
> > 
> > For example
> > https://github.com/mapserver/msautotest/blob/master/wxs/wfs_200.map
> > has
> > 
> > # srsName
> > # Next 3 requests should be equivalent in result # RUN_PARMS:
> > wfs_200_getfeature_srsname.xml [MAPSERV]
> > QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&
> > T YPENAMES=province&SRSNAME=EPSG:4269" > [RESULT_DEVERSION] # RUN_PARMS:
> > wfs_200_getfeature_urn_srsname.xml [MAPSERV]
> > QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&
> > T YPENAMES=province&SRSNAME=urn:ogc:def:crs:EPSG::4269" >
> > [RESULT_DEVERSION] # RUN_PARMS: wfs_200_post_getfeature_srsname.xml
> > [MAPSERV] [POST]<?xml version="1.0" ?><GetFeature service="WFS"
> > version="2.0.0"
> > xmlns="http://www.opengis.net/wfs/2.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://www.opengis.net/wfs/2.0
> > http://schemas.opengis.net/wfs/2.0/wfs.xsd"><Query srsName="EPSG:4269"
> > typeNames="province"></Query></GetFeature>[/POST] > [RESULT_DEVERSION] #
> > 
> > And if you look at :
> > 
> > https://github.com/mapserver/msautotest/blob/master/wxs/expected/wfs_200_
> > ge tfeature_srsname.xml
> > 
> > the axis order seems ok (somewhere in Canada I believe)
> > 
> > This is with EPSG:4269 but should work similarly for EPSG:4326
> > 
> > > -Jukka Rahkonen-
> > 
> > --
> > Spatialys - Geospatial professional services http://www.spatialys.com
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com



More information about the MapServer-users mailing list