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

Rhumb line generation fails with certain lines #8974

Closed
atlight opened this issue Jun 19, 2020 · 2 comments
Closed

Rhumb line generation fails with certain lines #8974

atlight opened this issue Jun 19, 2020 · 2 comments

Comments

@atlight
Copy link

atlight commented Jun 19, 2020

Another rhumb line issue (see also #8042).

Rhumb line generation fails with certain lines. I suspect, but haven't fully confirmed, that these lines are "vertical" (normal to the Earth's surface). This bites anyone with these LineStrings in their GeoJSON.

My interpretation of the situation is that PolylinePipeline.numberOfPointsRhumbLine returns 1, and a one-point rhumb line is indeed generated by PolylinePipeline.generateCartesianRhumbArc, which PolylineGeometry.createGeometry is not expecting and does not handle properly.

Sandcastle example:

var viewer = new Cesium.Viewer("cesiumContainer");
var verticalRhumb = viewer.entities.add({
  polyline: {
    positions: [new Cesium.Cartesian3(-4136082.225644,2896505.853869577,-3883655.777889882),new Cesium.Cartesian3(-4136082.8717214135,2896506.306318757,-3883656.38862544)],
    arcType: Cesium.ArcType.RHUMB,
  },
});
viewer.zoomTo(viewer.entities);

This fails with error:

DeveloperError: Expected right to be typeof object, actual typeof was undefined
Error
    at new DeveloperError (https://sandcastle.cesium.com/CesiumUnminified/Workers/Check-6c0211bc.js:62:13)
    at Object.Check.typeOf.object (https://sandcastle.cesium.com/CesiumUnminified/Workers/Check-6c0211bc.js:281:13)
    at Function.Cartesian3.subtract (https://sandcastle.cesium.com/CesiumUnminified/Workers/Cartesian2-36f5627e.js:536:24)
    at Function.PolylineGeometry.createGeometry (https://sandcastle.cesium.com/CesiumUnminified/Workers/createPolylineGeometry.js:420:31)
    at createPolylineGeometry (https://sandcastle.cesium.com/CesiumUnminified/Workers/createPolylineGeometry.js:558:29)
    at createGeometry (https://sandcastle.cesium.com/CesiumUnminified/Workers/createGeometry.js:60:32)
    at callAndWrap (https://sandcastle.cesium.com/CesiumUnminified/Workers/createTaskProcessorWorker.js:61:25)
    at https://sandcastle.cesium.com/CesiumUnminified/Workers/createTaskProcessorWorker.js:107:9

Browser: Chrome 83

Operating System: Windows 10 18363

@OmarShehata
Copy link
Contributor

Thanks for digging deeper into this @atlight - I believe this is the same issue as reported here: #8764. There's a minimal code example there with a vertical line that shows the issue. I'm going to close this and link your notes to that issue.

@atlight
Copy link
Author

atlight commented Jun 20, 2020

Thanks @OmarShehata! Evidently my searching skills could use some improvement 😄

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

No branches or pull requests

2 participants