Hi all,
I'm trying to use GeoServer WFS to query for the closest feature of a
particular type to a point, but can't seem to get it going. There are
two ways I can think of doing it, but one is far from ideal and the
other isn't supported by the OGC specs:
1) Repeated queries with circular overlaps:
I can simply pick an arbitrary distance, build a circle of that radius
around the query point and use "overlaps" or similar (I know bounding
box would be fastest, but not accurate). If no features are returned,
increase the radius and re-query (rinse, repeat) until features are
returned. This is obviously far from ideal.
2) Return one result and "sort by" distance function:
Unfortunately the OGC specs don't allow for this, but it would be nice
to use "maxFeatures='1'" and then use something similar to -
<ogc:SortBy>
<ogc:SortProperty>
<ogc:Function name='distance'>...</ogc:Function>
</ogc:SortProperty>
</ogc:SortBy>
Obviously, this doesn't work but does someone else have a
solution/suggestions for where to go next?
Many thanks,
Mark Lidstone
Tel: +44 (0)23 80232222; Fax: +44 (0)23 80232891
BMT Cordah Ltd
Grove House
7 Ocean Way
Ocean Village
Southampton
SO14 3TJ
BMT Cordah Ltd.
A member of the BMT group of companies
Registered Office: Investment House, 6 Union Row, Aberdeen AB10 1DQ
Registered in Scotland No. 163413
http://www.bmtcordah.com/
http://www.bmt.org/
The contents of this e-mail and any attachments are intended only for the use of the e-mail addressee(s) shown. If you are not that person, or one of those persons, you are not allowed to take any action based upon it or to copy it, forward, distribute or disclose the contents of it and you should please delete it from your system. BMT Cordah Limited does not accept liability for any errors or omissions in the context of this e-mail or its attachments, which arise as a result of Internet transmission, nor accept liability for statements which are those of the author and not clearly made on behalf of BMT Cordah Limited.