nearest geographical feature to a point?
Miguel Gonçalves
mgoncalves at DSI.UMINHO.PT
Tue Aug 9 08:33:20 PDT 2005
Hi,
I am building an application using the MapServer.
I have a map with several layers of points, lines and polygons.
When I perform a request to my application, I give it a point in the
form (latitude,longitude) and I want to obtain the maximum geographical
information of the layers for thr the given point.
I am using the WFS interface and the GetFeature request.
My problem is very simple. Supose that I have a point layer cities in my
map and I have the city X in the point (a,b).
If the point that I give in the GetFeature request is (a,b) I will
obtain the geographical information for the city X.
The real problem arises if I pass in the GetFeature request a point that
does not coincides with any location in the map.
Supose that I pass the point (a,b+0.0001). This point is really near the
city X but I will not obtain any information in the WFS request.
It woul be wounderfull if I could have a kind of WFS request that could
give me the nearest city in a certain range of the point.
I know that I can use the bounding box in the WFS GetCapabilities
request to give me the cities near the point but,
bounding box is a rectangle.
I would prefer to have a proximity range.
But even better than having the geographical features inside a given
range I would like to have the nearest feature to a given point.
Does anybody knows how to get the nearest feature to a certain given
point using the MapServer?
Is it possible in WFS?
Thanks and best regards.
Miguel
More information about the MapServer-users
mailing list