View Full Version : Finding minimum distance between two points

08-15-2009, 07:30 PM
Hey guys,
I am using mappoint services in my project and I am pretty sure that mappoint has some function which gives distance between two points.

I have coordinates of two geographical entities and I want to find out distance between them. I am not sure how can I do that, can anybody help me with that?

Mattys Consulting
08-15-2009, 08:28 PM
Here's a trick my friend Ken taught me:

Click on the map to make sure it has the focus
Press Ctrl + E on your keyboard and the cursor turns to crosshairs
Click once on the origin and let the mouse button up
Click once on the destination and hit Esc to terminate the line.
(The line will be showing the distance)

Mike Mattys
Mattys Consulting - Custom Programming (http://www.mattysconsulting.com)

08-15-2009, 08:35 PM
Basically I am not using mappoint service directly but I am accessing its functionality from sql server 2008 by adding it in its library.

So what I need here is a method that pragmatically enables me to find out distance between two points.


Mattys Consulting
08-15-2009, 09:23 PM
Easy enough. Open MapPoint Help and look at the DistanceTo method where you'll find an example.

Mike Mattys
Mattys Consulting - Custom Programming (http://www.mattysconsulting.com)