colorise single track in kml file

前端 未结 3 1015
情话喂你
情话喂你 2021-01-02 21:38

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

相关标签:
3条回答
  • 2021-01-02 21:49

    As you discovered, you can only style complete tracks. If you want different segments to have different colors, you need to break the track up, then style each segment.

    0 讨论(0)
  • 2021-01-02 21:53

    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.

    0 讨论(0)
  • 2021-01-02 21:56

    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 #1 Track colored by speed #2 Track colored by elevation

    0 讨论(0)
提交回复
热议问题