tsql - Great Circle Distance Formula: T-SQL -


so have table bunch of different addresses in it. need proc select addresses in table within specified distance in miles passed in lat/long values.

so example of table:

- messageid - lat (float) - long (float) 

proc passing in lat/long pair (both floats well) int (miles)

i found http://www.sqlteam.com/forums/topic.asp?topic_id=81360 calculate actual formula can't figure out modify in proc form able go through entire list of addresses , give me id's of addresses <= miles (that pass in), lat/long pass in.

can here?

thanks!

sql server 2008

using spacial function stdistance return distance in meters

geography::point(@lat1, @lon1, 4326).stdistance(geography::point(@lat2, @lon2, 4326))


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -