Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have to calculate the length of the shortest path between A (lat1, long1) and B (lat2, long2). But all the solutions I've found do not get a correct result because they only calculate the distance between the nearest vertex of A to the nearest vertex of B.

share|improve this question
2  
How should your solution behave instead of routing from the nearest vertex? What would be the "correct" result for you? –  underdark Jan 24 '13 at 16:18
    
The correct result should also consider the distance between point A and its nearest vertex as well as the distance between point B and its nearest vertex. –  Robert Jan 25 '13 at 15:05
    
That will not change the resulting route though. It will only change the total length of the route. –  underdark Jan 25 '13 at 15:26
    
Sorry perhaps I expressed myself badly. I am interested in having a total length of the route correct! –  Robert Jan 26 '13 at 10:31
    
closest point on vertex + endpoint/startpoint, use those to create inestring, measure and add total length –  simplexio Jan 26 '13 at 12:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.