Using python for Google Earth

1387
1
01-21-2012 05:57 AM
CharlesGant
New Contributor III
Kinda off topic for ArcGis, but does anyone know where I can find some info on how to use python to auto-generate GE maps?  Essentially I want to load a KML (that I will generate in ArcMap) into GE, and then save it as an image.  Thanks Guys!
Tags (2)
0 Kudos
1 Reply
StacyRendall1
Occasional Contributor III
You don't need Python to do this, it is in the normal set of Arc tools... ArcToolbox > Conversion Tools > To KML

If, for some reason, you wanted to avoid using the Arc tools, KML is actually pretty easy to make - it's basically a text file with a defined syntax. For example a simple point can be made with the following (from Google KML Tutorial😞
[HTML]<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Placemark>
    <name>Simple placemark</name>
    <description>Attached to the ground. Intelligently places itself
       at the height of the underlying terrain.</description>
    <Point>
      <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
    </Point>
  </Placemark>
</kml>[/HTML]
All you need to do is save it to a text file, give it a .kml extension and GE can load it... You could easily automate the creation of a file like this in Python (iterate over a set of features, getting the coordinates and an attribute for the label).

However, getting symbology to work in GE might not be easy, which is why the Arc tools are nice...
0 Kudos