Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Wrong order of lon/lat in calculateDistance? #1

Open
herms1 opened this issue Oct 31, 2019 · 1 comment
Open

Wrong order of lon/lat in calculateDistance? #1

herms1 opened this issue Oct 31, 2019 · 1 comment

Comments

@herms1
Copy link

herms1 commented Oct 31, 2019

Could it be that the order of lon/lat is wrong in this function?

Should (pathIndices[0,i], pathIndices[1,i]) insted be (pathIndices[1,i], pathIndices[0,i])?

def calculateDistance(pathIndices):
distance = 0
for i in range(0,(len(pathIndices[0])-1)):
distance += vincenty((pathIndices[0,i], pathIndices[1,i]), (pathIndices[0,i+1], pathIndices[1,i+1])).miles*0.868976
return distance

@Tony22692237
Copy link

I think the order on lon/lat is wrong,in the site-package of geopy,there is a point.py : warnings.warn('Latitude normalization has been prohibited in the newer '
'versions of geopy, because the normalized value happened '
'to be on a different pole, which is probably not what was '
'meant. If you pass coordinates as positional args, '
'please make sure that the order is '
'(latitude, longitude) or (y, x) in Cartesian terms.',
UserWarning, stacklevel=3)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants