1

I have around 4000 placemarks on Google Earth and have colored them red or green according to whether they qualify for a particular criterion or not. I have also given names to the placemarks accordingly. Now I want to save the image of the area with just red and green color of the placemarks shown without any name of the placemarks. For this it appears that I need to put all the red color placemarks in one folder and green ones in the other folder and reduce the opaqueness of lables to 0%. But since I have a lot of points and it would be tedious to do it manually.

So is there any other faster way to do it ?

  • I have the same problem but my labels are switched on by default and turned off when the mouse hovers over the point. I would need to have the opposite situation. I think you explained it at the end of your comment but didn't get it. My Labelstyle is on 0 but I have a Stylemap after it. Thanks <LabelStyle> <scale>0</scale> </LabelStyle> <ListStyle> <LineStyle> <color>ffff00ff</color> <width>0</width> </LineStyle> </Style> <StyleMap id="msn_ylw-pushpin"> <Pair> <key>normal</key> <styleUrl>#sn_ylw-pushpin</styleUrl> </Pair> <Pair> <key>highlight</key> <styleUrl>#sh_ylw-pushpin</styleUrl> </Pair> – stehrs May 15 at 7:57
3

You can edit your placemark as kml file by a text editor with regex capability. I would recommend Notepad++.

Here is a workflow:

  1. In GoogleEarth, right-click and save your placemarks as a kml (.kml) file (Not .kmz).
  2. Open your kml by Notepad++.
  3. Using Replace function of Notepad++, remove words inside the tag <name></name> under <Placemark> category.
  4. Save the file. Open new kml file (just double-click on it).

To remove words between <name> and </name>, dot plus star (.*) is useful.

<Placemark>       <name>.*</name>

to be replaced by:

<Placemark>       <name></name>

Below is a captured image of Notepad++ replace dialog window. In the search mode Regular expression checkbox is on.

enter image description here

If you hit [Replace All] button it will remove all placemark names.

  • There seems to be a problem. I am getting an error when I open my kml in GE, saying "not well formed (invalid token)". Why is this error occurring ? PS - Instead of .* I used the names of the labels and did as you wrote. – Dark_Knight Aug 22 '17 at 16:24
  • @Dark_Knight Is it Parse error perhaps? It suggests an invalid character or something was introduced by the edit. Can you double check you had correctly typed your labels in. – Kazuhito Aug 22 '17 at 16:43
  • You were right. I mistakenly introduced tab spaces while editing. Now it's working. – Dark_Knight Aug 23 '17 at 7:12
2

This can be done without having to edit every placemark, but rather by editing just the shared styles. You will want to apply a label scale of zero in the shared style(s). It would look something like this:

<Style id="style_id">
  <IconStyle>
    <Icon>
      <href>red_icon.png</href>
    </Icon>
  </IconStyle>
  <LabelStyle>
    <scale>0</scale>
  </LabelStyle>
</Style>

The important part is: <LabelStyle><scale>0</scale></LabelStyle>

If your KML contains a StyleMap with a pair of normal & highlight styles, then you probably only have to apply that LabelStyle to the normal style... then the labels will be off by default, but turn on when the mouse hovers over a point/icon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.