Somebody willing to help with "Powder Tracks"-like project?

Greetings!
I’m brand new to Cesium, having found it through a google search for interactive trail maps. I volunteer for a non-profit mtb trail association and we are looking to get some new trail systems “on the map”.

I installed Cesium and the web server and have looked at the tutorials. The CZML tutorial seems the best fit for what we’re trying to do, but I’m having trouble getting certain things figured out.

Most GPS tracking apps and devices (Garmin) use .gpx file formats. How can I convert that to czml? I know it has been asked many times and there currently is no converter, but how does the data in czml correspond to gpx?

For example, the vehicle.czml file in the tutorial has the coordinates written as

0.0,-2379754.6637012,-4665332.88013588,3628133.68924173,

10.0,-2379510.08905552,-4665419.64840452,3628182.20006795,

20.0,-2379568.4769522,-4665555.3441867,3627970.83323261,

``

whereas a gpx file looks like this

32.7

2015-01-08T14:26:56Z

32.7

2015-01-08T14:26:59Z

``

In the czml, what are the 0.0, 10.0, 20.0 at the beginning of every line and where is the elevation data?

I think I’m going to leave it here for now, baby steps.

I hope somebody is willing to help me out with this, I’d greatly appreciate it!

Cheers,

Chris

Hi Chris,

The CZML snippet you provided looks like it is using Cartesian coordinates, so to get from Cartographic you’ll have to do a conversion e.g.

http://cesiumjs.org/Cesium/Build/Documentation/Ellipsoid.html#cartographicArrayToCartesianArray

The 0.0, 10.0, 20.0 are time offsets from the epoch.

If I can take the liberty of plugging our project, did you consider using the Doarama API? You can post a GPX file directly to our server and embed a viewer in your website, along with the other features like synchronised media (video, photos and annotations), automated camera, live tracking etc.

http://www.doarama.com
http://www.doarama.com/api/0.2/docs

Chris

Chris,

thanks so much for your reply. I did check out your project and like it a lot. We may end up using it in the short term, but I would really like to build something that is specific for our area, meaning that when you browse to our page, you will be directly taken to the location of our trails on the globe and billboards will point out the available tracks and any existing footage.

So to come back to my original question, the snippets I posted (which are from the czml tutorial are cartesian. Is there a way to specify cartographic coordinates (as they are already in the gpx file)? I tried using ‘cartographic’ instead of ‘cartesian’ here

// Trimmed to just 2 points

“cartesian” : [0.0, -2379754.6637012, -4665332.88013588, 3628133.68924173,

3894.0, -2291336.52323822, -4682359.21232197, 3662718.52171165]

``

and then used cartographic coordinates (time,lon,lat,elevation) but it wouldn’t work.

There are a couple of other places where ‘cartesian’ is mentioned, once here

“billboard” : {

“eyeOffset” : {

“cartesian” : [0.0, 0.0, 0.0]

``

and then here

“pixelOffset” : {

“cartesian2” : [10.0, 0.0]

``

Would I have to change those to cartographic as well?

And please, if I’m asking obvious questions, please let me know where I can find some documentation to read…I’d be more than grateful.

Cheers,

Chris

No worries. CZML docs can be found here…
https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Guide

You almost had it right. This should work…
// Trimmed to just 2 points
“cartographicDegrees” : [0.0, -118.25, 34.05, 0.0,
3894.0, -122.4167, 37.7833, 0.0]

You should leave the eyeOffset/pixelOffset as cartesians as they’re just offsets in eye or pixel space.

Chris

Chris,

that’s great! I used the cartographicDegrees and it works great. I will do some reading on the CZML guide and hopefully I can come up with some sort of converter for the gpx files.

I’m sure I will have many more questions as I go along and hope that the solutions will present themselves.

Do you have any other insights you wouldn’t mind sharing that may help me along on this? :wink:

Cheers,

Chris