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-boun...@lists.osgeo.org> Puolesta 
Fran Acuña Parra
Lähetetty: maanantai 27. huhtikuuta 2020 16.59
Vastaanottaja: mapserver-users@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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to