本文介绍了使kml文件中的单个轨道着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使gx:track的行根据某些条件在轨道的不同部分具有不同的颜色,但是我无法找到对轨道的一部分进行着色的方法.我正在使用C#生成kml文件.顺便说一句我的gx:track的具有extendedData.

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.

我知道我可以将lineStyle应用于gx:track,但这仅适用于整个轨道,但是我希望沿轨道的线具有不同的颜色.

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.

谢谢.

特里

推荐答案

如先前的答案所述,您必须将轨道分为多个段,并分别为每个段着色.使用KML没有其他方法可以做到这一点.但是请记住,这可以为长距离创建非常大的KML文件!因此,请尝试使用共享样式来节省一些空间.

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.

我建议为整个轨迹创建一个"gx:track",其"draworder"值较低,并为每个小段轨迹创建具有不同颜色的地标,并为每个轨迹的小段创建高"draworder".

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.

您可以在此处检查此方法的结果: http://www.zonefivesoftware.com/sporttracks/plugins/?p=dobrou -extensions (它是应用程序SportTracks的插件).

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

这是我用于GPS轨迹可视化的工具.它会通过为每个轨道段创建具有自己的颜色样式的地标来进行轨道着色.

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

在这里您可以看到以KML颜色显示的示例曲目:

Here you can see examples tracks colored in KML:

按速度#1 KMZ着色的轨道

按速度#2 KMZ着色的轨道

由高程KMZ着色的轨道

这篇关于使kml文件中的单个轨道着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 22:50