Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

colorise single track in kml file

Tags:

kml

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

like image 406
Terry Avatar asked Aug 08 '12 23:08

Terry


People also ask

How do I create a KML file?

KML files can be created / edited with a text editor (NotePad, etc.) and there are lots of examples that can be downloaded and used as templates (copy/paste). You can also use a spreadsheet to enter the information, and then export that file to a text file, rename it with a . kml extension, and post that...

What is the full form of KML?

You can use Keyhole Markup Language (KML) files to view and share Google Earth information. These files store geographic data and content associated with Google Earth.


1 Answers

As previous answer says, you have to split track into segments and color each segment individually. There is no other way to do this using KML. But remember that this can create very large KML files for long tracks! So try to save some space by using shared styles.

I would recommend creating one "gx:track" with low "draworder" for whole track and collection of placemarks with different colors and high "draworder" for every small segment of track.

You can examine results of this approach here: http://www.zonefivesoftware.com/sporttracks/plugins/?p=dobrou-extensions (it is a plugin for application SportTracks).

It's my tool for visualization of GPS tracks. It does track coloring by creating placemark, with own color style, for every track segment.

Here you can see examples tracks colored in KML:

Track colored by speed #1 KMZ

Track colored by speed #2 KMZ

Track colored by elevation KMZ

Track colored by speed #1Track colored by speed #2Track colored by elevation

like image 154
dobrou Avatar answered Sep 22 '22 17:09

dobrou