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 gpx support #9152

Merged
merged 62 commits into from Feb 11, 2022
Merged

Add gpx support #9152

merged 62 commits into from Feb 11, 2022

Conversation

jtorresfabra
Copy link
Contributor

@jtorresfabra jtorresfabra commented Sep 14, 2020

This PR adds support for GPX loading. It's based off this old PR #2939.

Test files for waypoints, tracks and routes have been added, there is also a SandCastle with a dropdown menu for different gpx files here: http://localhost:8080/Apps/Sandcastle/index.html?src=GPX.html. ( test it online )

On top of the rebasedPR we added some symbology options: clampToGround, trackColor and waypoint and track images. Also path symbols have been removed in favor of polyline symbols. The main reason is that path symbols does not support clamp to ground so it was done for the sake of consistency within the symbology options.

@cesium-concierge
Copy link

Thank you so much for the pull request @jtorresfabra! I noticed this is your first pull request and I wanted to say welcome to the Cesium community!

The Pull Request Guidelines is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that.

  • ❌ Missing CONTRIBUTORS.md entry.
  • ❌ Missing CLA.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

Copy link
Contributor

@OmarShehata OmarShehata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start @jtorresfabra ! I've left some notes on fixes, and I think I may have found something that may have been missed in the original PR review (whether GPX needs to resolve external URLs). A few more things:

  1. Should we support clamp to terrain/height reference?

On one hand, GPX data provides elevation relative to the ellipsoid, so the position in 3D should be rendered as-is to be "correct". On the other hand, a lot of GPX data is things moving on the ground, and even the sample files in the Sandcastle aren't quite correct with Cesium World Terrain (they're slightly underground). I've noticed this with my own GPS data, that some points are just going to be underground due to inaccuracies.

I think it shouldn't be hard to do something similar to GeoJSONDataSource where you can pass an option to clamp to the ground, or pass a height reference, so it'd allow you to clamp the waypoints/path to the ground or make them relative to the ground. The default can be HeightReference.NONE to leave the data as-is.

The Sandcastle example should use Cesium World Terrain.

  1. We should double check the license on the sample GPX data used here and add the license to https://github.com/CesiumGS/cesium/blob/master/LICENSE.md#example-applications.

See this comment on where the data comes from #2939 (comment). We can consider simplifying it and using fewer GPX files from one source if you can find any ones you think work better as examples.

  1. Test coverage seems low, see: http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/feature/rebased-gpx/Build/Coverage/Firefox%2080.0%20(Linux%20x86_64)/DataSources/GpxDataSource.js.html.

I also haven't tested what happens with an invalid GPX file/if errors are reported correctly etc.

Source/DataSources/GpxDataSource.js Outdated Show resolved Hide resolved
Source/DataSources/GpxDataSource.js Outdated Show resolved Hide resolved
Source/DataSources/GpxDataSource.js Outdated Show resolved Hide resolved
Source/DataSources/GpxDataSource.js Outdated Show resolved Hide resolved
@OmarShehata
Copy link
Contributor

I've added you to Cesium GS's corporate CLA. Don't forget to add yourself to CONTRIBUTORS.md under Cesium GS!

@jtorresfabra
Copy link
Contributor Author

jtorresfabra commented Sep 15, 2020

@OmarShehata thanks for the review!

I tried to address all the comments. But there are still some concerns:

  1. About clamp to ground: I implemented an option to pass clamp to ground to billboards and polylines, but unfortunately PathGraphics don't support clamp to ground (Clamp Path to Ground #7133). So I'm not sure if that could be misleading for users that won't see their dynamic lines clamped to terrain. I could be missing something, though.

2 & 3) I'm going to look for better data and implement more tests.

@eleu
Copy link

eleu commented Oct 30, 2020

Do you have any timeline / plan to review / merge it? Thanks a lot in advance!

@cesium-concierge
Copy link

Thanks again for your contribution @jtorresfabra!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

3 similar comments
@cesium-concierge
Copy link

Thanks again for your contribution @jtorresfabra!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

Thanks again for your contribution @jtorresfabra!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

Thanks again for your contribution @jtorresfabra!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

Thanks again for your contribution @jtorresfabra!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

2 similar comments
@cesium-concierge
Copy link

Thanks again for your contribution @jtorresfabra!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

Thanks again for your contribution @jtorresfabra!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@sanjeetsuhag
Copy link
Contributor

@mramato Do you have the bandwidth to review this PR? If not, could you recommend someone else who may be well suited for final review?

@sanjeetsuhag
Copy link
Contributor

@eleu This PR fell off our radar but we're close to getting this feature in. We'd appreciate any feedback or sample data you may have.

Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is looking great to me! It would be great if we could have a member of the community who's familiar with GPX take a look at this for the sake of completeness.

Not a blocker to this PR, but I'm just noting that this doesn't support the style specification, as I've seen some other plugins and libraries which do support.

@sanjeetsuhag Can you please update CHANGES.md?

Source/DataSources/GpxDataSource.js Outdated Show resolved Hide resolved
Source/DataSources/GpxDataSource.js Outdated Show resolved Hide resolved
Source/DataSources/GpxDataSource.js Show resolved Hide resolved
@ggetz
Copy link
Contributor

ggetz commented Feb 3, 2022

Also please merge in main when you get the chance. A new eslint rule has gone in.

@ggetz
Copy link
Contributor

ggetz commented Feb 11, 2022

Thanks @sanjeetsuhag and all those involved! I think this is in a good place and we're ready to merge, exciting!

@ggetz ggetz merged commit 6f4c4cc into main Feb 11, 2022
@ggetz ggetz deleted the feature/rebased-gpx branch February 11, 2022 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Issue/PR closed
Development

Successfully merging this pull request may close these issues.

None yet

8 participants