开发者

MapPoint 2010-Distance between a common object such as a river and assigned pushpins

开发者 https://www.devze.com 2023-03-09 07:56 出处:网络
Is there a way to find the distance from a commo开发者_JAVA技巧n area like a river or state border and push pins I have set up?I am trying to narrow all the pushpins within 1/4 of a mile of a border,

Is there a way to find the distance from a commo开发者_JAVA技巧n area like a river or state border and push pins I have set up? I am trying to narrow all the pushpins within 1/4 of a mile of a border, but drawing the radius circles aren't really helpful. Is there a way to do this?


I don't know MapPoint 2010, but in general, GIS tackles this in at least two ways:

  1. Distance function between polyline (e.g. border, river) and point: this finds the closest line segment to the point and returns a distance to it (your question precisely). If you are unlucky, you only get the distance from the polyline's centroid, which doesn't help.

  2. Build up a buffer polygon around the polyline and test if the point falls inside it.

In MapPoint terms, it sounds like you need to select the border, and "find nearby places" with the option "around a route" (available if you have selected certain objects.)


No, MapPoint does not expose rivers, boundaries, and roads as objects in the API. What you can do is find straight line (Great Circle) distances between pushpins, shapes, routes, route segments, and Location objects.

So if you have a polyline shape (open "freeform" shape), then you can measure the distance from this to a pushpin. After doing this you could calculate your own buffer polygon in memory, do a simple comparison for a buffer comparison.

EDIT: The DistanceTo method can be used for pushpins, Locations, and route segments. For shapes, you will need to work with the vertices directly. With 2010 (2006 and later), the Longitude, Latitude properties are guaranteed to be set, so you can go some geometric calculations directly with these.

0

精彩评论

暂无评论...
验证码 换一张
取 消