1r.in.wms(1) GRASS GIS User's Manual r.in.wms(1)
2
3
4
6 r.in.wms - Downloads and imports data from OGC WMS and OGC WMTS web
7 mapping servers.
8
10 raster, import, OGC web services, OGC WMS, OGC WMTS
11
13 r.in.wms
14 r.in.wms --help
15 r.in.wms [-cob] url=string output=name layers=string[,string,...]
16 [styles=string[,string,...]] [format=string] [srs=integer]
17 [driver=string] [wms_version=string] [maxcols=integer]
18 [maxrows=integer] [urlparams=string] [username=string] [pass‐
19 word=string] [method=string] [gdal_createopt=string[,string,...]]
20 [region=string] [bgcolor=string] [proxy=string]
21 [proxy_user_pw=string] [capfile=name] [capfile_output=name]
22 [--overwrite] [--help] [--verbose] [--quiet] [--ui]
23
24 Flags:
25 -c
26 Get the server capabilities, print them out, then exit
27
28 -o
29 Do not request transparent data
30
31 -b
32 Keep original bands (default: create composite)
33
34 --overwrite
35 Allow output files to overwrite existing files
36
37 --help
38 Print usage summary
39
40 --verbose
41 Verbose module output
42
43 --quiet
44 Quiet module output
45
46 --ui
47 Force launching GUI dialog
48
49 Parameters:
50 url=string [required]
51 Typically starts with "http://"
52
53 output=name [required]
54 Name for output raster map
55
56 layers=string[,string,...]Â [required]
57 Layer(s) to request from the map server
58
59 styles=string[,string,...]
60 Layer style(s) to request from the map server
61
62 format=string
63 Image format requested from the server
64 Options: geotiff, tiff, jpeg, gif, png, png8
65 Default: png
66
67 srs=integer
68 EPSG code of requested source projection
69 Default: 4326
70
71 driver=string
72 Driver used for communication with the server
73 Options: WMS_GDAL, WMS_GRASS, WMTS_GRASS, OnEarth_GRASS
74 Default: WMS_GRASS
75 WMS_GDAL: Download data using GDAL WMS driver
76 WMS_GRASS: Download data using native GRASS-WMS driver
77 WMTS_GRASS: Download data using native GRASS-WMTS driver
78 OnEarth_GRASS: Download data using native GRASS-OnEarth driver
79
80 wms_version=string
81 WMS standard version
82 Options: 1.1.0, 1.1.1, 1.3.0
83 Default: 1.1.1
84
85 maxcols=integer
86 Maximum columns to request at a time
87 Default: 512
88
89 maxrows=integer
90 Maximum rows to request at a time
91 Default: 512
92
93 urlparams=string
94 Additional query parameters to pass to the server
95
96 username=string
97 Username for server connection
98
99 password=string
100 Password for server connection
101
102 method=string
103 Interpolation method to use in reprojection
104 Options: nearest, linear, cubic, cubicspline
105 Default: nearest
106
107 gdal_createopt=string[,string,...]
108 GDAL creation option(s) to pass to the output format driver
109 In the form of "NAME=VALUE", separate multiple entries with a comma
110
111 region=string
112 Request data for this named region instead of the current region
113 bounds
114
115 bgcolor=string
116 Background color
117 Format: 0xRRGGBB
118
119 proxy=string
120 HTTP proxy only GDAL driver (GDAL_HTTP_PROXY)
121 HTTP proxy
122
123 proxy_user_pw=string
124 User and password for HTTP proxy only for GDAL driver
125 (GDAL_HTTP_PROXYUSERPWD). Must be in the form of [user name]:[pass‐
126 word].
127 User and password for HTTP proxy
128
129 capfile=name
130 Capabilities file to parse (input). It is relevant for WMTS_GRASS
131 and OnEarth_GRASS drivers
132
133 capfile_output=name
134 File where the server capabilities will be saved (’c’ flag)
135
137 r.in.wms handles all of downloading and importing raster data from OGC
138 WMS and OGC WMTS web mapping servers. It only needs be told the desired
139 data to collect (bounds and resolution) via a region, the server to get
140 the data from, and the layer or layers to get. It downloads the data in
141 tiles, reprojects it, imports it, and patches it back together.
142
144 To understand the data you are getting it is necessary to look at the
145 capabilities of the WMS server. This should be available via a capabil‐
146 ities request (see examples)
147
148 If possible, the EPSG code of the current location should be used with
149 the srs option to avoid unnecessary reprojection.
150
151 When using GDAL WMS driver (driver=WMS_GDAL), the GDAL library needs to
152 be built with WMS support, see GDAL WMS manual page for details.
153
154 Tiled WMS
155 Into the parameter layers the name of the TiledGroup need to be in‐
156 serted from Tile Service file. Time variable can be specified in url‐
157 params parameter, e.g: urlparams=’time=2012-1-1’.
158
160 General Get Capabilities Request
161 # Topographic WMS with OpenStreetMap by mundialis
162 r.in.wms -c url="http://ows.mundialis.de/services/service?"
163 r.in.wms -c url="http://ows.mundialis.de/services/service?" | grep Name
164 # Czech WMS
165 r.in.wms -c url="http://wms.cuzk.cz/wms.asp"
166
167 Download raster data from WMS server (GetMap request)
168 Open Street Map
169 # OSM, using WMS_GRASS driver
170 g.region n=90 s=-90 w=-180 e=180 res=0:10:00 -p
171 r.in.wms url="http://watzmann-geog.urz.uni-heidelberg.de/cached/osm" layers=osm_auto:all output=osm format=png
172 r.info osm
173 # OSM Overlay WMS (can be used as an overlay for other maps)
174 r.in.wms url="http://ows.mundialis.de/services/service?" layer=OSM-Overlay-WMS output=osm_overlay format=png
175 # TOPO-OSM-WMS
176 r.in.wms url="http://ows.mundialis.de/services/service?" layer=TOPO-OSM-WMS output=topo_osm format=png
177 r.info topo_osm
178 # TOPO-WMS
179 r.in.wms url="http://ows.mundialis.de/services/service?" layer=TOPO-WMS output=topo format=png
180 r.info topo
181
182 More OSM WMS servers can be found online, e.g. on the OSM wiki in a OSM
183 WMS Servers list and on the OSM-WMS-EUROPE page.
184
185 Countries and coastlines
186 # using WMS_GRASS driver
187 r.in.wms url="http://www2.demis.nl/WMS/wms.asp" layers=Countries,Borders,Coastline output=countries srs=4326 format=png
188 r.info countries
189
190 Sentinel-2 satellite cloud free global coverage
191 # North Carolina sample data
192 g.region raster=elevation -p
193 # using WMS_GRASS driver
194 r.in.wms url="https://tiles.maps.eox.at/wms?" layers=s2cloudless output=sentinel2 format=png
195 r.info sentinel2
196 Figure: Raleigh (NC, USA) seen by Sentinel-2 (10m resolution; image
197 courtesy: EOX)
198
199 OGC WMTS Example
200 # using WMTS_GRASS driver
201 r.in.wms url="http://gpp3-wxs.ign.fr/yourAPIkey/geoportail/wmts" layers=ORTHOIMAGERY.ORTHOPHOTOS \
202 output=orthophoto srs=3857 format=jpeg driver=WMTS_GRASS style=normal password="*" username="*"
203 r.info orthophoto
204 Note: username, password and API key can be obtained from IGN API web‐
205 site
206
207 Data covering the Czech Republic
208 # using WMS_GRASS driver
209 r.in.wms url="http://wms.cuzk.cz/wms.asp" layers=prehledka_kraju-linie srs=4326 output=kn format=png
210 # using WMTS_GRASS driver
211 r.in.wms url="http://geoportal.cuzk.cz/WMTS_ORTOFOTO/WMTService.aspx" layers=orto output=orthophoto \
212 srs=3857 format=jpeg driver=WMTS_GRASS style=default
213 r.info orthophoto
214 Note: data are provided by Czech office for surveying, mapping and
215 cadastre.
216
217 Satellite data covering Europe
218 Copernicus Core003 View Services - Optical VHR2 coverage over EU
219 2011-2013 (provided by JRC; usage is restricted to non-commercial ac‐
220 tivities):
221 # get WMS layer list
222 r.in.wms -c url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?"
223 r.in.wms -c url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" | grep Name
224 # spatial subset of Europe
225 # enlarging maxcols and maxrows in order to minimize impact of copyright notice in map
226 g.region n=56 s=47 w=5 e=16 res=0:00:10 -pa
227 # using WMS_GRASS driver
228 r.in.wms url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" \
229 layer="OI.Mosaic.NaturalColor.Feathering" output="jrc_copernicus_core003_mosaik" \
230 maxcols=3400 maxrows=3400
231 r.info jrc_copernicus_core003_mosaik
232 # Alternatively, using WMS_GDAL driver with BIGTIFF and compression enabled
233 r.in.wms url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" \
234 layer="OI.Mosaic.NaturalColor.Feathering" output="jrc_copernicus_core003_mosaik2" \
235 maxcols=3400 maxrows=3400 driver=WMS_GDAL gdal_createopt="BIGTIFF=YES,COMPRESS=DEFLATE"
236 r.info jrc_copernicus_core003_mosaik2
237
239 r.in.wms requires the gdalwarp utility from the GDAL/OGR library.
240
242 • OGC WMS
243
244 • OGC WMTS
245
247 r.in.gdal, r.patch, r.colors, r.composite, v.in.wfs
248
249 See also WMS support in wxGUI.
250
252 Stepan Turek, Czech Technical University in Prague, Czech Republic
253 (bachelor’s final project 2012, mentor: Martin Landa)
254
256 Available at: r.in.wms source code (history)
257
258 Accessed: Saturday Jan 21 21:17:02 2023
259
260 Main index | Raster index | Topics index | Keywords index | Graphical
261 index | Full index
262
263 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
264
265
266
267GRASS 8.2.1 r.in.wms(1)