none
How to get distance from polygon RRS feed

  • Question

  • HI,

    can I to get distance from polygon to point (location)?

    I'm interesting to distance on street and not a spatial distance.

    Thanks
    Saturday, June 25, 2016 7:49 AM

Answers

  • It is possible to do this with a bit of work. The first thing you need to do is choose a point on your polygon to route to. You can easily calculate the distance from your location to each coordinate that makes up the polygon and calculate a route to that location.

    If you also want to allow routing to edges of the polygon, this can be done but requires more work. The Bing Maps V8 control has a spatial math library that has an update coming that makes it easy to calculate the closest location on a polygon's edge.

    If you want to calculate the absolutely shortest route to a polygon, which means the route may not end up at the closest point on the polygon, as the above calculations where doing, then this would require a ton of development to achieve.


    [Blog] [twitter] [LinkedIn]

    Monday, June 27, 2016 9:55 PM