Bug report #9196

WMTS and CRS issue

Added by Jonathan Moules almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:17824

Description

1) Connect QGIS WMTS to http://maps.warwickshire.gov.uk/gs/gwc/service/wmts
2) Add any of the three tilesets.

====
Now, if you look on the metadata tab for the layer, you'll see it says:

CRS
CRS:84
Bounding Box
-180.0000000000000000,-90.0000000000000000 : 180.0000000000000000,90.0000000000000000

These are both wrong, the tileset used by all of these layers is using a OSGB (EPSG:27700). The extents are around 0,0 to 700000,1300000.

====

This may explain why when I add any of these WMTS layers to a new QGIS project, I'm viewing at 1:100million with the UK (and therefore my data) being a little spec.

History

#1 Updated by Jonathan Moules almost 6 years ago

Note: A similar thing also seems to happen with WMS. Rather than zoom to the bounding box of the layer (try "z_OS_Raster_Basemap") it is zoomed out to what I suspect is the whole world.

When I add that layer to a project in EPSG:27700, at the bottom of the metadata it says:

Layer Extent (layer original source projection)
-11470944.5532619059085846,-15188064.6417546700686216 : 8427360.6833318732678890,4358640.4957639789208770

Which is definitely wrong. The Layer extent is 0,0 : 700000,1300000

#2 Updated by Jonathan Moules almost 6 years ago

WFS seems to be fine.

#3 Updated by Martin Dobias almost 6 years ago

  • Resolution set to fixed/implemented
  • Target version set to Future Release - High Priority
  • Status changed from Open to Closed

Fixed in ba0a637803 (WMS: better use of reported bounding boxes) and ec7718b55e (WMTS: detection of bounding box if none is reported)

#4 Updated by Radim Blazek almost 6 years ago

  • Status changed from Closed to Reopened

I am not able to add longlat (4326) WMS after ba0a637. It seems that axis are somehow messed. I tried with all axis options with UMN Mapserver 6.2.2. QGIS is sending GetCapabilities without version (the server returns 1.3.0 with switched axis, i,e <BoundingBox CRS="EPSG:4326" minx=<min lat> miny=<min long> maxx=<max lat> maxy=<max long>/>) and GetMap with version 1.3.0.

Version no axis switch ignore axis invert axis ignore and invert axis
2.0.1 ok blank blank ok
7a9e682 blank blank ok ok
ba0a637 swapped1 swapped1 blank blank

[1] swapped means that the layer is rendered in extent with switched axis, e.g. LatLong 50,15 is rendered on map canvas at XY 50,15.

As the commmit is relatively old (2 weeks) and nobody other complained, I admit that it may be my local problem, but cannot find any.

#5 Updated by Martin Dobias almost 6 years ago

Followup in b5897c7 - now with no axis switch the map is rendered correctly, but with invert/ignore it is "swapped"

#6 Updated by Radim Blazek almost 6 years ago

Still no luck here, without invert/ignore the map is "swapped".

#7 Updated by Radim Blazek almost 6 years ago

It was my local problem, GDAL installation was broken and GDAL data, which are used by QgsCoordinateReferenceSystem::axisInverted(), were missing.

Thanks to Martin Dobias for help to find that.

#8 Updated by Radim Blazek almost 6 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF