This project is read-only.

Distance between location A and B including info about country's border

Mar 11, 2015 at 10:52 AM

I am trying to find a solution (using .NET/WPF) and dotSpatial that can calculate distance between point A and point B, but including information about country's border. I need this information in order to calculate the price of trip, as price per km in one country might be different from price per km in other country.

I want to calculate the number of miles a vehicles travel in each country over a period of time. For trips taken over the period, the user will create routes on the map, and the program should be able to generate some output like: Country A: 100 miles, Country B: 200 miles and Country C: 150 miles etc.

Mar 11, 2015 at 12:18 PM
If you have one polygonlayer with the country borders and one linelayer with the routes you could go and intersect the line of your users route with the underlying polygons. This should result in lines whose length depends on the corresponding country.
Mar 11, 2015 at 2:11 PM
Edited Mar 11, 2015 at 2:12 PM
Thanks jarry,
Is there any built-in functionality available in dotSpatial to solve this problem easily?
Mar 11, 2015 at 2:28 PM
You'd have to write a few lines of code to circle over your line features and intersect them with the polygons. Intersect itsself exists as function.