colorise single track in kml file

Viewed 4548

I am trying to have a gx:track's line to have different colour in different part in the track depending on some conditions, but I am unable to find way to colour part of a track. I am using C# to generate the kml file. BTW my gx:track's has extendedData.

I know I can apply lineStyle to the gx:track but that will only apply to the whole track, but I would like to have different colour along the track's line.

Thanks in advance.

Terry

3 Answers

I used simplekml which uses Python to generate KML code. As the other answers point out you have to split the line into multiple linestrings each of which has a different style. You can use a common set of styles for making the size of kml smaller though.

the end coordinates of one line is the start coordinates of the next line.

Related