<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="Helvetica, Arial, sans-serif">Ok, I will prepare a test
set. Unfortunately my other layers are not public but Ill see if I
still find one I may overlook as of now. <br>
<br>
Best<br>
<br>
Lars<br>
</font>
<div class="moz-signature">
<meta charset="utf-8">
<title>SkenData Email Signatur</title>
<div>
<br>
</div>
</div>
<div class="moz-cite-prefix">Am 28.05.21 um 12:00 schrieb Rahkonen
Jukka (MML):<br>
</div>
<blockquote type="cite"
cite="mid:ca5c0871c5654f39a556cda3cd58e0f5@maanmittauslaitos.fi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<title>SkenData Email Signatur</title>
<style>@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}span.Shkpostityyli20
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US">Documentation
</span><span style="mso-fareast-language:EN-US"><a
href="https://mapserver.gis.umn.edu/es/ogc/wfs_client.html"
moz-do-not-send="true"><span lang="EN-US">https://mapserver.gis.umn.edu/es/ogc/wfs_client.html</span></a></span><span
style="mso-fareast-language:EN-US">
<span lang="EN-US">does not mention option “wfs_srs”. That
is a WFS server option
<a href="https://www.mapserver.org/ogc/wfs_server.html"
moz-do-not-send="true">https://www.mapserver.org/ogc/wfs_server.html</a>.
It looks like there is no way to control what SRS is used
for accessing the remote server. Perhaps you can’t do what
you want with WFS connection – cascade and reproject. So
perhaps it is best to return to OGR connection. Luckily
the remote service is open so you can share with us a
complete working test case that includes the mapfile and
the xml file that you use in the CONNECTION. You also told
that you have other same kind of layers which work.
Include such layer into the test package as well.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> mapserver-users
<a class="moz-txt-link-rfc2396E" href="mailto:mapserver-users-bounces@lists.osgeo.org"><mapserver-users-bounces@lists.osgeo.org></a>
<b>Puolesta </b>Lars Fricke via mapserver-users<br>
<b>Lähetetty:</b> perjantai 28. toukokuuta 2021 12.17<br>
<b>Vastaanottaja:</b> <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<b>Aihe:</b> Re: [mapserver-users] WFS Client returns data
at random with very same call<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span
style="font-family:"Helvetica",sans-serif">Dear
Daniel and Jukka,<br>
<br>
following your advice I changed my setup as follows:<br>
"""<br>
LAYER<br>
NAME "TestLayer"<br>
CONNECTION "<external-url>?"<br>
EXTENT -47443 5145172 1187852 6158846<br>
CONNECTIONTYPE WFS<br>
STATUS ON<br>
DEBUG 5<br>
METADATA<br>
"wfs_typename" <a href="info:dop"
moz-do-not-send="true">"info:dop"</a><br>
"wfs_request_method" "GET"<br>
"wfs_version" "1.0.0"<br>
"wfs_srs" "EPSG:25832"<br>
"wfs_title" "dop"<br>
"wfs_connectiontimeout" "60"<br>
"wfs_maxfeatures" "500"<br>
"gml_include_items" "all"<br>
"gml_featureid" "ID"<br>
<br>
END # METADATA<br>
PROJECTION<br>
"init=epsg:25832"<br>
END # PROJECTION<br>
TYPE POLYGON<br>
CLASS<br>
NAME "aerial_image_footprint"<br>
STYLE<br>
OUTLINECOLOR 255 0 0<br>
WIDTH 0.7<br>
END # STYLE<br>
END # CLASS<br>
END # LAYER<br>
<br>
"""<br>
What shall I say, it does not work. The strange things I am
noticing are as follows:<br>
1) If I make a call with a bbox in EPSG: 3857 Mapserver
first sends my map-extent as bbox to the external server as
EPSG:3857, not using the layers extent that is in EPSG:25832
as is the source server. However , it does not send the srs
to the external server:
<br>
"""<br>
REQUEST=GetFeature&VERSION=1.0.0&SERVICE=WFS&TYPENAME=<a
href="info:dop&BBOX=-3161903.14172725,2675231.21277502,4977362.15235668,7973075.36166411&MAXFEATURES=500"
moz-do-not-send="true">info:dop&BBOX=-3161903.14172725,2675231.21277502,4977362.15235668,7973075.36166411&MAXFEATURES=500</a><br>
"""<br>
2) Besides the wrong srs, since the map extent is used
instead of the bbox in my request, I obviously would end up
by getting some 500 objects back that may or may not be in
my bbox. I verified this by putting the correct srs into the
CONNECTION (I think this is deprecated).<br>
<br>
Now I also checked the Mapserver Version is 7.4 and I am
basing on this repo: <br>
<a
href="https://github.com/camptocamp/docker-mapserver/tree/7.4"
moz-do-not-send="true">https://github.com/camptocamp/docker-mapserver/tree/7.4</a><br>
Is this Version too outdated (sorry for not mentioning the
version)? I do not have any issues with my other WFS layers
based on OGR connection ( I need WFS beyond 1.0.0)<br>
<br>
Just in case it matters, the external server I am calling is
public so I might as well name it:<br>
<a href="http://sg.geodatenzentrum.de/wfs_info?"
moz-do-not-send="true">"http://sg.geodatenzentrum.de/wfs_info?"</a><br>
The layer is <a href="info:dop" moz-do-not-send="true">"info:dop"</a><br>
<br>
Thanks for all your help.<br>
<br>
Best<br>
Lars</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">Am 27.05.21 um 21:36 schrieb Daniel
Morissette:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Since you use CONNECTIONTYPE OGR, none of
the MapServer WFS Client logic takes place. Is there any
reason why you cannot use CONNECTIONTYPE WFS as documented
here:
<br>
<br>
<a href="https://mapserver.org/ogc/wfs_client.html"
moz-do-not-send="true">https://mapserver.org/ogc/wfs_client.html</a>
<br>
<br>
<br>
<br>
On 2021-05-27 02:51, Lars Fricke wrote: <br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Dear All,
<br>
<br>
as this list is a source of much deeper insight than I
have into Mapserver, I would like to ask about a very
strange issue I am facing.
<br>
<br>
I am calling on a public WFS server I can query "by hand"
fast and successfully every single time. Now I defined a
Mapserver layer (see below) as an OGR layer in my WFS
map-file and it does - on the same call - return data. But
not reliably, more at random. I played with the
connection-timeout and the maxfeatures and it seemed to
have some influence but again, not reliably. I'll post the
relevant parts of my mapfile (all my other layers with
other sources are working fine):
<br>
""" <br>
MAP <br>
NAME "WFS_Test" <br>
SHAPEPATH "/data" <br>
STATUS ON <br>
UNITS METERS <br>
EXTENT -2851663 2776500 5630523 9970363 <br>
<br>
PROJECTION <br>
"init=epsg:3857" <br>
END # PROJECTION <br>
<br>
WEB <br>
FOOTER "TestServer" <br>
IMAGEPATH "/tmp/" <br>
TEMPPATH "/tmp/" <br>
IMAGEURL "/tmp/" <br>
METADATA <br>
"wfs_title" "Test" <br>
"ows_onlineresource" <a
href="http://my_server.de/cgi-bin/mapserv?map=/var/www/html/wfs.map"
moz-do-not-send="true">
"http://my_server.de/cgi-bin/mapserv?map=/var/www/html/wfs.map"</a> <br>
"ows_enable_request" "*" <br>
"ows_srs" "EPSG:3857 EPSG:4326 EPSG:25832" <br>
"wfs_srs" "EPSG:3857 EPSG:4326 EPSG:25832" <br>
"wfs_getfeature_formatlist" "jsonp,ogrgml" <br>
"wfs_encoding" "UTF-8" <br>
"wfs_connectiontimeout" "20" <br>
#"wfs_request_method" "GET" <br>
END # METADATA <br>
VALIDATION <br>
callback ".*" <br>
END <br>
END # WEB <br>
<br>
OUTPUTFORMAT <br>
NAME "jsonp" <br>
DRIVER "OGR/GEOJSON" <br>
MIMETYPE "application/json; subtype=geojson;
charset=utf-8" <br>
FORMATOPTION "STORAGE=stream" <br>
FORMATOPTION "FORM=SIMPLE" <br>
FORMATOPTION "LCO:COORDINATE_PRECISION=10" <br>
FORMATOPTION "JSONP=%callback%" <br>
END <br>
<br>
OUTPUTFORMAT <br>
NAME "OGRGML" <br>
DRIVER "OGR/GML" <br>
FORMATOPTION "STORAGE=filesystem" <br>
FORMATOPTION "FORM=multipart" <br>
FORMATOPTION "FILENAME=result.gml" <br>
END <br>
<br>
SYMBOL <br>
NAME "circle_filled" <br>
TYPE ELLIPSE <br>
FILLED TRUE <br>
POINTS <br>
1 1 <br>
END <br>
END <br>
<br>
LAYER <br>
NAME "TestLayer" <br>
CONNECTION "wfs-request-testlayer.xml" <br>
EXTENT 84710 5210905 1163008 6125425 <br>
CONNECTIONTYPE OGR <br>
STATUS ON <br>
DATA "dop" <br>
METADATA <br>
"wfs_version" "2.0.0" <br>
"wfs_title" "TestLayer_WFS" <br>
"wfs_connectiontimeout" "100" <br>
"wfs_typename" "TestLayer_WFS_int" <br>
"wfs_maxfeatures" "600" <br>
<br>
END # METADATA <br>
PROJECTION <br>
"init=epsg:25832" <br>
END # PROJECTION <br>
TYPE POLYGON <br>
CLASS <br>
NAME "aerial_image_footprint" <br>
STYLE <br>
OUTLINECOLOR 255 0 0 <br>
WIDTH 0.7 <br>
END # STYLE <br>
END # CLASS <br>
END # LAYER <br>
""" <br>
I made the xml-file wit ogrinfo as I did for many other
layers that work. <br>
The call is: <br>
""" <br>
<a
href="http://localhost:8181/cgi-bin/mapserv?map=/var/www/html/wfs.map&"
moz-do-not-send="true">http://localhost:8181/cgi-bin/mapserv?map=/var/www/html/wfs.map&</a>
<br>
SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&SRSNAME=EPSG:3857&BBOX=1292610.86313433,6822730.62911591,1293128.57472490,6823169.70765144&TYPENAME=TestLayer
<br>
""" <br>
If I replace the Server name with the public server, it
works like a breeze (even it is 3857).
<br>
The public server has: <br>
""" <br>
<DefaultCRS>urn:ogc:def:crs:EPSG:6.9:25832</DefaultCRS> <br>
<OtherSRS>urn:ogc:def:crs:EPSG:6.9:4326</OtherSRS> <br>
""" <br>
<br>
I see the following response in the browser: <br>
""" <br>
<wfs:FeatureCollectionxmlns:ms=<a
href="http://mapserver.gis.umn.edu/mapserver"
moz-do-not-send="true">"http://mapserver.gis.umn.edu/mapserver"</a>xmlns:gml=<a
href="http://www.opengis.net/gml/3.2"
moz-do-not-send="true">"http://www.opengis.net/gml/3.2"</a>xmlns:wfs=<a
href="http://www.opengis.net/wfs/2.0"
moz-do-not-send="true">"http://www.opengis.net/wfs/2.0"</a>xmlns:xsi=<a
href="http://www.w3.org/2001/XMLSchema-instance"
moz-do-not-send="true">"http://www.w3.org/2001/XMLSchema-instance"</a>xsi:schemaLocation=<a
href="http://mapserver.gis.umn.edu/mapserverhttp:/wfs/cgi-bin/mapserv?map=/var/www/html/wfs.map&SERVICE=WFS&VERSION=2.0.0&REQUEST=DescribeFeatureType&TYPENAME=DOP_AGE_DE&OUTPUTFORMAT=application%2Fgml%2Bxml%3B%20version%3D3.2http://www.opengis.net/wfs/2.0http://schemas.opengis.net/wfs/2.0/wfs.xsdhttp://www.opengis.net/gml/3.2http://schemas.opengis.net/gml/3.2.1/gml.xsd"
moz-do-not-send="true">"http://mapserver.gis.umn.edu/mapserver
http://wfs/cgi-bin/mapserv?map=/var/www/html/wfs.map&SERVICE=WFS&VERSION=2.0.0&REQUEST=DescribeFeatureType&TYPENAME=DOP_AGE_DE&OUTPUTFORMAT=application%2Fgml%2Bxml%3B%20version%3D3.2
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0/wfs.xsd
http://www.opengis.net/gml/3.2
http://schemas.opengis.net/gml/3.2.1/gml.xsd"</a>timeStamp="2021-05-27T06:30:38"numberMatched="0"numberReturned="0"></wfs:FeatureCollection><br>
""" <br>
And in the log: <br>
""" <br>
[warn] [pid 26] mod_fcgid: stderr: msQueryByRect(): Search
returned no results. No matching record(s) found.
<br>
[warn] [pid 26] mod_fcgid: stderr: freeLayer(): freeing
layer at 0x131f120. <br>
3169463 - 172.17.0.1 - - [27/May/2021:06:30:35 +0000] "GET
/cgi-bin/mapserv?map=/var/www/html/wfs.map&SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&SRSNAME=EPSG:3857&BBOX=1292610.86313433,6822730.62911591,1293128.57472490,6823169.70765144&TYPENAME=TestLayer
HTTP/1.1" 200 793 "-" "Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/90.0.4430.212 Safari/537.36"
<br>
330 - 172.17.0.1 - - [27/May/2021:06:30:38 +0000] "GET
/favicon.ico HTTP/1.1" 200 414
<a
href="http://localhost:8181/cgi-bin/mapserv?map=/var/www/html/wfs.map&SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&SRSNAME=EPSG:3857&BBOX=1292610.86313433,6822730.62911591,1293128.57472490,6823169.70765144&TYPENAME=TestLayer"
moz-do-not-send="true">
"http://localhost:8181/cgi-bin/mapserv?map=/var/www/html/wfs.map&SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&SRSNAME=EPSG:3857&BBOX=1292610.86313433,6822730.62911591,1293128.57472490,6823169.70765144&TYPENAME=TestLayer"</a>
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" <br>
""" <br>
I will be grateful for any clue on what is going on. Thank
you for your trouble! <br>
<br>
Best <br>
<br>
Lars <br>
SkenData Email Signatur <br>
<br>
_______________________________________________ <br>
mapserver-users mailing list <br>
<a href="mailto:mapserver-users@lists.osgeo.org"
moz-do-not-send="true">mapserver-users@lists.osgeo.org</a>
<br>
<a
href="https://lists.osgeo.org/mailman/listinfo/mapserver-users"
moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
<br>
</body>
</html>