grd2kml

Create KML image quadtree from single grid

Synopsis

gmt grd2kml grid [ -Ccpt ] [ -EURL ] [ -Ffiltercode ] [ -Hfactor ] [ -I[intensfile|intensity|modifiers] ] [ -Ltilesize ] [ -Nprefix ] [ -Q ] [ -Ttitle ] [ -V[level] ] [ -fflags ] [ –PAR=value ]

Note: No space is allowed between the option flag and the associated arguments.

Description

grd2kml reads a 2-D grid file and makes a quadtree of PNG images and KML wrappers for Google Earth using the selected tile size [256x256 pixels]. We downsample the grid depending on the viewing level in the quadtree using a Gaussian filter, but other filters can be selected as well. Optionally, illumination may be added by providing a grid file with intensities in the (-1,+1) range or by giving instructions to derive intensities from the input data grid automatically (see -I). Values outside the (-1,+1) intensity range will be clipped. Map colors are specified via a color palette lookup table.

Required Arguments

grid
A 2-D gridded data set (See GRID FILE FORMATS below.)

Optional Arguments

-Ccpt
Name of the color palette table (CPT). Alternatively, supply the name of a GMT color master dynamic CPT [rainbow] to automatically determine a continuous CPT from the grid’s z-range. If the dynamic CPT has a default range then that range will be imposed instead. Another option is to specify -Ccolor1,color2[,color3,...] to build a linear continuous CPT from those colors automatically, scaled to fit the data range. In this case color1 etc can be a r/g/b triplet, a color name, or an HTML hexadecimal color (e.g. #aabbcc ).
-EURL
Instead of hosting the files locally, prepend a site URL. The top-level prefix.kml file will then use this URL to find the other files it references. After building the files you must place the prefix directory at the location pointed to by the URL [local files only].

-Ffiltercode

Specifies the filter to use for the downsampling of the grid for more distant viewing. Choose among boxcar, cosine arch, gaussian, or median [Gaussian]. The filter width is set automatically depending on the level.
-Hfactor
Improve the quality of rasterization by passing the sub-pixel smoothing flag to psconvert [no sub-pixel smoothing].
-I[intensfile|intensity|modifiers]
Gives the name of a grid file with intensities in the (-1,+1) range, or a constant intensity to apply everywhere; this simply affects the ambient light. If just + is given then we derive an intensity grid from the input data grid grd_z via a call to grdgradient using the arguments -A-45 and -Nt1 for that module. You can append +aazimuth and +nargs to override those values. If you want more specific intensities then run grdgradient separately first. [Default is no illumination].
-Ltilesize
Sets the fixed size of the image building blocks. Must be an integer that is radix 2. Typical values are 256 or 512 [256].
-Nprefix
Sets a unique name prefixed used for the top-level KML filename and the directory where all referenced KML files and PNG images will be written [GMT_Quadtree].
-Q
Make grid nodes with z = NaN transparent, using the color-masking feature in PostScript Level 3 (the PS device must support PS Level 3).
-Ttitle
Sets the title of the top-level document (i.e., its description).
-V[level] (more ...)
Select verbosity level [c].
-f[i|o]colinfo (more ...)
Specify data types of input and/or output columns.

Notes

The intensity grid can be created from the data grid using grdgradient and, optionally, modified by grdmath or grdhisteq. Custom intensity grids built with several different illumination angles can be combined with grdmath. For a single illumination angle the automatic illumination can be used instead.

Examples

To make a quadtree image representation of the large topography grid file ellice_basin.nc, using the default tile size, supply automatic shading based on the topography, and use the larger 512x512 tiles, supplying a suitable title, try

gmt grd2kml ellice_basin.nc -I+ -Nellice -L512 -T"Ellice Basin Bathymetry"