Scale dependency for labels in KML files with many placemarks - kml

There is a KML file that I created by exporting a layer from ArcGIS10.0. The file shows some placemarks that I need to be labeled. However, I want the labels (and the points themselves) to be visible in Google Earth only at or below a certain altitude. I know that using the <Region> tag is the way to do this, but, with a triple-digit number of placemarks, typing in the tag and all the rest of the code for every single placemark does not seem very practical.
The points are all located in one folder, and I wonder if I can use <Region> at the folder level. However, placing <Region> and the rest of the code after the <folder> tag and </Region> just before </folder> did not work. If I am to modify the behavior of the labels at the folder level, where should I place the tags?
Also, how do I edit KML code? I know that I can right-click a file in Google Earth, copy it, and paste the code into a text editor, but how do I get the edited code back into the file?
Sorry for such trivial questions, I'm as new to KML as can be.

By the sound of it, you've tried this:
<folder>
<region>
<placemark></placemark>
<placemark></placemark>
<placemark></placemark>
...
</region>
</folder>
From the KML documentation:
Also, within the KML file, notice that the Region is a sibling of the
image (or geometry) whose visibility it affects.
Therefore what you want to do is this:
<folder>
<region>
[scale limits go here]
</region>
<placemark></placemark>
<placemark></placemark>
<placemark></placemark>
...
</folder>
In terms of editing the KML file - just open it directly in your text editor, don't copy it out of Google Earth.

Related

What's the purpose of the <Snippet> tag in a Google Earth KML file?

I am writing a program that generates KML files, but I can't find a good description or documentation for what the <Snippet> tag is actually used for. Does it get displayed in Google Earth?
A short description of the feature. In Google Earth, this description
is displayed in the Places panel under the name of the feature. If a
Snippet is not supplied, the first two lines of the <description> are
used. In Google Earth, if a Placemark contains both a description and
a Snippet, the <Snippet> appears beneath the Placemark in the Places
panel, and the <description> appears in the Placemark's description
balloon. This tag does not support HTML markup. <Snippet> has a
maxLines attribute, an integer that specifies the maximum number of
lines to display.
source: https://developers.google.com/kml/documentation/kmlreference

Editing SVG Image

I (think I) have some SVG code. I'm trying to edit one of the icons in the iron-icon set. That set includes the SVG code nested in a iron-iconset-svg element. I'm new to working with SVG icons. How can I edit these?
You generally would open them up in something like Illustrator, but from what I can see in the github, it looks like the icons aren't saved anywhere as individual files?
If that is the case, then you would need to get the code like this:
<g id="accessibility"><path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"/></g>
and save it in a text editor as an .svg file. You may need to add more info to make it work, in which case look at this link: view-source:http://s.cdpn.io/3/kiwi.svg and replace the <ellipse> and <path> with the code above.

Visible zoom level for GroundOverlay in KML?

First off, I apologize if this is a novice question and/or if it has been asked already. I'm new to KML and so far, searching for 'GroundOverlay' and 'zoom' hasn't helped me.
I have created a KMZ file from an ESRI ArcGIS Layer. The KMZ includes a GroundOverlay (which is a PNG image). The KMZ opens and works fine in Google Earth, but now I would like to limit its visibility. My data is for the continental 48 US States and is meant to be viewed as such. So, zooming in to a 500-mile eye alt in Google Earth doesn't do the user any good. Is there a setting for GroundOverlay that turns its visibility off when the user is zoomed in to a specific level in Google Earth?
Thanks!
Making features visible in Google Earth when you're zoomed in/out can be controlled by adding a Region to your GroundOverlay. Same concept works for any KML Feature (i.e., Document, Folder, Placemark, GroundOverlay, NetworkLink, etc.)
You can simply add a Region to your GroundOverlay with maxLodPixels value to make it disappear when you're zoomed in. A more advanced setup could have smaller region-sized image overlays rather than a singe continent-sized overlay where each GroundOverlay has a Region for when when that overlay is visible. The visibility of the Region is defined when the bounds of the region (via LatLonAltBox) with respect to a minimum or maximum pixel size.
Note, however, that Google Earth won't let you create or edit a Region on a GroundOverlay directly so you'll need to add that to your KML outside of Google Earth. This and other limitations in Google Earth are listed here.
To get a feel for pixel sizes on the screen and create appropriate minimum pixel size (minLodPixels) and maximum size (maxLodPixels) you can measure the "screen" pixels dimensions with the KML screen ruler. Click "Raw" link to view raw KML then save locally and launch in Google Earth.

kml file coordinates with altitude 0

I've draw a path in Google Earth and then tried to export it as a kml file. I've done the trick with copy paste and it worked. I could create a kml file with all coordinates on it, unfortunately the altitude of each is coordinates is always set to 0. I have tried every altitude modes, from absolute, relativeToGround, relativeToSeaFloor, clampToGround and clampToSeaFloor and still got 0 on each.
<LineString>
<tessellate>1</tessellate>
<gx:altitudeMode>clampToSeaFloor</gx:altitudeMode>
<coordinates>
-0.03577057649673097,43.76757757633825,0
-0.03574088790371616,43.76768808940936,0
-0.03575433162010139,43.7677802270933,0
-0.03582561152308676,43.76788089757672,0
</coordinates>
</LineString>
The strange is, the elevation profile of the path on Google Earth is correct. I must do something wrong when i export to the kml file.
Can anyone tell me, how i can export the path that i have draw with the correct altitude values to a kml file ?
Its working absolutely correct. You specify 'clampto(sea)floor' - so get a line that hugs terrain.
If you want heights for your file - you have to get it from another source.
I made a tool for it: http://www.nearby.org.uk/elevation-kml.php

KML When I click in a Placemark display lines to other coordinates

I have some <placemark> and I dont know if it is posible
When I select a placemark I want to appear lines to diferents points (that I
know the cordinates)
From my Placemark to diferente points
I dont have any idea how I can do it. I was trying to put all the code inside <description> but that doesn't works.
Hey I found something helps me :D
http://www.barnabu.co.uk/uk-and-ireland-flight-maps/
They are ussing like a rollover in the placemark not showing the lines in one state

Resources