Calulate Distances with Bing ???
-
Friday, July 13, 2012 11:00 AM
Hello,
i am new with Bing and have a Question. I'd like to develop a geographic metro app with bing .
How can i calculate the distance between two points on the bing map?
Ist it possible to check whether a point is inside or outside of polygons?
Thank's a lot for your answer :)
Bye Frederick
All Replies
-
Friday, July 13, 2012 1:33 PMOwner
There are a couple of ways to calculate distances. If you just want the straight line distance you can use the Haversine formula:
http://www.stormconsultancy.co.uk/blog/development/code-snippets/the-haversine-formula-in-c-and-sql/
Alternatively if you want the driving distance you can use the Bing Maps REST services to calculate the route.
As for checking if a point is in a polygon you can do one of two things. The first is to follow the algorithm outlined here: http://msdn.microsoft.com/en-us/library/cc451895.aspx
The second is to use the SQL Spatial libraries in your application.
http://rbrundritt.wordpress.com
- Proposed As Answer by Richard_BrundrittMicrosoft Employee, Owner Friday, July 13, 2012 1:33 PM
- Marked As Answer by Richard_BrundrittMicrosoft Employee, Owner Monday, July 16, 2012 11:25 AM
-
Saturday, July 14, 2012 12:40 PM
Thank's a lot for your help.
I'd like to use the Spatial Library of SQL Server. I found it in the Feature Pack of SQL Server. Is this the correct Library?
I didn't found a documentation or something else to use the library but i know the datatype's from SQL 2008 :)
Do you know a Documentation or anything else to use the Spatial Library assembly ?
Thanks for every answer
Frederick
-
Monday, July 16, 2012 11:27 AMOwner
That's the correct library. Take a look at the documentation found here: http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.types%28SQL.105%29.aspxhttp://rbrundritt.wordpress.com
- Marked As Answer by Richard_BrundrittMicrosoft Employee, Owner Monday, July 16, 2012 11:27 AM

