GRASS logo

NAME - Downloads and imports data from WMS servers.



SYNOPSIS help [-ldockp] [output=string] mapserver=string [layers=string[,string,...]] [styles=string[,string,...]] [srs=string] format=string [wmsquery=string] maxcols=integer maxrows=integer [tileoptions=string] [region=string] [folder=string] [wgetoptions=string] [curloptions=string] method=string [v=integer] [--overwrite] [--verbose] [--quiet]


List available layers and exit
Skip to downloading (to resume downloads faster)
Don't request transparent data.
Clean existing data out of download directory.
Keep band numbers instead of using band color names.
Don't reproject the data, just patch it.
Allow output files to overwrite existing files
Verbose module output
Quiet module output


Name for output raster map
Mapserver to request data from
Layers to request from map server
Styles to request from map server
Source projection to request from server
Default: EPSG:4326
Image format requested from the server
Options: geotiff,tiff,jpeg,gif,png
Default: geotiff
Addition query options for server
Default: version=1.1.1
Maximum columns to request at a time
Default: 1024
Maximum rows to request at a time
Default: 1024
Additional options for r.tileset
Named region to request data for. Current region used if omitted
Folder to save downloaded data to
Additional options for wget
Default: -c -t 5 -nv
Additional options for curl
Default: -C - --retry 5 -s -S
Reprojection method to use
Options: nearest,bilinear,cubic,cubicspline
Default: nearest
Verbosity level
Default: 1

DESCRIPTION handles all of downloading and importing raster data from an OpenGIS "WMS" web mapping server. It need only be told the desired data to collect (bounds and resolution) via a region, the server to get the data from, and the layer or layers to get. It downloads the data in tiles, reprojects it, imports it, and patches it back together.


By default data is downloaded to $GISDBASE/wms_download. This can be changed by setting the folder= option when using

To understand the data you are getting it is necessary to look at the capabilities of the WMS server. This should be available via a capabilities request. This is an example capabilities request to NASA's OnEarth server.

Some brain-dead servers will only talk to certain web browsers. You can fool these by adding "--user-agent=MSIE5.5" to wgetoptions or for curl adding "-A "MSIE5.5" to curloptions.


General Get Capabilities Request

A capabilities request like is where you should start. It tells you what data is offered, the projections it is in, where to find meta data, resolutions, scales, and bounds for data, etc.

NASA OnEarth server: Get Capabilities Request mapserver= -l
Lists the layers available from the NASA OnEarth server. The output is more reliable if xml2 is installed.

US NED Elevation from OnEarth server download (metric units)

Set the resolution to 30 (assuming you're in metric units):
g.region res=30 -ap output=elevation_meters mapserver= \
         layers=us_ned styles=real -o
Downloads real number meter elevation from OnEarth to cover the current region. Uses -o for opaque to get smaller download.

US NED Elevation from OnEarth server download (feet units)

Set the resolution to 90 (assuming you're in feet units) a save this region with a name; this makes resuming downloads possible or rather easier:
g.region res=90 -ap
g.region save=panhandle-90ft output=elevation_feet mapserver= \
         layers=us_ned styles=feet_real -o region=panhandle-90ft
Downloads real number feet elevation from OnEarth to cover the current region. Uses -o for opaque to get smaller download. Using a named region lets us resume later easily. output=elevation_feet mapserver= \
         layers=us_ned styles=feet_real -o region=panhandle-90ft -d method=cubic
-d skips ahead to downloading. This could be used to try downloading again (if some files failed last time) or to import the data differently. Since downloaded files are remembered those already received successfully are not re-requested. In this case we are reimporting the data using the cubic interpolation method instead of nearest neighbor.

LANDSAT from OnEarth server download

Set the resolution to 30 meters for LANDSAT:
g.region res=30 -ap layers=global_mosaic mapserver= \
Downloads LANDSAT color scene.

DRG from Terraserver server download

Set the resolution to 1.2 meters for DRGs. Their native resolution is 2.4 meters, so this is some pretty hefty oversampling:
g.region res=1.2 -ap
g.region save=drg-resolution output=terraserver-drg mapserver= \
         layers=DRG region=drg-resolution format=jpeg srs=EPSG:26910
Downloads digital raster graphics from Microsoft TerraServer. Note that srs will need to be changed to a projection that is appropriate for your region.

REQUIRED PROGRAMS requires the following programs to work:


r.tileset,, r.patch


Soeren Gebbert, Jachym Cepicky, and Cedric Shock

Last changed: $Date: 2007-11-18 02:33:24 -0800 (Sun, 18 Nov 2007) $

Main index - raster index - Full index

© 2003-2008 GRASS Development Team