kml question

Jennifer Adams jma at COLA.IGES.ORG
Thu Feb 19 09:32:23 EST 2009


On Feb 18, 2009, at 10:02 PM, Arlindo da Silva wrote:
> Jennifer, Brian:
>
>   The new kml option is very cool. Do you have any plans to support
> PNG with "set gxout kml"?  TIFF is proprietary, and have not had a
> major upgrade since 1992. Do you know how well it supports
> transparency?  (Very important for combining layers on
> GoogleEarth.)   You could probably reuse most of the printim code
> for a PNG option. Just curious.
>
> --
> Arlindo da Silva
> dasilva at alum.mit.edu

Hi, Arlindo --
I have cc'd gradsusr on this question, since I think it is of general
interest.

The image files created with 'gxout geotiff' and 'gxout kml' are
roughly equivalent to the display inside the plot area of 'gxout
grfill' -- a grid of pixels without anything else. So, if you issue
the following commands:
'set parea 0 11 0 8.5'
'set grid off'
'set mproj scaled'
'set x 0.5 720.5'
'set y 0.5 381.5'
'set mpdraw off'
'set grads off'
'd variable'
'printim x720 y381'

Then you would create a PNG that is roughly equivalent to the TIFF and
you could substitute that file name in the KML and it would work just
as well. In some way, this technique is more flexible because you can
use shaded contours, overlay vectors, etc. and still draw them on
Google Earth.

The TIFF file created with 'gxout kml' has the same geolocation
metadata embedded in it the way the 'gxout geotiff' output does. The
difference is that the 'gxout geotiff' files have floating-point data
values for each pixel and the 'gxout kml' files have color-numbered
index values. I assume there are some GIS applications that would only
need the image and not the data, so that's why I set up a way to
create both. The KML provides a handy way to look at the images with
Google Earth.

For testing, I have been using a free program called Quantum GIS
(qgis.org). Transparency is pretty easy to control within this
application -- you can set any number of pixel values to be
transparent (on a scale of 0-100%). I think Google Earth has some
controls for transparency too. So far, I haven't seen a need to set up
transparency in the GrADS geotiff output. And it's definitely not
clear to me that if I put a transparency mask in the TIFF file, the
GIS applications will know what to do with it. But I'm still a GIS
neophyte...

Please note that some problems with the 'gxout geotiff' output have
been reported to me. I am doing some re-coding and testing and may
have some patches and/or an updated version soon.

Jennifer

p.s. Hooray for TIFF for keeping the standard consistent for all these
years. We need more standards like that.



--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090219/f6bb0113/attachment.html 


More information about the gradsusr mailing list