r.in.wms(1)

NAME
r.in.wms - Downloads and imports data from WMS servers

KEYWORDS
wms

SYNOPSIS
r.in.wms
r.in.wms help
r.in.wms [-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] method=string [v=integer] [--overwrite]

  Flags:

-l  List available layers and exit

-d  Skip to downloading (to resume downloads faster)

-o  Don't request transparent data.

-c  Clean existing data out of download directory.

-k  Keep band numbers instead of using band color names.

-p  Don't reproject the data, just patch it.

--overwrite

  Parameters:

output=string
    Name for resultant raster map

mapserver=string
    Mapserver to request data from

layers=string[,string,...]
    Layers to request from map server

styles=string[,string,...]
    Styles to request from map server

srs=string
    Source projection to request from server Default: EPSG:4326

format=string
    Image format requested from the server Options: geotiff,tiff,jpeg,gif,png Default: geotiff

wmsquery=string
    Addition query options for server Default: version=1.1.1

maxcols=integer
    Maximum columns to request at a time Default: 1024

maxrows=integer
    Maximum rows to request at a time Default: 1024

tileoptions=string
    Additional options for r.tileset

region=string
    Named region to request data for. Current region used if omitted.

folder=string
    Folder to save downloaded data to

wgetoptions=string
    Additional options for wget Default: -c -t 5 --user-agent=MSIE5.5

method=string
    Reprojection method to use Options: nearest,bilinear,cubic,cubicspline Default: nearest

v=integer
    Verbosity level Default: 1

DESCRIPTION
r.in.wms 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.

NOTES
By default data is downloaded to $GISDBASE/wms_download. This can be changed by setting the folder= option when using r.in.wms. 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.

EXAMPLES

http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities
    A Capabilities request. This 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.

r.in.wms mapserver=http://wms.jpl.nasa.gov/wms.cgi -l
</div List the layers available from the NASA OnEarth server. The output is more reliable if xml2 is installed.

g.region res=30
Set the resolution to 30 (assuming you're in meters)
r.in.wms output=elevation_meters mapserver=http://wms.jpl.nasa.gov/wms.cgi layers=us_ned styles=real -o
Download real number meter elevation from OnEarth to cover the current region. Uses -o for opaque to get smaller download.

g.region res=90
Set the resolution to 90 (assuming you're in feet)
g.region save=panhandle-90ft
Save this region with a name; this makes resuming downloads possible or rather easier.
r.in.wms output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi layers=us_ned styles=feet_real -o region=panhandle-90ft
Download 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.
r.in.wms output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi 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.

g.region res=1.2
g.region save=drg-resolution
Set the resolution to 1.2 meters for DRGs. Their native resolution is 2.4 meters, so this is some pretty hefty oversampling.
r.in.wms output=terraserver-drg mapserver=http://terraserver.microsoft.com/ogcmap6.ashx 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
r.in.wms requires the following programs to work:

wget
    An http download program

bc  A calculator program

sed, grep
    Unix string processing and search programs

gdalwarp
    A reprojection tool, needed only if data is projected into this location.

xml2
    An xml parser. Enables more accurate listing of layers on the server.

SEE ALSO
r.patch

AUTHORS
Soeren Gebbert, Jachym Cepicky, and Cedric Shock

Last changed: $Date: 2006/05/02 15:32:17 $

Full index