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

Fix issue in rhumb arc polylines #8787

Merged
merged 7 commits into from
Jun 15, 2020
Merged

Fix issue in rhumb arc polylines #8787

merged 7 commits into from
Jun 15, 2020

Conversation

dennisadams
Copy link
Contributor

Fixes #8464 .
See my comment over there explaining the issue and the solution.
The issue is actually in all rhumb-arc polylines. This should crush your sancastle with a normalized result is not a number error:

var viewer = new Cesium.Viewer("cesiumContainer");
viewer.entities.add({
  polyline : {
    positions : Cesium.Cartesian3.fromDegreesArray([10.0, 0.0,
                                                    10.0, 5.0]),
    arcType : Cesium.ArcType.RHUMB
  }
});
viewer.zoomTo(viewer.entities);

As I wrote in that comment, I think a better solution would be to compute the number of points for each segment only once and pass it over to generateCartesianRhumbArc. However, I was a bit hesitant to make such a change, because that would break the similarity to generateCartesianArc.
Ideally, I think both generateCartesianArc and generateCartesianRhumbArc can do with some refactoring, for your consideration.

@cesium-concierge
Copy link

Thanks for the pull request @dennisadams!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

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

@cesium-concierge
Copy link

Thanks again for your contribution @dennisadams!

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.

@hpinkos
Copy link
Contributor

hpinkos commented May 29, 2020

Thanks for the PR @dennisadams. I won't have time to review this before the June release on Monday, but I'll be sure to review this for the July release.

@dennisadams
Copy link
Contributor Author

Thanks @hpinkos!

@hpinkos
Copy link
Contributor

hpinkos commented Jun 15, 2020

Thanks for this fix @dennisadams! And thanks for your detailed explanation of the root cause in #8464. That made this really easy to review.

I just added a unit test, and I'll merge this as soon as CI passes

@hpinkos hpinkos merged commit 7dc0f84 into CesiumGS:master Jun 15, 2020
@dennisadams dennisadams deleted the rhumb-arc-fix branch June 15, 2020 17:37
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.

Straight lines in GeoJSON sometimes crash with normalized result is not a number
3 participants