Bug report #21613

WMTS GetTile and/or WMS GetMap request flips x and y coordinates

Added by Arno Lepisk over 5 years ago. Updated over 5 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:QGIS Server
Affected QGIS version:3.6.0 Regression?:No
Operating System:macOS Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29429

Description

I have a project which I try to expose via WMTS.
The project uses the coordinate system EPSG:3006 (SWEREF99 TM) and is set up to advertise the extent (somewhat rounded numbers)
minx: 580000
miny: 6510000
maxx: 766000
maxy: 6640000

When I try to fetch a tile via
http://IP/qgisserver?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=oktest&FORMAT=image/png&TILEMATRIXSET=EPSG:3006&TILEMATRIX=6&TILECOL=32&TILEROW=38
I only get an empty result with this in the log:
20:07:58 INFO Server[57008]: ******************** New request ***************
20:07:58 INFO Server[57008]: SERVER_NAME: localhost
20:07:58 INFO Server[57008]: REQUEST_URI: /qgisserver?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=oktest&FORMAT=image/png&TILEMATRIXSET=EPSG:3006&TILEMATRIX=6&TILECOL=32&TILEROW=38
20:07:58 INFO Server[57008]: REMOTE_ADDR: 127.0.0.1
20:07:58 INFO Server[57008]: CONTENT_TYPE:
20:07:58 INFO Server[57008]: HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0
20:07:58 WARNING [57008]: formatString is: image/png
20:07:58 INFO Server[57008]: FORMAT:image/png
20:07:58 INFO Server[57008]: LAYER:oktest
20:07:58 INFO Server[57008]: REQUEST:GetTile
20:07:58 INFO Server[57008]: SERVICE:WMTS
20:07:58 INFO Server[57008]: TILECOL:32
20:07:58 INFO Server[57008]: TILEMATRIX:6
20:07:58 INFO Server[57008]: TILEMATRIXSET:EPSG:3006
20:07:58 INFO Server[57008]: TILEROW:38
20:07:58 INFO Server[57008]: VERSION:1.0.0
20:07:58 INFO Server[57008]: WMS Request parameters:
20:07:58 INFO Server[57008]: - CRS : EPSG:3006
20:07:58 INFO Server[57008]: - WIDTH : 256
20:07:58 INFO Server[57008]: - HEIGHT : 256
20:07:58 INFO Server[57008]: - BBOX : 634104.635759,6540133.804875,684072.635772,6590101.804887
20:07:58 INFO Server[57008]: - LAYERS : oktest
20:07:58 INFO Server[57008]: - FORMAT : image/png
20:07:58 INFO Server[57008]: - TRANSPARENT : true
20:07:58 INFO Server[57008]: - DPI : 96
20:07:58 INFO Server[57008]: - VERSION : 1.3.0
20:07:58 INFO server[57008]: Parallel rendering deactivated
20:07:58 INFO Server[57008]: Request finished in 17 ms

Note that the calculated BBOX seems to be in order minx,miny,maxx,maxy

As I understand it the request is recalculated and executed as a WMS GetMap request internally.

If I manually express my tile request as a WMS GetMap request with the BBOX x/y coordinated flipped instead:
http://IP/qgisserver?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=oktest&STYLES=&WIDTH=256&HEIGHT=256&FORMAT=image/png&CRS=EPSG:3006&DPI=96&TRANSPARENT=TRUE&BBOX=6540133.804875,634104.635759,6590101.804887,684072.635772
I get the expected map fragment with the following log:
20:08:31 INFO Server[57008]: ******************** New request ***************
20:08:31 INFO Server[57008]: SERVER_NAME: localhost
20:08:31 INFO Server[57008]: REQUEST_URI: /qgisserver?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=oktest&STYLES=&WIDTH=256&HEIGHT=256&FORMAT=image/png&CRS=EPSG:3006&DPI=96&TRANSPARENT=TRUE&BBOX=6540133.804875,634104.635759,6590101.804887,684072.635772
20:08:31 INFO Server[57008]: REMOTE_ADDR: 127.0.0.1
20:08:31 INFO Server[57008]: CONTENT_TYPE:
20:08:31 INFO Server[57008]: HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0
20:08:31 WARNING [57008]: formatString is: image/png
20:08:31 INFO Server[57008]: BBOX:6540133.804875,634104.635759,6590101.804887,684072.635772
20:08:31 INFO Server[57008]: CRS:EPSG:3006
20:08:31 INFO Server[57008]: DPI:96
20:08:31 INFO Server[57008]: FORMAT:image/png
20:08:31 INFO Server[57008]: HEIGHT:256
20:08:31 INFO Server[57008]: LAYERS:oktest
20:08:31 INFO Server[57008]: REQUEST:GetMap
20:08:31 INFO Server[57008]: SERVICE:WMS
20:08:31 INFO Server[57008]: STYLES:
20:08:31 INFO Server[57008]: TRANSPARENT:TRUE
20:08:31 INFO Server[57008]: VERSION:1.3.0
20:08:31 INFO Server[57008]: WIDTH:256
20:08:31 INFO Server[57008]: WMS Request parameters:
20:08:31 INFO Server[57008]: - CRS : EPSG:3006
20:08:31 INFO Server[57008]: - WIDTH : 256
20:08:31 INFO Server[57008]: - HEIGHT : 256
20:08:31 INFO Server[57008]: - BBOX : 6540133.804875,634104.635759,6590101.804887,684072.635772
20:08:31 INFO Server[57008]: - LAYERS : oktest
20:08:31 INFO Server[57008]: - FORMAT : image/png
20:08:31 INFO Server[57008]: - TRANSPARENT : TRUE
20:08:31 INFO Server[57008]: - DPI : 96
20:08:31 INFO Server[57008]: - VERSION : 1.3.0
20:08:31 INFO server[57008]: Parallel rendering deactivated
20:08:31 INFO Server[57008]: Request finished in 175 ms

Note that the BBOX is expressed as miny,minx,maxy,maxx

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

Did it worked as expected on QGIS Server 2.*?

#2 Updated by Arno Lepisk over 5 years ago

I do not know, 3.6 is the first version I have used for this

#3 Updated by Giovanni Manghi over 5 years ago

Arno Lepisk wrote:

I do not know, 3.6 is the first version I have used for this

Can you just download and install it and try? Thanks!

#4 Updated by Arno Lepisk over 5 years ago

Hi, I've installed and tested 2.18.28 - it doesn't work. Trying to get IP/qgisserver?SERVICE=WMTS&REQUEST=GetCapabilities results in an "Service unknown or unsupported" error. The project file setting doesn't have any WMTS options either; leading me to believe that WMTS wasn't supported in 2.18?

#5 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Feedback to Open

Also available in: Atom PDF