[mapserver-users] WFS error request

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Jan 21 04:05:35 PST 2021


Hello Team Carine !

Thanks for this message, great to see that students are loving 
MapServer/GeoMoose/MS4W, you have put a smile on my face this morning 
here ha.

I've taken a look at your mapfile, but I notice that your MAP object is 
missing some important parameters such as EXTENT, UNITS, and the source 
PROJECTION block.  See an example WFS-server mapfile at: 
https://mapserver.org/ogc/wfs_server.html#example-wfs-server-mapfile

Notice that the MAP-level requires a PROJECTION block (this is the 
output projection) and then each LAYER requires its own PROJECTION block 
(this is the source projection of each layer).

It's also important to start first by reviewing what is returned by your 
GetCapabilities request, and removing any "WARNING" messages displayed 
there (example GetCapabilities request: 
https://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities 
)

I'm not sure why everything else worked for you though, but, I'd still 
verify that your mapfile is properly setup for projections (review the 
'important notes' in the projections document at 
https://mapserver.org/mapfile/projection.html#important-notes )

Thank-you for using and sharing the passion for MapServer ! :)

-jeff



-- 
Jeff McKenna
GatewayGeo: MapServer Consulting and Training Services
co-founder of FOSS4G
http://gatewaygeo.com/


On 2021-01-21 6:59 a.m., Robin Rullo wrote:
> Hello, we are a french group of students working on a web cartography 
> project based on Geomoose 3.6.1.
> We are trying to formulate a query to retrieve WFS data using mapserver 
> 7.7.0-dev (from ms4w)
> The following query should return results but returns:
> 
>     <gml:boundedBy>
>              <gml:null>missing</gml:null>
>     </gml:boundedBy>
> 
> And in error_log.txt, we have the first error:
> 
>     msProjectRect(): Projection library error. All points failed to
>     reproject.\r: C:/ms4w/Apache/cgi-bin/mapserv.exe
> 
> Which generate bad converted datas:
> 
>     msProjectRect(): Warning: degenerate rect
>     {0.000000,0.000000,0.000000,0.000000}\r:
>     C:/ms4w/Apache/cgi-bin/mapserv.exe
> 
> This is the query:
> METHOD: POST
> URL: 
> http://localhost:4000/mapserver?MAP=C:/ms4w/apps/gm3/htdocs/desktop/MAPFILE_/N_COMMUNE_BDC_068.map&typename=ms:N_COMMUNE_BDC_068
> BODY:
> <GetFeature xmlns="http://www.opengis.net/wfs 
> <http://www.opengis.net/wfs>" service="WFS" version="1.1.0" 
> outputFormat="text/xml; subtype=gml/2.1.2" 
> xsi:schemaLocation="http://www.opengis.net/wfs 
> <http://www.opengis.net/wfs>http://schemas.opengis.net/wfs/1.1.0/wfs.xsd 
> <http://schemas.opengis.net/wfs/1.1.0/wfs.xsd>" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> <http://www.w3.org/2001/XMLSchema-instance>">
> <Query typeName="ms:N_COMMUNE_BDC_068" srsName="EPSG:4326">
> <Filter xmlns="http://www.opengis.net/ogc <http://www.opengis.net/ogc>">
> <Intersects>
> <PropertyName>geom</PropertyName>
> <Polygon xmlns="http://www.opengis.net/gml <http://www.opengis.net/gml>">
> <exterior>
> <LinearRing>
> <posList srsDimension="2">7.056981128517495 47.90393604783284 
> 7.499180835548746 47.90393604783284 7.499180835548746 48.15190704833762 
> 7.056981128517495 48.15190704833762 7.056981128517495 
> 47.90393604783284</posList>
> </LinearRing>
> </exterior>
> </Polygon>
> </Intersects>
> </Filter>
> </Query>
> </GetFeature>
> 
> We have tryed BBOX insthead of Intersects and the request worked well 
> and sent us the expected results.
> URL: 
> http://localhost:4000/mapserver?MAP=C:/ms4w/apps/gm3/htdocs/desktop/MAPFILE_/N_COMMUNE_BDC_068.map&typename=ms:N_COMMUNE_BDC_068 
> 
> BODY :
> <GetFeature xmlns="http://www.opengis.net/wfs 
> <http://www.opengis.net/wfs>" service="WFS" version="1.1.0" 
> outputFormat="text/xml; subtype=gml/2.1.2" 
> xsi:schemaLocation="http://www.opengis.net/wfs 
> <http://www.opengis.net/wfs>http://schemas.opengis.net/wfs/1.1.0/wfs.xsd 
> <http://schemas.opengis.net/wfs/1.1.0/wfs.xsd>" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> <http://www.w3.org/2001/XMLSchema-instance>">
> <Query typeName="ms:N_COMMUNE_BDC_068" srsName="EPSG:4326">
> <Filter>
> <BBOX>
> <Box srsName="EPSG:4326">
> <coordinates>47.420223,6.841024 48.311212,7.622170</coordinates>
> </Box>
> </BBOX>
> </Filter>
> </Query>
> </GetFeature>
> 
> Here is our Mapfile
> MAP
>      SHAPEPATH "C:\geobase"
> 
>     WEB
>        METADATA
>           'ows_title' 'N_COMMUNE_BDC_068'
>              'ows_enable_request'  '*'
>              'ows_srs' 'EPSG:26915 EPSG:4326 EPSG:3857 EPSG:900913'
>              'wfs_srs' 'EPSG:26915 EPSG:4326 EPSG:3857 EPSG:900913'
>              'wms_feature_info_mime_type' 'application/json'
>        END
>     END
> 
>     LAYER
>        NAME 'N_COMMUNE_BDC_068'
> 
>        STATUS ON
> 
>        PROJECTION
>              'init=epsg:2154'
>          END
> 
>        METADATA
>           'ows_title' 'N_COMMUNE_BDC_068'
>           'ows_include_items' 'all'
>           'gml_include_items' 'all'
>        END
> 
>        TYPE LINE
> 
>        DATA 'REF_EXT\BDCARTO\ADMINISTRATIF\N_COMMUNE_BDC_068.shp'
> 
>        CLASS
>           NAME 'communes du Haut-Rhin BDC'
>           STYLE
>              WIDTH 1
>              COLOR '#1f4961'
>           END
>        END
> 
>        TEMPLATE 'dummy'
>     END
> END
> 
> Can you help us understand why we have an error in our first request ?
> Thank you! Team Carine of UHA 4.0
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 



More information about the mapserver-users mailing list