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

check for adjacent duplicate positions in GroundPolylineGeometry #6693

Merged

Conversation

likangning93
Copy link
Contributor

@OmarShehata noticed that adjacent duplicates were crashing polylines on terrain.

@cesium-concierge
Copy link

Signed CLA is on file.

@likangning93, thanks for the pull request! Maintainers, we have a signed CLA from @likangning93, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@likangning93
Copy link
Contributor Author

Just realized this also isn't really sufficient, same lat/long but with different heights will still cause problems.
I'll fix this soon.

@hpinkos
Copy link
Contributor

hpinkos commented Jun 18, 2018

@likangning93 yeah, I would just set height = 0 for each position, then remove duplicates. We do that for other geometry types like the corridor

@likangning93
Copy link
Contributor Author

Up-to-date and passing

@OmarShehata
Copy link
Contributor

Just tested it out in my sandcastle example (#6692) and it seems to resolve the issue!

@bagnell bagnell merged commit df17965 into CesiumGS:master Jun 18, 2018
@likangning93 likangning93 deleted the polylinesOnTerrainCheckDuplicates branch June 18, 2018 21:31
@OmarShehata
Copy link
Contributor

Actually, I just encountered another issue @likangning93 . If a user passes a number of points, the removeDuplicates part filters that down to unique points. In some cases (in my case, for the first point you click on) this will filter down to just a single point. Which will cause this line to throw a developer error.

I think it would be okay for it to assume you pass at least two points (perhaps with a more descriptive error message), but since it internally filters down this list, I could pass two points, and one gets tossed away, and as a user I wouldn't know what's happening.

@mramato
Copy link
Contributor

mramato commented Jun 19, 2018

Actually, I just encountered another issue @likangning93 . If a user passes a number of points, the removeDuplicates part filters that down to unique points. In some cases (in my case, for the first point you click on) this will filter down to just a single point. Which will cause this line to throw a developer error.

I think it would be okay for it to assume you pass at least two points (perhaps with a more descriptive error message), but since it internally filters down this list, I could pass two points, and one gets tossed away, and as a user I wouldn't know what's happening.

Double check with other geometry, but I believe the official Cesium behavior here would be to simply not draw anything. Otherwise loading external datasets (which are almost always noisy and have issues like this) would be a giant pain for our users.

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 this pull request may close these issues.

6 participants