Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 findout location point inside a radius in meter

Author  Topic 

meenu.monu
Starting Member

8 Posts

Posted - 2011-05-25 : 20:53:55
in sql 2005

i have a table named radius and thre fields are long ,lat,radius

long=51,lat=22,radius=2 meter



and another table value is

long1 =45,lat1=25

i want to check long1 and lat1 is inside the radius of 2 meter from long and lat.

how can i found that?

longitude and latitude are actual location points

anybdy help me?

meenu.monu
Starting Member

8 Posts

Posted - 2011-05-28 : 01:49:26
please help me to findout a particluar point which is inside the circle or nt.
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-05-28 : 07:19:08
If you can calculate the distance between the two points, you would know the answer. I know nothing at all about the geographical calculations, but it would seem to me that you would need to know the radii of the ellipsoid to be able to calculate the distance, wouldn't you?

If that is the case, you can calculate it using the Haversine formula. See here: http://www.movable-type.co.uk/scripts/latlong.html
A SQL implementation of this is in this thread: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81360&whichpage=1
Go to Top of Page
   

- Advertisement -