[mapserver-users] WFS Client returns data at random with very same call

Even Rouault even.rouault at spatialys.com
Tue Jun 8 03:34:44 PDT 2021


Lars,

I was testing using master versions of GDAL and Mapserver, but this 
should also applied to not-too-ancient released versions.

When using the OGR WFS driver, you'll never see a perfect forwarding of 
the BBOX from the client request to the backend WFS. It will be 
reprojected to an extent in the SRS that is seen by OGR.

Even

Le 08/06/2021 à 11:39, Lars Fricke a écrit :
> Dear Even, dear all,
>
> After being away from this for some days unfortunately I looked again 
> today and it seems my problem burns down to that I can not get 
> Mapserver to forward the BBOX making the call from my browser. I did 
> include Even's fix in the <URL> element in wfs-request-dop-bkg-age but 
> with no luck. @Even: What version are you using to get the results 
> you're getting with BBOX?
>
> I did notice that there is no
> <ows:Parametername="Sections">
> SkenData Email Signatur
>
> with
> <ows:Value>Filter_Capabilities</ows:Value>
>
> that I see in another .xml file for another server. I tried to 
> manually add that but with no success either so most likely it's not 
> the issue.
>
> Thank you so much for your support.
>
> Best
>
> Lars
>
> Am 28.05.21 um 14:32 schrieb Even Rouault:
>>
>> Lars,
>>
>> I believe the service you request doesn't implement WFS 1.1 properly.
>>
>> Trying this
>>
>> ./mapserv 
>> QUERY_STRING="map=wfs.map&SRSNAME=EPSG:3857&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&BBOX=791880.72463009,6321925.37255709,792929.63787777,6322786.10157277&TYPENAME=TestLayer" 
>>
>>
>> I see that GDAL does:
>>
>> VSICURL: Start download for 
>> http://sg.geodatenzentrum.de/wfs_info?SERVICE=WFS&VERSION=1.1.0&MAXFEATURES=500&REQUEST=GetFeature&TYPENAME=info:dop&FILTER=%3CFilter%20xmlns%3D%22http:%2F%2Fwww.opengis.net%2Fogc%22%20xmlns:gml%3D%22http:%2F%2Fwww.opengis.net%2Fgml%22%3E%3CBBOX%3E%3CPropertyName%3Egeom%3C%2FPropertyName%3E%3Cgml:Box%3E%3Cgml:coordinates%3E362792.2015953020309098,5459899.7109905285760760%20363491.4383923375280574,5460477.4964771848171949%3C%2Fgml:coordinates%3E%3C%2Fgml:Box%3E%3C%2FBBOX%3E%3C%2FFilter%3E
>>
>> So Mapserver has transmitted to GDAL a BBOX filter in epsg:25832 
>> (which is the native SRS of the layer) that is the reprojection of 
>> your source BBOX from EPSG:3857. All things are good up to that point.
>>
>> But the server returns an empty response.
>>
>> Tweaking it manually to include a srsName="EPSG:25832" attribute in 
>> gml:Box returns a response with 2 features
>>
>> http://sg.geodatenzentrum.de/wfs_info?SERVICE=WFS&VERSION=1.1.0&MAXFEATURES=500&REQUEST=GetFeature&TYPENAME=info:dop&FILTER=%3CFilter%20xmlns%3D%22http:%2F%2Fwww.opengis.net%2Fogc%22%20xmlns:gml%3D%22http:%2F%2Fwww.opengis.net%2Fgml%22%3E%3CBBOX%3E%3CPropertyName%3Egeom%3C%2FPropertyName%3E%3Cgml:Box%20srsName=%22EPSG:25832%22%3E%3Cgml:coordinates%3E362792.2015953020309098,5459899.7109905285760760%20363491.4383923375280574,5460477.4964771848171949%3C%2Fgml:coordinates%3E%3C%2Fgml:Box%3E%3C%2FBBOX%3E%3C%2FFilter%3E
>>
>> But we shouldn't have to do this has a missing srsName should be 
>> interpretated as the defaultSRS according to my understand of the WFS 
>> 1.1 spec
>>
>> You can however tweak the <URL> element in wfs-request-dop-bkg-age 
>> and add "&SRSNAME=EPSG:25832" to it (since it is the defaultSRS 
>> of all the layers of the service), and then GDAL will forward it.
>>
>> Even
>>
>>
>> Le 28/05/2021 à 14:11, Lars Fricke a écrit :
>>> No problem. Unfortunately, testing native WFS did not work because 
>>> it does not properly support cascading wfs with different srs (see 
>>> my other post).
>>>
>>> Thanks for looking into this.
>>> SkenData Email Signatur
>>>
>>> Am 28.05.21 um 13:55 schrieb Even Rouault:
>>>>
>>>> oops, sorry, didn't notice 😅
>>>>
>>>> Le 28/05/2021 à 13:52, Lars Fricke a écrit :
>>>>> I put in the files as attach. Is that filtered?
>>>>> SkenData Email Signatur
>>>>>
>>>>> Am 28.05.21 um 13:43 schrieb Even Rouault:
>>>>>>
>>>>>> Please include your mapfile and the wfs-request-testlayer.xml 
>>>>>> file to reproduce. I'm confused by the mapfile you posted 
>>>>>> yesterday that uses epsg:25832 and the fact that GDAL through 
>>>>>> mapserver would issue a GetFeature in EPSG:3857 as suggested 
>>>>>> below. I can't see how that could happen (given the 
>>>>>> MapServer/GDAL integration, GDAL should always request in the 
>>>>>> native SRS of the layer and MapServer will do the reprojection to 
>>>>>> the SRSNAME of the WFS request)
>>>>>>
>>>>>> But as Daniel suggested using the CONNECTION WFS is probably a 
>>>>>> better way of doing what you want
>>>>>>
>>>>>> Le 28/05/2021 à 13:13, Lars Fricke via mapserver-users a écrit :
>>>>>>> So here is the working not working setup. Unfortunately the 
>>>>>>> working OGR WFS client layers are all private so I can not share 
>>>>>>> them.
>>>>>>>
>>>>>>> This call delivers objects as expected:
>>>>>>> http://localhost:8181/cgi-bin/mapserv?map=/var/www/html/wfs.map&SRSNAME=EPSG:3857&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&Maxfeatures=10&TYPENAME=TestLayer
>>>>>>> This one, too:
>>>>>>> http://localhost:8181/cgi-bin/mapserv?map=/var/www/html/wfs.map&SRSNAME=EPSG:3857&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&Maxfeatures=10&TYPENAME=TestLayer
>>>>>>>
>>>>>>> Data is delivered in the correct srs (verified manually with QGIS).
>>>>>>>
>>>>>>> This call doesn't work as described before as BBOX is not 
>>>>>>> transmitted to external server:
>>>>>>> http://localhost:8181/cgi-bin/mapserv?map=/var/www/html/wfs.map&SRSNAME=EPSG:3857&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&BBOX=791880.72463009,6321925.37255709,792929.63787777,6322786.10157277&TYPENAME=TestLayer
>>>>>>>
>>>>>>> While the same direct call works:
>>>>>>> http://sg.geodatenzentrum.de/wfs_info?SRSNAME=EPSG:3857&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&BBOX=791880.72463009,6321925.37255709,792929.63787777,6322786.10157277&TYPENAME=info:dop
>>>>>>> (funny, epsg 3857 is not in the capabilities but works anyhow)
>>>>>>>
>>>>>>> I hope you can find out what is going wrong. Thanks so much for 
>>>>>>> looking into this!
>>>>>>>
>>>>>>> Best
>>>>>>>
>>>>>>> Lars
>>>>>>> SkenData Email Signatur
>>>>>>>
>>>>>>>
>>>>>>> Am 27.05.21 um 18:28 schrieb Rahkonen Jukka (MML):
>>>>>>>> SkenData Email Signatur
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Have you already tried to use WFS connection instead of OGR 
>>>>>>>> connection?
>>>>>>>>
>>>>>>>> -Jukka Rahkonen-
>>>>>>>>
>>>>>>>> *Lähettäjä:* mapserver-users 
>>>>>>>> <mapserver-users-bounces at lists.osgeo.org> *Puolesta *Lars Fricke
>>>>>>>> *Lähetetty:* torstai 27. toukokuuta 2021 14.59
>>>>>>>> *Vastaanottaja:* mapserver-users at lists.osgeo.org
>>>>>>>> *Aihe:* Re: [mapserver-users] WFS Client returns data at random 
>>>>>>>> with very same call
>>>>>>>>
>>>>>>>> Dear all,
>>>>>>>> I apologize for finding and posting bits and pieces not all at 
>>>>>>>> one time.
>>>>>>>> I fired up 'CONFIG "CPL_DEBUG" "ON"' and there I see, that
>>>>>>>> """
>>>>>>>>
>>>>>>>> HTTP: 
>>>>>>>> Fetch(http://url-to-external-server?SERVICE=WFS&VERSION=1.1.0&MAXFEATURES=1000&REQUEST=GetFeature&TYPENAME=dop 
>>>>>>>> <http://url-to-external-server?SERVICE=WFS&VERSION=1.1.0&MAXFEATURES=1000&REQUEST=GetFeature&TYPENAME=dop>)
>>>>>>>> """
>>>>>>>> So there is no BBOX. On other layers I see
>>>>>>>> """
>>>>>>>> GDALOpen(/vsicurl_streaming/https:...
>>>>>>>> """
>>>>>>>> with BBOX.
>>>>>>>> No wonder I do not get reliable results if the server is 
>>>>>>>> calling some 1000 whatsoever result objects and starts 
>>>>>>>> filtering the bbox after.
>>>>>>>>
>>>>>>>> Any idea what is happening? Or is this something for a GDAL thread?
>>>>>>>>
>>>>>>>> Best
>>>>>>>> Lars
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> mapserver-users mailing list
>>>>>>> mapserver-users at lists.osgeo.org
>>>>>>> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>>> -- 
>>>>>> http://www.spatialys.com
>>>>>> My software is free, but my time generally not.
>>>>>
>>>> -- 
>>>> http://www.spatialys.com
>>>> My software is free, but my time generally not.
>>>
>> -- 
>> http://www.spatialys.com
>> My software is free, but my time generally not.
>
-- 
http://www.spatialys.com
My software is free, but my time generally not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210608/38489b9e/attachment-0001.html>


More information about the mapserver-users mailing list