r.in.wms.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <H2>DESCRIPTION</H2>
  2. <EM>r.in.wms</EM> handles all of downloading and importing raster data from
  3. an <a href="http://www.opengeospatial.org/specs/?page=specs">OpenGIS</a>
  4. "WMS" web mapping server. It need only be told the desired data to collect
  5. (bounds and resolution) via a region, the server to get the data from, and
  6. the layer or layers to get. It downloads the data in tiles, reprojects it,
  7. imports it, and patches it back together.
  8. <H2>NOTES</H2>
  9. By default data is downloaded to $GISDBASE/wms_download. This can be changed
  10. by setting the <EM>folder=</EM> option when using <EM>r.in.wms</EM>.
  11. <P>
  12. To understand the data you are getting it is necessary to look at the
  13. capabilities of the WMS server. This should be available via a capabilities
  14. request. This is an
  15. <a href="http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities">example
  16. capabilities request to NASA's OnEarth server</a>.
  17. <P>
  18. Some brain-dead servers will only talk to certain web browsers. You can
  19. fool these by adding "<tt>--user-agent=MSIE5.5</tt>" to <b>wgetoptions</b>
  20. or for curl adding "<tt>-A "MSIE5.5</tt>" to <b>curloptions</b>.
  21. Other brain-dead servers will not accept queries in the form of POST data.
  22. If you get an error try using the <b>-g</b> flag to force <em>r.in.wms</em>
  23. to send an atomic GET request instead.
  24. <H2>EXAMPLES</H2>
  25. <H3>General Get Capabilities Request</H3>
  26. A capabilities request like
  27. <a href="http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities">http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities</a>
  28. is where you should start. It tells you what data is offered, the projections
  29. it is in, where to find meta data, resolutions, scales, and bounds for
  30. data, etc.
  31. <H3>NASA OnEarth server: Get Capabilities Request</H3>
  32. <div class="code"><pre>
  33. r.in.wms mapserver=http://wms.jpl.nasa.gov/wms.cgi -l
  34. </pre></div>
  35. Lists the layers available from the NASA OnEarth server. The output is
  36. more reliable if <a href="http://ofb.net/~egnor/xml2/">xml2</a> is installed.
  37. <H3>US NED Elevation from OnEarth server download (metric units)</H3>
  38. Set the resolution to 30 (assuming you're in metric units):
  39. <div class="code"><pre>
  40. g.region res=30 -ap
  41. r.in.wms output=elevation_meters mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  42. layers=us_ned styles=real -o
  43. </pre></div>
  44. Downloads real number meter elevation from OnEarth to cover the current
  45. region. Uses -o for opaque to get smaller download.
  46. <H3>US NED Elevation from OnEarth server download (feet units)</H3>
  47. Set the resolution to 90 (assuming you're in feet units) a save this
  48. region with a name; this makes resuming downloads possible or rather
  49. easier:
  50. <div class="code"><pre>
  51. g.region res=90 -ap
  52. g.region save=panhandle-90ft
  53. r.in.wms output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  54. layers=us_ned styles=feet_real -o region=panhandle-90ft
  55. </pre></div>
  56. Downloads real number feet elevation from OnEarth to cover the current
  57. region. Uses <B>-o</B> for opaque to get smaller download. Using a named
  58. region lets us resume later easily.
  59. <div class="code"><pre>
  60. r.in.wms output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  61. layers=us_ned styles=feet_real -o region=panhandle-90ft -d method=cubic
  62. </pre></div>
  63. <b>-d</b> skips ahead to downloading. This could be used to try
  64. downloading again (if some files failed last time) or to import the data
  65. differently. Since downloaded files are remembered those already received
  66. successfully are not re-requested. In this case we are reimporting the
  67. data using the cubic interpolation method instead of nearest neighbor.
  68. <H3>LANDSAT from OnEarth server download</H3>
  69. Set the resolution to 30 meters for LANDSAT:
  70. <div class="code"><pre>
  71. g.region res=30 -ap
  72. r.in.wms layers=global_mosaic mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  73. output=wms_global_mosaic
  74. </pre></div>
  75. Downloads LANDSAT color scene.
  76. <H3>DRG from Terraserver server download</H3>
  77. Set the resolution to 1.2 meters for DRGs. Their native resolution is
  78. 2.4 meters, so this is some pretty hefty oversampling:
  79. <div class="code"><pre>
  80. g.region res=1.2 -ap
  81. g.region save=drg-resolution
  82. r.in.wms output=terraserver-drg mapserver=http://terraserver.microsoft.com/ogcmap6.ashx \
  83. layers=DRG region=drg-resolution format=jpeg srs=EPSG:26910
  84. </pre></div>
  85. Downloads digital raster graphics from Microsoft TerraServer. Note that
  86. srs will need to be changed to a projection that is appropriate for your
  87. region.
  88. <H2>REQUIRED PROGRAMS</H2>
  89. <EM>r.in.wms</EM> requires the following programs to work:
  90. <ul>
  91. <li>wget: An http download program, or
  92. <li>curl: Alternate http download program
  93. <li>bc: A calculator program
  94. <li>sed, grep: Unix string processing and search programs
  95. <li><a href="http://www.gdal.org">gdalwarp</a>: A reprojection tool,
  96. needed only if data is projected into this location.
  97. <li><a href="http://ofb.net/~egnor/xml2/">xml2</a>: An xml parser.
  98. Enables more accurate listing of layers on the server.
  99. </ul>
  100. <H2>SEE ALSO</H2>
  101. <a href="r.tileset.html">r.tileset</a>,
  102. <a href="r.in.gdal.html">r.in.gdal</a>,
  103. <a href="r.patch.html">r.patch</a>
  104. <H2>AUTHORS</H2>
  105. Soeren Gebbert, Jachym Cepicky, and Cedric Shock
  106. <p>
  107. <i>Last changed: $Date$</i>