CZML to plot waypoints with different paths color

Hi all,

I am trying to create a CZML file with a historical path which is already interpolated.
The path positions is one whole chunk of cartesian coordinates.
I would like to plot different polyline color to different part of the path.

For example, for the first 10min of the path, the front path would be red.
Then from 10min onward to 20min of the path, the second path would be green.
Then the remaining path will be blue.

I have tried putting the interval to state different color, however the results is not what I want. The whole path will be red from the first 10min then the whole path change to green for the second part.

Is there a way to segment to different path color while keeping it in within a same ID?

My czml code is similar to Vehicle.czml

Except for the part of path.
where I have different intervals to change the color, which is still wrong though.

I would appreciate any assistance. thanks alot!!

This is one "sample" I would like to do on CZML.
But after knowing how to do it in CZML, I would like to learn how to do it using API, and use czmlwriter to convert to this format I desire.

Lastly, I would want to switch the segmentation of line color to stripe property. So it will be one solid then one stripe, and so on and so forth.


It looks like our paths currently do not have support for multi coloring. However, you could use an interval to change the color of the path at certain times. Here is an example:

    "solidColor": {
              "color": [
                  "interval" : "2012-08-04T16:00:00Z/2012-08-04T16:30:00Z",
                  "rgbaf" : [1, 0, 1, 1]
                }, {
                  "interval" : "2012-08-04T16:30:00Z/2012-08-04T17:00:00Z",
                  "rgbaf" : [0, 1, 1, 1]




Hi Hannah,

Yea, I have tried the option of interval to change the color, however it change the whole path. Do you know if what I can do to support multi-color path? or how to plot a solid line from point 1 to 2 then stripe/dashline from point2 to point 3?

Or is there a way to time tagged to the color to certain position?

Unfortunately that’s the best option we have right now. You could try implementing your own MaterialProperty to handle multiple colors for the PolylineColorAppearance.
Here is an example of how to make a polyline with multiple colors using the Primitive API:
We don’t have a stripe material available for polylines at the moment either, sorry.



Hi Hannah,

Is there a way to implement Primitive Polyline and use CZMLwriter to write out the czml version?

So I will have a java file with some position and color etc, then CzmlDocument.getObjectsToWrite().add(primitivepolyline),
then the czml file will be written out.

No, sorry. The CzmlDataSource uses the Entity API, so it isn’t able to draw a path with multiple colors.
This is a feature that has been requested by multiple users, so we will eventually add support for this.


Adding this would be great!

Support for HSL would be great too instead of just RGB

Hi there,

I believe we do have support for hsl colors, see here:

Or did you mean for CZML?

As for the multicolor polyline issue, as far as I know we don’t yet have support for that (although it’s on our radar), but as a workaround you could create multiple polylines that share endpoints.

Hope that helps!

  • Rachel

Yes I meant CZML using HSL.


Hi Simon,

We don’t have HSL support for CZML currently, but it should be pretty easy to add – I’ll push on this when someone on our team has a little time. See the issue opened here:


  • Rachel