I'm working on a maps based application and at the moment want to do the following. I have two coordinates a start point and an end point and can draw a line between those points on a map. However what I want to do is to be able to get a list of all countries on the map that the line passes through. I was wondering if this can be done using google maps. I've looked at a number of options but can't get around the way to get this done - how do I do this?
-
Line: in the projection Google uses? For long distances, this is not the shortest path between two points on the globe.John Dvorak– John Dvorak2012-12-08 10:22:23 +00:00Commented Dec 8, 2012 at 10:22
-
What is the projection Google uses? This seems to be cylindrical polar while picking the correct stretch based on the viewport but I haven't noticed any uneven scaling.John Dvorak– John Dvorak2012-12-08 10:29:41 +00:00Commented Dec 8, 2012 at 10:29
-
It doesn't have to be google maps - I just want to know how can I set it up so that I can get a list of countries that a line drawn through crosses.Ali– Ali2012-12-08 10:55:18 +00:00Commented Dec 8, 2012 at 10:55
-
Then you have to define the projection AND your data source. If you specify your data source (list of polygons, each of one country) and line (the great circle? The line in a(ny) polar cylindrical projection)? The line between two points does not lie on a sphere.John Dvorak– John Dvorak2012-12-08 10:58:14 +00:00Commented Dec 8, 2012 at 10:58
-
hmmmm ok - any online resources I can checkout for this?Ali– Ali2012-12-08 11:11:10 +00:00Commented Dec 8, 2012 at 11:11
|
Show 1 more comment
1 Answer
you could check at various points of the line for the country it's in with:
pOfLine.AddressDetails.Country.CountryName
1 Comment
yes, check it out here