[mapserver-users] GetFeature WFS request with Spatial Filter DWITHIN

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Mon Apr 27 14:22:06 PDT 2020


Hi,

The vendor specific filters are listed in the WFS  GetCapabilities. Try https://demo.geo-solutions.it/geoserver/wfs?service=WFS&version=2.0.0&request=GetCapabilities and you will find a lot of filters, including “Nearest”. I do not know the exact syntax to use in WFS filter but perhaps Andrea is lurking this list and can show some light for us.

The function list is per WFS service and that may be problematic with filters like pgnearest and SDO_NN which can work only with PostGIS and Oracle layers, respectively.

-Jukka Rahkonen-

Lähettäjä: Steve Lime <sdlime at gmail.com>
Lähetetty: maanantai 27. huhtikuuta 2020 21.42
Vastaanottaja: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>
Kopio: Fran Acuña Parra <fran.ap89 at gmail.com>; mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] GetFeature WFS request with Spatial Filter DWITHIN

To be clear, Fran - are you saying the issue isn't the result set rather the order? If so I don't know of a way to affect that order.

In terms of a nearest feature or features. This would be something that I would be keen on addressing. I've run into a variant of this issue using the CGI and mode=query when searching multiple layers. The query finds the first matching feature but not necessarily the closest. It's an issue primarily with line and point layers when you need to set TOLERANCE values to make things clickable. Jukka, what does the vendor specific extension in GeoServer look like from WFS filter standpoint?

--Steve

On Mon, Apr 27, 2020 at 10:21 AM Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>> wrote:
Hi,

The DWithin function in WFS is a true/false function just like the equivalent PostGIS function https://postgis.net/docs/ST_DWithin.html. You can’t find the nearest feature with DWithin. A not so good workaround is to increase the distance until the result is not empty.

Mapserver does not have a vendor specific function for nearest either like Geotools/Geoserver. Especially the pgnearest function that works with PostGIS backend and returns n nearest features would be practical for your use case  https://docs.geotools.org/stable/userguide/library/main/function_list.html.  Geotools should also have a similar function for Oracle that is using the native SDO_NN function.

Unfortunately I can’t say how to proceed for making nearest or nearestN queries with Mapserver.

-Jukka Rahkonen-

Lähettäjä: mapserver-users <mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org>> Puolesta Fran Acuña Parra
Lähetetty: maanantai 27. huhtikuuta 2020 16.59
Vastaanottaja: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Aihe: [mapserver-users] GetFeature WFS request with Spatial Filter DWITHIN

Hi,

Following the topic about another question that I sent, I'm using a Getfeature WFS request with a DWITHIN spatial filter to returns the closes feature of a layer given some specific coordinates. The request works fine, but when there are several features that match the filter it doesn't returns the closest one in the first position of the response(GML for example). Is there a way to achieve this?

Thanks in advance.

Regards,

Fran Acuña
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20200427/d08f4da2/attachment-0001.html>


More information about the mapserver-users mailing list