[GRASS-dev] [GRASS GIS] #3127: r.in.wms fails

#3127: r.in.wms fails
--------------------------+-------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.3.0
Component: Raster | Version: svn-trunk
Keywords: WMTS, raster | CPU: x86-64
Platform: Linux |
--------------------------+-------------------------
taken from user ML [https://lists.osgeo.org/pipermail/grass-
user/2016-August/074653.html user ML]

{{{
r.in.wms --verbose
url=https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml output=test
layers=bmapgrau srs=3857 driver=WMTS_GRASS
Downloading data from WMS server...
WARNING: no switch
Fetching 56 tiles with 256 x 256 pixel size per tile...
Traceback (most recent call last):
   File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/scripts/r.in.wms", line 236, in <module>
     sys.exit(main())
   File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/scripts/r.in.wms", line 222, in main
     fetched_map = wms.GetMap(options, flags)
   File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/r.in.wms/wms_base.py", line 210, in GetMap
     self.temp_map = self._download()
   File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/r.in.wms/wms_drv.py", line 205, in _download
     tile_dataset.GetRasterBand(1).DataType)
AttributeError: 'NoneType' object has no attribute
'DataType'
}}}

{{{
r.in.wms --verbose
url=https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml output=test
layers=bmapgrau srs=3857 driver=WMS_GDAL
Downloading data from WMS server...
ERROR 1: GDALWMS: The server returned unknown exception.
ERROR 1: /home/bugs/grassdata/loc_epsg3857/rastadata/.tmp/na
da/3422.1, band 1: IReadBlock failed at X offset 0, Y offset
0
ERROR 1: GetBlockRef failed at X block offset 0, Y block
offset 0
ERROR: Incorrect WMS query
}}}

{{{
System Info
GRASS version: 7.3.svn
GRASS SVN revision: r69110
Build date: 2016-08-09
Build platform: x86_64-pc-linux-gnu
GDAL: 2.1.1
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.8.7.1
Python: 2.7.9
wxPython: 3.0.1.1
Platform: Linux-3.16.0-4-amd64-x86_64-with-debian-8.5
}}}

{{{
g.region -p
projection: 99 (WGS 84 / Pseudo-Mercator)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 5961400
south: 5930120
west: 1401500
east: 1407550
nsres: 10
ewres: 10
rows: 3128
cols: 605
cells: 1892440
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3127&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+--------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.3.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: WMTS, raster
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------
Changes (by hellik):

* Attachment "debug_rinwms.txt" added.

r.in.wms debug messages

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3127&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+--------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.3.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: WMTS, raster
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------

Comment (by hellik):

Replying to [ticket:3127 hellik]:

debug=3 messages of r.in.wms attached

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3127#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+--------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.3.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: WMTS, raster
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------

Comment (by mlennert):

I can see in your message a call to:

[https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=geolandbasemap&STYLE=normal&FORMAT=image/png&TILEMATRIXSET=google3857&TILEMATRIX=12&TILECOL=2188&TILEROW=1435]

This gives me the capabilities of the service, but not the tiles. In that
capabilities file, I see that to get the tile 2188,1435, I have to use the
following url:

[http://maps1.wien.gv.at/basemap/bmapgrau/normal/google3857/12/1435/2188.png\]

So it seems (but I'm really a complete newbie in WMTS) that maybe the
wrong URL is being called to get the tile...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3127#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+--------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.3.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: WMTS, raster
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------

Comment (by hellik):

Replying to [comment:2 mlennert]:
> I can see in your message a call to:
>
>
>
[https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=geolandbasemap&STYLE=normal&FORMAT=image/png&TILEMATRIXSET=google3857&TILEMATRIX=12&TILECOL=2188&TILEROW=1435]
>
> This gives me the capabilities of the service, but not the tiles. In
that capabilities file, I see that to get the tile 2188,1435, I have to
use the following url:
>
>
[http://maps1.wien.gv.at/basemap/bmapgrau/normal/google3857/12/1435/2188.png\]
>
> So it seems (but I'm really a complete newbie in WMTS) that maybe the
wrong URL is being called to get the tile...
>
>

yes it seems so; see [http://osgeo-
org.1560.x6.nabble.com/file/n5280116/basemap_rinwms_flag_c.xml]

{{{
[...]
<ResourceURL format="image/png"
template="http://maps1.wien.gv.at/basemap/geolandbasemap/\{Style\}/\{TileMatrixSet\}/\{TileMatrix\}/\{TileRow\}/\{TileCol\}\.png&quot;
resourceType="tile"/>
[...]
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3127#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+--------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.3.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: WMTS, raster
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------

Comment (by hellik):

Replying to [ticket:3127 hellik]:

> {{{
> r.in.wms --verbose
> url=https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml output=test
> layers=bmapgrau srs=3857 driver=WMS_GDAL
> Downloading data from WMS server...
> ERROR 1: GDALWMS: The server returned unknown exception.
> ERROR 1: /home/bugs/grassdata/loc_epsg3857/rastadata/.tmp/na
> da/3422.1, band 1: IReadBlock failed at X offset 0, Y offset
> 0
> ERROR 1: GetBlockRef failed at X block offset 0, Y block
> offset 0
> ERROR: Incorrect WMS query
> }}}

regarding ''driver=WMS_GDAL'', some tests showed that this is not the
correct r.in.wms GDAL driver (i.e. http://www.gdal.org/frmt_wms.html) for
this server, it should be used GDAL WMTS
(http://www.gdal.org/frmt_wmts.html). GDAL WMTS is available since GDAL
2.1.

that's not implemented yet, maybe worth for an enhancement ticket.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3127#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+------------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: WMTS, raster, r.in.wms
       CPU: x86-64 | Platform: Linux
-----------------------+------------------------------------
Changes (by martinl):

* keywords: WMTS, raster => WMTS, raster, r.in.wms
* milestone: 7.3.0 => 7.2.0

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3127#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+------------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.3.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: WMTS, raster, r.in.wms
       CPU: x86-64 | Platform: Linux
-----------------------+------------------------------------
Changes (by martinl):

* milestone: 7.2.0 => 7.3.0

Comment:

Revert milestone to 7.3.0.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3127#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3127: r.in.wms fails
-----------------------+------------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 7.4.0
Component: Raster | Version: svn-trunk
Resolution: invalid | Keywords: WMTS, raster, r.in.wms
       CPU: x86-64 | Platform: Linux
-----------------------+------------------------------------
Changes (by hellik):

* status: new => closed
* resolution: => invalid

Comment:

Replying to [comment:4 hellik]:
> that's not implemented yet, maybe worth for an enhancement ticket.

see #3129 for the enhancement ticket. I'm inclined to close this one.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3127#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>