getWMSImage.sh - Retrieve maps and imagery from a Web Mapping Server
getWMSImage.sh [options] minLon minLat maxLon maxLat
getWMSImage.sh is a bash-shell script for retrieving maps and imagery from an OGC-compliant Web Mapping Server (WMS). It operates in two modes: default mode and expert mode. The default mode is intended to help most users acquire typical base-map images, choosing from a small set of predefined map types. The existing map types include NASA Blue Marble and Landsat imagery, maps of political boundaries, rivers, etc.
Expert mode can be used to extract arbitrary imagery from any OGC-compliant server. It is intended only for users who are highly knowledgeable about WMS protocol and servers. In general, this requires knowing how to acquire and interpret the so-called "GetCapabilities" document for a server, and using the information to determine the "GetMap" URL, the map layers that are available, and the image formats that are supported. Consult the WMS specifications for details (http://www.opengeospatial.org/standards/wms).
In either mode, the bounding box of the area of interest must be specified through the minLon minLat maxLon maxLat parameters. These are given in decimal-degrees, and must be in the range og [-180..180] for longitudinal values, and [-90..90] for latitudes. To specify a region encompassing one of the poles, use -180 and 180 for minLon, maxLon, and either -90 as minLat for the south pole, or 90 as maxLat for the north pole.
By default, if the script is run without options, an image of NASA's Blue Marble Next-Generation imagery is downloaded for the area of interest, at a resolution of 1025x768 pixels, and placed in a file named BMNG.tiff. A number of options can be used in both modes to override this behavior.
Specifies which of the predetermined map-types to download. Must be one of:
BMNG : Blue Marble Next-Generation; the default
landsat : Landsat imagery
USstates : US state boundaries
UScounties : US state and county boundaries
world : World political boundaries
rivers : major world rivers (scale-dependent)
Use of this option overrides expert options.
Specify the pixel resolution of the requested image/map. The default is 1024x768.
Specify the name for the request image/map file. By default, it is map_name.tiff.
Request that the image background should be transparent. This may or may not be honored by a given WMS. Note that foreground colors are determined by the server.
Expert mode operates in lieu of the -m map_name option of default mode, where the server URL, image layer name(s), and image format must be explictly specified.
Specifies the URL for the desired WMS "GetMap" request.
Specifies the layer name (or comma-separated names) of the map/image feature(s) to be retrieved.
Specifies the format for the requested image, as advertised by the WMS server.
Specify the pixel resolution of the requested image/map. The default is 1024x768.
Specify the name for the request image/map file. By default, it is layer_name.tiff.
Request that the image background should be transparent. This may or may not be honored by a given WMS. Note that foreground colors are determined by the server.
Request that the resultant image file is compressed (not supported on all platforms).
Debug mode; does not delete intermediate files.
getWMSImage.sh -m world 0 0 90 90
will return an image file named world.tiff that is a Blue Marble image of Europe, part of Eurasia, and the north pole.
getWMSImage.sh -m UScounties -o westernUS.tiff -r 500 500 -125 25 -100 50
will return an image file named westernUS.tiff that depicts state and county boundaries of the western half of the United States.
Last updated on $Date$