开发者

Can't display a track in Google Earth, but works fine in Google Maps - why?

开发者 https://www.devze.com 2023-02-03 12:04 出处:网络
Re, I have this strange problem... one track refuses to show in Google Earth. It displays the distance, elevation, everything, but there are no visible track lines. Importing it into Google Maps work

Re,

I have this strange problem... one track refuses to show in Google Earth. It displays the distance, elevation, everything, but there are no visible track lines. Importing it into Google Maps works fine.

Basically, I have a file with over 350k points. When assembling it, I separated tracks by dates and am now trying to merge them together (manually, by editing the KML file). It appears that when I try to merge placemarks with thousands of coordinates, they stop displaying in Goog开发者_运维问答le Earth; as if there is a limit as to how many coordinates a placemark (linestring) can contain.

Here's the file: http://www.upl.co/upload/s4Co0Gc2Q

Thanks in advance.


You need to use the <tessellate> element on the linestring. This specifies whether to allow the LineString to follow the terrain. To enable tessellation, the altitude mode must be clampToGround or clampToSeaFloor. Very large LineStrings should enable tessellation so that they follow the curvature of the earth (otherwise, they may go underground and be hidden).

The other option is to use the <gx:altitudeOffset> element. This is A KML extension, in the Google extension namespace, that modifies how the altitude values are rendered. This offset allows you to move an entire LineString up or down as a unit without modifying all the individual coordinate values that make up the LineString . (Although the LineString is displayed using the altitude offset value, the original altitude values are preserved in the KML file.) Units are in meters.

Something like this should work.

<LineString id="ID">
  <extrude>1</extrude>                      
  <tessellate>1</tessellate>                
  <altitudeMode>clampToGround</altitudeMode>
  <coordinates><!-- lon,lat[,alt] --></coordinates>            
</LineString>


I have a LineString with about 96000 coordinates, and see the same effect that I can load the KML in google-earth, and see everything correct, except for the LineString (lines are not displayed), as if I had execeeded a certain limit. The coordinates do not have an altitude. I tried with and without tesselation and alitudeMode clampToGround.

Solution for me was to split the LineString up with a MultiGeometry, splitting it in half was sufficient (each LineString now has less than 64000k coordinates).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号