Closest Feature Query

Abe Gillespie abe.gillespie at GMAIL.COM
Wed Jul 13 12:42:20 EDT 2005


Are you sure this can be done?  I'm not finding this specific type of
query in the docs.  There is queryByPoint - which seems to be the
*closest* to what I'm looking for - but this is a classic buffer
query.  I'm looking for sorta the reverse of a buffer query.

Buffer - Start point known / distance known -> returns all features
w/i the distance from the start point.
Closest Feature - Start point known / distance unknown -> returns one
feature that's closer than all the other features to the start point.

-Abe

On 7/13/05, Abe Gillespie <abe.gillespie at gmail.com> wrote:
> Yes, "as the crow flies" is fine; no routing needed.  How is this done
> in PHP MapScript?
> 
> Thanks.
> -Abe
> 
> On 7/13/05, Steve Lime <steve.lime at dnr.state.mn.us> wrote:
> > The normal MapServer query will do this but only using "as the crow flies" distances. You use the layer tolerance to set a maximum distance. If you need to need to compute distances along an established route then that's a different story and is not something MapServer can do out of the box.
> >
> > Steve
> >
> > >>> Abe Gillespie <abe.gillespie at GMAIL.COM> 07/12/05 10:05 PM >>>
> > Is there an easy way to query for the closest feature to another
> > feature.  Take for example the classic "closest ATM" query.  I know
> > where I'm at (an address point or building feature) and want the
> > closest ATM.  Can I avoid having to create a line to each ATM point
> > from the starting point, comparing the length of each line, and
> > keeping the shortest?
> >
> > Thanks.
> > -Abe
> >
>



More information about the mapserver-users mailing list