Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

GeoPy throws error when processing when GPS Altitude changes #38

Closed
felippehsk opened this issue Jun 23, 2021 · 4 comments · Fixed by #40
Closed

GeoPy throws error when processing when GPS Altitude changes #38

felippehsk opened this issue Jun 23, 2021 · 4 comments · Fixed by #40

Comments

@felippehsk
Copy link
Contributor

@iannesbitt , first of all, thank you for the effort on putting this library together. It is a very handy tool!

However, I encountered an issue trying to use it. I am currently trying to use the main function readgssi.readgssi to open a dataset that contains DZT and DZG files. The DZG files contain the information from the GPS including altitude. Therefore, when the main function calls the function readdzg, GeoPy throws the following error: "ValueError: Calculating distance between points with different altitudes is not supported". This seems to be documented under GeoPy - Calculate Distance
When I open the data without the GPS the function works perfectly.

HERE a sample of the data I am using. Please, let me know if you need more info or a extra hand as contributor.

@felippehsk
Copy link
Contributor Author

I was actually able to go around this issue by just adding the following code to readdzg function:
if abs(z1 - z0) > 1e-6:
m_geodesic = geodesic((y1, x1), (y0, x0)).meters
m += math.sqrt(m_geodesic**2 + (z1 - z0)**2)
else:
m += geodesic((y1, x1, z1), (y0, x0, z0)).meters

However, I still had some issues with the timestamp. For this issue I had to dig a little bit more. Ended up finding that there were a few GGA strings that were empty. So I added a conditional function before processing any GGA, if empty it does not process it. It seems it worked!

@iannesbitt
Copy link
Owner

Hi @felippehsk, interesting issues. Thanks for working this out. If you feel inclined to contribute, you can open a pull request with these changes incorporated. Otherwise I'm happy to add them myself.

@felippehsk
Copy link
Contributor Author

Hi @iannesbitt!

I may have some time this weekend to organize it and open a pull request!

@felippehsk felippehsk mentioned this issue Aug 5, 2021
iannesbitt added a commit that referenced this issue Aug 9, 2021
@iannesbitt
Copy link
Owner

Closed, thank you @felippehsk!

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

Successfully merging a pull request may close this issue.

2 participants