img2google

img2google - Create Google Earth KML overlay tiles from bathymetry Mercator img grid

Synopsis

img2google -Rregion [ imgfile ] [ -Amode[altitude] ] [ -C ] [ -Ffademin/fademax ] [ -Gprefix ] [ -LLODmin/LODmax ] [ -Nlayername ] [ -Tdoctitle ] [ -UURL ] [ -V[level] ] [ -Z ] [ --PAR=value ]

Description

img2google is a shell script that reads a 1x1 minute Mercator surface relief img file and creates a Google Earth overlay KML file and associated PNG tile for the specified region. If no input file is given we use topo.18.1.img.

-Rwest/east/south/north[/zmin/zmax][+r][+uunit]

Specify the region of interest.

The region may be specified in one of several ways:

  1. -Rwest/east/south/north. This is the standard way to specify geographic regions when using map projections where meridians and parallels are rectilinear. The coordinates may be specified in decimal degrees or in [±]dd:mm[:ss.xxx][W|E|S|N] format.

  2. -Rwest/south/east/north+r. This form is useful for map projections that are oblique, making meridians and parallels poor choices for map boundaries. Here, we instead specify the lower left corner and upper right corner geographic coordinates, followed by the modifier +r. This form guarantees a rectangular map even though lines of equal longitude and latitude are not straight lines.

  3. -Rg or -Rd. These forms can be used to quickly specify the global domain (0/360 for -Rg and -180/+180 for -Rd in longitude, with -90/+90 in latitude).

  4. -Rcode1,code2,…[+e|r|Rincs]. This indirectly supplies the region by consulting the DCW (Digital Chart of the World) database and derives the bounding regions for one or more countries given by the codes. Simply append one or more comma-separated countries using either the two-character ISO 3166-1 alpha-2 convention (e.g., NO) or the full country name (e.g., Norway). To select a state within a country (if available), append .state (e.g, US.TX), or the full state name (e.g., Texas). To specify a whole continent, spell out the full continent name (e.g., -RAfrica). Finally, append any DCW collection abbreviations or full names for the extent of the collection or named region. All names are case-insensitive. The following modifiers can be appended:

    • +r to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no adjustment]. For example, -RFR+r1 will select the national bounding box of France rounded to nearest integer degree, where inc can be positive to expand the region or negative to shrink the region.

    • +R to adjust the region by adding the amounts specified by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no extension], where inc can be positive to expand the region or negative to shrink the region.

    • +e to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc, while ensuring that the bounding box is adjusted by at least 0.25 times the increment [default is no adjustment], where inc can be positive to expand the region or negative to shrink the region.

  5. -Rxmin/xmax/ymin/ymax[+uunit] specifies a region in projected units (e.g., UTM meters) where xmin/xmax/ymin/ymax are Cartesian projected coordinates compatible with the chosen projection (-J) and unit is an allowable distance unit [e]; we inversely project to determine the actual rectangular geographic region. For projected regions centered on (0,0) you may use the short-hand -Rhalfwidth[/halfheight]+uunit, where halfheight defaults to halfwidth if not given. This short-hand requires the +u modifier.

  6. -Rjustifylon0/lat0/nx/ny, where justify is a 2-character combination of L|C|R (for left, center, or right) and T|M|B (for top, middle, or bottom) (e.g., BL for lower left). The two character code justify indicates which point on a rectangular region region the lon0/lat0 coordinates refer to and the grid dimensions nx and ny are used with grid spacings given via -I to create the corresponding region. This method can be used when creating grids. For example, -RCM25/25/50/50 specifies a 50x50 grid centered on 25,25.

  7. -Rgridfile. This will copy the domain settings found for the grid in specified file. Note that depending on the nature of the calling module, this mechanism will also set grid spacing and possibly the grid registration (see Grid registration: The -r option).

  8. -Ra[uto] or -Re[xact]. Under modern mode, and for plotting modules only, you can automatically determine the region from the data used. You can either get the exact area using -Re [Default if no -R is given] or a slightly larger area sensibly rounded outwards to the next multiple of increments that depend on the data range using -Ra.

Options

imgfile

An img format bathymetry/topography file such as those created by Sandwell and Smith. If this files does not exist in the current directory and the user has set the environment variable $GMT_DATADIR, then img2grd will try to find imgfile in $GMT_DATADIR.

-A

Selects one of 5 altitude modes recognized by Google Earth that determines the altitude (in m) of the image: G clamped to the ground, g append altitude relative to ground, a append absolute altitude, s append altitude relative to seafloor, and S clamp it to the seafloor [Default].

-C

Turn on clipping so that only portions below sea level will be visible in the image [no clipping].

-F

Sets the distance over which the geometry fades, from fully opaque to fully transparent. These ramp values, expressed in screen pixels, are applied at the minimum and maximum end of the LOD (visibility) limits, respectively. [no fading (0/0)].

-G

Specify the prefix for the output image file (the extensions are set automatically). Default uses the naming topoN|S<north>E|W<west>.

-L

Measurement in screen pixels that represents the minimum limit of the visibility range for a given Region Google Earth calculates the size of the Region when projected onto screen space. Then it computes the square root of the Region’s area (if, for example, the Region is square and the viewpoint is directly above the Region, and the Region is not tilted, this measurement is equal to the width of the projected Region). If this measurement falls within the limits defined by LODmin and LODmax (and if the region is in view), the Region is active. If this limit is not reached, the associated geometry is considered to be too far from the user’s viewpoint to be drawn. LODmax represents the maximum limit of the visibility range for a given Region. A value of 1, the default, indicates “active to infinite size.” [always active].

-N

Append the layername of the image (use quotes if strings contain spaces) [topoN|S<north>E|W<west>].

-T

Append the document title (use quotes if strings contain spaces) [“Predicted bathymetry”].

-U

By default, images are referenced locally relative to the KML file. Specify an URL to prepend a server address to the image name reference [local].

-V[level]

Select verbosity level [w]. (See full description) (See cookbook information).

-Z

Uses zip (which must be installed) to create a *.kmz file for easy distribution; append + to delete the KML and PNG file after zipping [No zipping].

Examples

To create a 10x10 degree Google Earth KML tile for the region -R170/180/20/30 using the default topo.18.1.img and output naming convention, try

img2google -R170/180/20/30

To make the same tile with a previous file such as topo.15.1.img, run in verbose mode, clip so only oceanic areas are visible, name the output oldimage, specify the KML metadata directly (including setting the image altitude to 10 km), and make a single *.kmz file, try

img2google topo.15.1.img -R170/180/20/30 -Aa10000 -C -Goldimage \
-N"My KML title" -T"My KML title" -Uhttp://my.server.com/images -V -Z

DATA SETS

For topo.18.1.img and other Sandwell/Smith altimetry-derived Mercator grids, visit http://topex.ucsd.edu.

SEE ALSO

gmt img2grd, psconvert