[pgrouting-users] question : Nearest POI name or Area Name

Stephen Woodbridge woodbri at swoodbridge.com
Sat Feb 18 00:20:43 EST 2012


On 2/17/2012 11:33 PM, bino oetomo wrote:
> Dear All
>
> Lets say I have a lat/lon value of a node, and In my postgis table there
> also data of :
> 1. Point of interest
> 2. Area polygon with name. (i.e : a district border)
>
> Kindly please tell me how to :
> 1. Find nearest POI name (may be in thight boundbox, or a defined radius
> with the node as center), or

select * from pois where st_dwithin(point, poi_geom, <max_dist>) order 
by distance(point, poi_geom) asc limit 1;

> 2. Find the polygon name where this node is located.

select * from polygons where st_dwithin(point, poly_geom, 0.0);

> Sincerely
> -bino-

These are probably questions that are better to ask on the postGIS list.

Read about it here:

http://www.postgis.org/documentation/manual-1.5/reference.html

-Steve


More information about the Pgrouting-users mailing list