Issue in drawing polyline


We are trying to overlay a track line of the path taken by our sonar collection vehicle during an underwater survey on the point cloud so acquired. Attached please see the image. The left image shows the blue track line over the gold yellow point cloud on a basemap. However, the trackline is too jaggy. On the right the same point cloud and track line is shown in red using our own internal viz tools. The red track line is pretty smooth. Something is going on with the blue track line?

The code uses the following block:

var tracklineentity = viewer.entities.add({ polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights(trackline), width: 5, material: Cesium.Color.BLUE, }, });

where trackline is an array of lat / long coordinates converted from the original UTM coords.

trackline = [-97.95552,30.45297,205,-97.95552,30.45297,205 ... ]

Kindly inform how to reduce the jaggedness of the blue track line?

Cesium JS version is 1.69.

Thanks for your time.



Are bot screenshots using the same number of points to draw the line? Or does your internal viz tool do some kind of additional interpolation?

One option you can tweak here is the granularity of the line. It defaults to Cesium.Math.RADIANS_PER_DEGREE. You can try decreasing that by half and see how that looks. See:

The other reason that may explain the difference is that CesiumJS will clamp lines to the surface of the 3D Tileset. You can disable this by passing clampToGround: false.

Thanks for the reply. Both use the same data - same number of points. No additional interpolation was done. We shall try your suggestions.

Thanks again.