[GRASS-user] Export Raster to Google Earth Files
Hamish
hamish_b at yahoo.com
Fri Oct 16 23:36:11 EDT 2009
Andrew wrote:
> > I would like to export raster files to a Google Earth
> > image (kmz or kml).
> > Does anyone know how this is done? I found a way
> > to export a vector to a kmz file, but not a raster.
Roger André wrote:
> The easiest way to do this for 1 or 2 reasonably sized rasters
> is to simply write a very short KML file that points to the
> image name and defines its geographic extents. If you have to
> do it for hundreds of files, then scripting it is much
> faster.
...
> Here is what the KML should look like:
>
> <GroundOverlay>
> <description>Something pithy</description>
> <name>Something else pithy</name>
> <visibility>1</visibility>
> <open>1</open>
> <Icon>
> <href>"name_of_image_file"</href>
> </Icon>
> <drawOrder>0</drawOrder>
> <LatLonBox>
> <north> DD.dddd</north>
> <south> DD.dddd</south>
> <west> DD.dddd</west>
> <east> DD.dddd</east>
> </LatLonBox>
> </GroundOverlay>
based on this template I've added a r.out.kml script in addons
SVN to do that.
https://trac.osgeo.org/grass/browser/grass-addons/raster/r.out.kml
TODO:
- completely untested
- g.region -n is broken in at least devbr6 (trac #791) so
export only works from LL/WGS84 right now
- pythonization
- add a -k flag to d.out.file to write a KML file (test true north angle(s)!)
comments/testing/suggestions welcome.
Hamish
More information about the grass-user
mailing list