[postgis-users] Spatial query for the Nearest location given a lat and long?

bdbeames bdbeames at cc.usu.edu
Mon Aug 13 09:04:31 PDT 2007


Ok I'm completely lost.

I did more research and I ran across some information about the SRID, but
none of this makes sense to me.  I've never looked at a spatial query
before.

Lets say that I lave the lat and long points 41.7833, -111.855.  I now have
a table called table_1 with id, name, lat, long, extra.  This is a very
large data base 1-2 T-Bites.  Weather stations from across the US that are
updated every hour.  I want to find the nearest station to the given lat and
long point. 

Could you be more specific of how to go about this.  

I also found mention of a Distance function, but no documentation of how it
works.  Could I use this to find the top 1-5 nearest stations.  If so, could
someone given me an example of how to write the query.

This is a postgres database NOT MYSQL

Thanks
-- 
View this message in context: http://www.nabble.com/Spatial-query-for-the-Nearest-location-given-a-lat-and-long--tf4253824.html#a12129033
Sent from the PostGIS - User mailing list archive at Nabble.com.




More information about the postgis-users mailing list