r.in.wms.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <h2>DESCRIPTION</h2>
  2. <em>r.in.wms</em> handles all of downloading and importing raster data
  3. from <a href="http://www.opengeospatial.org/standards/wms">OGC
  4. WMS</a> and <a href="http://www.opengeospatial.org/standards/wmts">OGC
  5. WMTS</a> web mapping servers. It only needs be told the
  6. desired data to collect (bounds and resolution) via a region, the
  7. server to get the data from, and the layer or layers to get. It
  8. downloads the data in tiles, reprojects it, imports it, and patches it
  9. back together.
  10. <h2>NOTES</h2>
  11. 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 (see examples)
  14. <p>
  15. If possible, the EPSG code of the current location should be used with the
  16. <b>srs</b> option to avoid unnecessary reprojection.
  17. <p>
  18. When using GDAL WMS driver (<b>driver=WMS_GDAL</b>), the GDAL library
  19. needs to be built with WMS support,
  20. see <a href="http://gdal.org/frmt_wms.html">GDAL WMS</a> manual page
  21. for details.
  22. <h3>Tiled WMS</h3>
  23. Into the parameter <b>layers</b> the name of the <i>TiledGroup</i> need to
  24. be inserted from Tile Service file. Time variable can be specified
  25. in <b>urlparams</b> parameter,
  26. e.g: <tt>urlparams='time=2012-1-1'</tt>.
  27. <h2>EXAMPLES</h2>
  28. <h3>General Get Capabilities Request</h3>
  29. <div class="code"><pre>
  30. # Topographic WMS with OpenStreetMap by mundialis
  31. r.in.wms -c url="http://ows.mundialis.de/services/service?"
  32. r.in.wms -c url="http://ows.mundialis.de/services/service?" | grep Name
  33. # Czech WMS
  34. r.in.wms -c url="http://wms.cuzk.cz/wms.asp"
  35. </pre></div>
  36. <h3>Download raster data from WMS server (GetMap request)</h3>
  37. <h4>Open Street Map</h4>
  38. <div class="code"><pre>
  39. # OSM, using WMS_GRASS driver
  40. g.region n=90 s=-90 w=-180 e=180 res=0:10:00 -p
  41. r.in.wms url="http://watzmann-geog.urz.uni-heidelberg.de/cached/osm" layers=osm_auto:all output=osm format=png
  42. r.info osm
  43. </pre></div>
  44. <div class="code"><pre>
  45. # OSM Overlay WMS (can be used as an overlay for other maps)
  46. r.in.wms url="http://ows.mundialis.de/services/service?" layer=OSM-Overlay-WMS output=osm_overlay format=png
  47. # TOPO-OSM-WMS
  48. r.in.wms url="http://ows.mundialis.de/services/service?" layer=TOPO-OSM-WMS output=topo_osm format=png
  49. r.info topo_osm
  50. # TOPO-WMS
  51. r.in.wms url="http://ows.mundialis.de/services/service?" layer=TOPO-WMS output=topo format=png
  52. r.info topo
  53. </pre></div>
  54. <p>
  55. More OSM WMS servers can be found online, e.g. on the OSM wiki in a
  56. <a href="http://wiki.openstreetmap.org/wiki/WMS#Public_WMS_Servers">OSM WMS Servers list</a>
  57. and on the <a href="http://wiki.openstreetmap.org/wiki/OSM-WMS-EUROPE">OSM-WMS-EUROPE</a> page.
  58. <h4>Countries and coastlines</h4>
  59. <div class="code"><pre>
  60. # using WMS_GRASS driver
  61. r.in.wms url="http://www2.demis.nl/WMS/wms.asp" layers=Countries,Borders,Coastline output=countries srs=4326 format=png
  62. r.info countries
  63. </pre></div>
  64. <h4>Sentinel-2 satellite cloud free global coverage</h4>
  65. <div class="code"><pre>
  66. # North Carolina sample data
  67. g.region raster=elevation -p
  68. # using WMS_GRASS driver
  69. r.in.wms url="https://tiles.maps.eox.at/wms?" layers=s2cloudless output=sentinel2 format=png
  70. r.info sentinel2
  71. </pre></div>
  72. <div align="center" style="margin: 10px">
  73. <a href="r_in_wms_sentinel2.jpg"><img src="r_in_wms_sentinel2.jpg" width="600px" height="531px"></a><br>
  74. <i>Figure: Raleigh (NC, USA) seen by Sentinel-2 (10m resolution; image courtesy: EOX)</i>
  75. </div>
  76. <h4>OGC WMTS Example</h4>
  77. <div class="code"><pre>
  78. # using WMTS_GRASS driver
  79. r.in.wms url="http://gpp3-wxs.ign.fr/yourAPIkey/geoportail/wmts" layers=ORTHOIMAGERY.ORTHOPHOTOS \
  80. output=orthophoto srs=3857 format=jpeg driver=WMTS_GRASS style=normal password="*" username="*"
  81. r.info orthophoto
  82. </pre></div>
  83. Note: username, password and API key can be obtained from <a href="http://api.ign.fr/">IGN API</a> website
  84. <h4>Data covering the Czech Republic</h4>
  85. <div class="code"><pre>
  86. # using WMS_GRASS driver
  87. r.in.wms url="http://wms.cuzk.cz/wms.asp" layers=prehledka_kraju-linie srs=4326 output=kn format=png
  88. </pre></div>
  89. <div class="code"><pre>
  90. # using WMTS_GRASS driver
  91. r.in.wms url="http://geoportal.cuzk.cz/WMTS_ORTOFOTO/WMTService.aspx" layers=orto output=orthophoto \
  92. srs=3857 format=jpeg driver=WMTS_GRASS style=default
  93. r.info orthophoto
  94. </pre></div>
  95. Note: data are provided by
  96. <a href="https://cuzk.cz/en">Czech office for surveying, mapping and cadastre</a>.
  97. <h4>Satellite data covering Europe</h4>
  98. Copernicus Core003 View Services - Optical VHR2 coverage over EU 2011-2013 (provided by JRC;
  99. usage is restricted to non-commercial activities):
  100. <div class="code"><pre>
  101. # get WMS layer list
  102. r.in.wms -c url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?"
  103. r.in.wms -c url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" | grep Name
  104. # spatial subset of Europe
  105. # enlarging maxcols and maxrows in order to minimize impact of copyright notice in map
  106. g.region n=56 s=47 w=5 e=16 res=0:00:10 -pa
  107. # using WMS_GRASS driver
  108. r.in.wms url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" \
  109. layer="OI.Mosaic.NaturalColor.Feathering" output="jrc_copernicus_core003_mosaik" \
  110. maxcols=3400 maxrows=3400
  111. r.info jrc_copernicus_core003_mosaik
  112. # Alternatively, using WMS_GDAL driver with BIGTIFF and compression enabled
  113. r.in.wms url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" \
  114. layer="OI.Mosaic.NaturalColor.Feathering" output="jrc_copernicus_core003_mosaik2" \
  115. maxcols=3400 maxrows=3400 driver=WMS_GDAL gdal_createopt="BIGTIFF=YES,COMPRESS=DEFLATE"
  116. r.info jrc_copernicus_core003_mosaik2
  117. </pre></div>
  118. <h2>REQUIREMENTS</h2>
  119. <em>r.in.wms</em> requires the <a href="https://gdal.org/gdalwarp.html">gdalwarp</a>
  120. utility from the GDAL/OGR library.
  121. <h2>REFERENCES</h2>
  122. <ul>
  123. <li><a href="http://www.opengeospatial.org/standards/wms">OGC WMS</a></li>
  124. <li><a href="http://www.opengeospatial.org/standards/wmts">OGC WMTS</a></li>
  125. </ul>
  126. <h2>SEE ALSO</h2>
  127. <em>
  128. <a href="r.in.gdal.html">r.in.gdal</a>,
  129. <a href="r.patch.html">r.patch</a>,
  130. <a href="r.colors.html">r.colors</a>,
  131. <a href="r.composite.html">r.composite</a>,
  132. <a href="v.in.wfs.html">v.in.wfs</a>
  133. </em>
  134. <p>
  135. See also
  136. <a href="https://grasswiki.osgeo.org/wiki/WxGUI/Video_tutorials#Add_web_service_layer">WMS support in wxGUI</a>.
  137. <h2>AUTHOR</h2>
  138. Stepan Turek, Czech Technical University in Prague, Czech Republic<br>
  139. (bachelor's final project 2012, mentor: Martin Landa)
  140. <!--
  141. <p>
  142. <i>Last changed: $Date$</i>
  143. -->