r.in.wms.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <h2>DESCRIPTION</h2>
  2. <em>r.in.wms</em> handles all of downloading and importing raster data
  3. from an <a href="http://www.opengeospatial.org/standards/wms">OGC
  4. WMS</a> web mapping server. It need only be told the desired data to
  5. collect (bounds and resolution) via a region, the server to get the
  6. data from, and the layer or layers to get. It downloads the data in
  7. tiles, reprojects it, imports it, and patches it back together.
  8. <h2>NOTES</h2>
  9. By default data is downloaded to <tt>$GISDBASE/wms_download</tt>. This can be changed
  10. by setting the <b>folder</b> option when using <em>r.in.wms</em>.
  11. <p>To understand the data you are getting it is necessary to look at the
  12. capabilities of the WMS server. This should be available via a capabilities
  13. request. This is an
  14. <a href="http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities">example
  15. capabilities request to NASA's OnEarth server</a>.
  16. <p><!--
  17. Some brain-dead servers will only talk to certain web browsers. You can
  18. fool these by adding <tt>- -user-agent=MSIE5.5</tt> to <b>wgetoptions</b>
  19. or for curl adding <tt>-A "MSIE5.5"</tt> to <b>curloptions</b>.
  20. -->
  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. E.g. lists the layers available from the NASA OnEarth server.
  32. <div class="code"><pre>
  33. r.in.wms mapserver=http://wms.jpl.nasa.gov/wms.cgi -l
  34. </pre></div>
  35. <h3>US NED Elevation from OnEarth server download (metric units)</h3>
  36. Set the resolution to 30 (assuming you're in metric units):
  37. <div class="code"><pre>
  38. g.region res=30 -ap
  39. r.in.wms -o output=elevation_meters mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  40. layers=us_ned styles=real
  41. </pre></div>
  42. Downloads real number meter elevation from OnEarth to cover the current
  43. region. Uses <b>-o</b> for opaque to get smaller download.
  44. <h3>US NED Elevation from OnEarth server download (feet units)</h3>
  45. Set the resolution to 90 (assuming you're in feet units) a save this
  46. region with a name; this makes resuming downloads possible or rather
  47. easier:
  48. <div class="code"><pre>
  49. g.region res=90 -ap
  50. g.region save=panhandle-90ft
  51. r.in.wms -o output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  52. layers=us_ned styles=feet_real region=panhandle-90ft
  53. </pre></div>
  54. Downloads real number feet elevation from OnEarth to cover the current
  55. region. Uses <b>-o</b> for opaque to get smaller download. Using a named
  56. region lets us resume later easily.
  57. <div class="code"><pre>
  58. r.in.wms -d output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  59. layers=us_ned styles=feet_real -o region=panhandle-90ft method=cubic
  60. </pre></div>
  61. Use flag <b>-d</b> to skip ahead to downloading. This could be used to try
  62. downloading again (if some files failed last time) or to import the data
  63. differently. Since downloaded files are remembered those already received
  64. successfully are not re-requested. In this case we are reimporting the
  65. data using the cubic interpolation method instead of nearest neighbor.
  66. <h3>LANDSAT from OnEarth server download</h3>
  67. Set the resolution to 30 meters for LANDSAT:
  68. <div class="code"><pre>
  69. g.region res=30 -ap
  70. r.in.wms layers=global_mosaic mapserver=http://wms.jpl.nasa.gov/wms.cgi \
  71. output=wms_global_mosaic
  72. </pre></div>
  73. Downloads LANDSAT color scene.
  74. <h3>DRG from Terraserver server download</h3>
  75. Set the resolution to 1.2 meters for DRGs. Their native resolution is
  76. 2.4 meters, so this is some pretty hefty oversampling:
  77. <div class="code"><pre>
  78. g.region res=1.2 -ap
  79. g.region save=drg-resolution
  80. r.in.wms output=terraserver-drg mapserver=http://terraserver.microsoft.com/ogcmap6.ashx \
  81. layers=DRG region=drg-resolution format=jpeg srs=EPSG:26910
  82. </pre></div>
  83. Downloads digital raster graphics from Microsoft TerraServer. Note that
  84. srs will need to be changed to a projection that is appropriate for your
  85. region.
  86. <h2>TODO</h2>
  87. <ul>
  88. <li>Use optionally <a href="http://gdal.osgeo.org/frmt_wms.html">GDAL WMS driver</a></li>
  89. </ul>
  90. <h2>SEE ALSO</h2>
  91. <em>
  92. <a href="r.tileset.html">r.tileset</a>,
  93. <a href="r.in.gdal.html">r.in.gdal</a>,
  94. <a href="r.patch.html">r.patch</a>,
  95. <a href="r.colors.html">r.colors</a>,
  96. <a href="r.composite.html">r.composite</a><br><br>
  97. <a href="v.in.wfs.html">v.in.wfs</a>
  98. </em>
  99. <h2>AUTHORS</h2>
  100. Soeren Gebbert, Jachym Cepicky, and Cedric Shock<br>
  101. Updated for GRASS 7 by Martin Landa, CTU in Prague, Czech Republic (05/2009)
  102. <p><i>Last changed: $Date$</i>