Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cesium CZML: using lat long alt

Tags:

czml

cesiumjs

I imagine this is a simple problem for anyone really familiar with Cesium's CZML files. I'm just trying to display a series of lat/long/alt points as a flight path using Cesium. Can someone tell me what the "position" tag should look like?

Unless I'm looking in the wrong places, I don't see a lot of examples for CZML. So it's hard to know what tags can be used and how to use them (and the Java console doesn't show the errors if you get them wrong).

In the Sandcastle CZML example on the Cesium website, the relevant section looks like this:

"position" : {
            "interpolationAlgorithm" : "LAGRANGE",
            "interpolationDegree" : 1,
            "epoch" : "2012-08-04T16:00:00Z",
            // Trimmed to just 2 points
            "cartesian" : [0.0, -2379754.6637012, -4665332.88013588, 3628133.68924173,
                           3894.996219574019, -2291336.52323822, -4682359.21232197, 3662718.52171165]
        }

If it's two points, why are there 8 values? If it was ECEF coordinates, I would expect only three per point...

For example, when I tried this, I got an "uncaught error" message in the console... which isn't very helpful:

"cartographic" : [-1.472853549, 0.589580778, 1000,
                  -1.472962668, 0.589739552, 1000 ]

According to the documentation, cartographic takes (long, lat, height) where long and lat are in radians and height is in meters.

like image 982
Noise in the street Avatar asked Sep 30 '22 07:09

Noise in the street


1 Answers

The first coordinate is in each set of 4 is time, so it's actually (t, x, y, z). In the example you posted, t is the number of seconds after the specified epoch that the waypoint exists.

You can also use cartographicRadians or cartographicDegrees, but they would still be specified as (t, lon, lat, alt).

If you want to draw a route that is not time-dynamic (i.e. just a static line) you can use the polyline CZML object instead; which has a list of x/y/z positions without time.

like image 106
Matthew Amato Avatar answered Oct 07 '22 19:10

Matthew Amato