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

Add elevation processing for GPX files #91

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

ray66
Copy link
Contributor

@ray66 ray66 commented Feb 19, 2024

This PR adds support for elevation data in GPX files. There is a slight drawback for tracks without any elevation data. In this case a diagram with a straight line at 'null' is drawn. It would be better to just display a text like "no elevation data" instead.

@martin-ueding
Copy link
Owner

Thank you for this contribution!

When there is no altitude data, the corresponding time series data frame should just not have the "altitude" column. So we should add some more logic that checks whether we really want to have this column. We could use Series.any to check whether there are any non-zero and non-nan (None) elements in there:

df = pd.DataFrame(points, columns=["time", "latitude", "longitude", "altitude"])
if not df["altitude"].any():
    del df["altitude"]
return df

Do you want to make this change or shall I do that? I'm happy to do it, but I don't want to take it away from you 😊

@ray66
Copy link
Contributor Author

ray66 commented Feb 21, 2024

Thanks for your answer. I prefer that you make the change.

@martin-ueding martin-ueding merged commit 424128c into martin-ueding:master Feb 23, 2024
martin-ueding added a commit that referenced this pull request Feb 23, 2024
martin-ueding added a commit that referenced this pull request Feb 23, 2024
@martin-ueding
Copy link
Owner

I've merged your changes and put mine on top. It will be available in version 0.20.0.

@martin-ueding
Copy link
Owner

Version 0.20.0 is released you can update and try it out. If the issue persists, please reopen this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants