Bug report #14974

WMS not working on master a625eeb (2.15.0-80)

Added by Pedro Venâncio over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Web Services clients/WMS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:22923

Description

WMS are not working on the master (qgis-dev 2.15.0-80 a625eeb OSGeo4W 64bits). With yesterday's master version, they were working very well.

The problem I see in the metadata properties is in the layer extent.

The WMS I'm using, uses a projected CRS, and it works ok in QGIS 2.14.3, with the following layer extent:

Layer Spatial Reference System
+proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
Layer Extent (layer original source projection)
71515.6121936073323013,99674.5072469547740184 : 100678.0292317192797782,150324.6242672884836793

Strangely, with today's QGIS master, it takes a geographic extent, although the CRS is projected, and it shows nothing in canvas:

Layer Spatial Reference System
+proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
Layer Extent (layer original source projection)
-8.1331932104725588,39.6686236708940925 : -8.1331892645531472,39.6686277518395016

As I said, with yesterday's master version it was working well. So it must have been caused by any recent change.

getCapabilities.png (19 KB) Christoph Candido, 2016-06-15 02:23 AM

Associated revisions

Revision 0409f5e3
Added by Martin Dobias over 3 years ago

Fix WMS extent calculation from <EX_GeographicBoundingBox> (fixes #14974)

History

#1 Updated by Pedro Venâncio over 3 years ago

Loading the WMS with a geographic CRS (WGS84), which is also supported by the server, already shows the content on canvas. But it is very slow, as it is showing tile by tile, which was not the standard behaviour on 2.14.3 nor the yesterday's master behaviour.

#2 Updated by Nyall Dawson over 3 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

Should be fixed (d77a33) in tomorrow's build -

#3 Updated by Pedro Venâncio over 3 years ago

Thanks Nyall!

#4 Updated by Pedro Venâncio over 3 years ago

  • Status changed from Closed to Reopened
  • Assignee set to Nyall Dawson

Hi Nyall,

I'm reopening this bug report, but I don't know if this is related with the same question fixed in d77a33.

The WMS continues to not show up on the canvas in QGIS master, and comes up with the wrong layer extent. But I realized the source of the problem.

I'm using mapserver as WMS server.

So, if I declare the CRS in the mapfile, pointing to a NTv2 grid file, like this:

PROJECTION
    "+init=pt:pttm06 +wktext" 
END

in GetCapabilities I get:

    <Layer queryable="0" opaque="0" cascaded="0">
        <Name>Ortofotomapa_34cm_2014</Name>
        <Title>Ortofotomapa 34cm (voo 2014)</Title>
        <EX_GeographicBoundingBox>
            <westBoundLongitude>-7.30711</westBoundLongitude>
            <eastBoundLongitude>-6.94372</eastBoundLongitude>
            <southBoundLatitude>40.5624</southBoundLatitude>
            <northBoundLatitude>41.0166</northBoundLatitude>
        </EX_GeographicBoundingBox>
        <BoundingBox CRS="" minx="69950" miny="99950" maxx="100050" maxy="150050" />
        <Style>
          <Name>default</Name>
          <Title>default</Title>
          <LegendURL width="239" height="22">
             <Format>image/png</Format>
             <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href=""/>
          </LegendURL>
        </Style>
    </Layer>

the CRS is empty, but the extent is correct.

With this configuration, QGIS 2.14.3 works great and load the WMS layer in all CRS that are provided by the server. QGIS master loads the layer without any error message, but it does not show anything in canvas. It only works if I choose EPSG:4326 in QGIS WMS provider.

Instead, if I declare the CRS by the EPSG code in mapfile

PROJECTION
    "init=epsg:3763" 
END

the GetCapabilities shows

    <Layer queryable="0" opaque="0" cascaded="0">
        <Name>Ortofotomapa_34cm_2014</Name>
        <Title>Ortofotomapa 34cm (voo 2014)</Title>
        <EX_GeographicBoundingBox>
            <westBoundLongitude>-7.30711</westBoundLongitude>
            <eastBoundLongitude>-6.94372</eastBoundLongitude>
            <southBoundLatitude>40.5624</southBoundLatitude>
            <northBoundLatitude>41.0166</northBoundLatitude>
        </EX_GeographicBoundingBox>
        <BoundingBox CRS="EPSG:3763" minx="69950" miny="99950" maxx="100050" maxy="150050" />
        <Style>
          <Name>default</Name>
          <Title>default</Title>
          <LegendURL width="239" height="22">
             <Format>image/png</Format>
             <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href=""/>
          </LegendURL>
        </Style>
    </Layer>

and QGIS master already shows the WMS layer in canvas.

#5 Updated by Christoph Candido over 3 years ago

The problem even exists in qgis-dev 2.15.0-85 f1ec121 (OSGeo4W x86).

The QGIS WMS Client only accepts CRS 4326 and 3857.
If we change the requested CRS to i.e. EPSG:31255 no getMap request is sent.

With EPSG:3857 and EPSG:4326 everything is fine.

#6 Updated by Even Rouault over 3 years ago

@christophe Could you paste or give a link to the GetCapabilities ?

#7 Updated by Nyall Dawson over 3 years ago

  • Assignee deleted (Nyall Dawson)

#8 Updated by Christoph Candido over 3 years ago

Even,

you point me in the right direction!

The problem lies in the "GetCapabilities" response.
There are only BoundingBox definitions for 4326,3857 and 900913 available for each layer.
Unfortunately, latest QGIS takes this into account. Old releases didn't pay attention.

#9 Updated by Christoph Candido over 3 years ago

@even

Sorry, I was wrong.
After clearing the internal cache, everything works as expected, even with no explicit BoundingBox definitions.
The only difference to older versions: QGIS now limits the WMS layer to the EPSG area of use.
Is there any environment variable to prevent this?

#10 Updated by Christoph Candido over 3 years ago

Nope, i revise my last statement.
The problem is definitely with missing BoundingBox definitions in the GetCapabilities response!
If the BoundingBox definition is not available for a requested projection, the WMS layer is loaded but not displayed.

Can I disable the WMS area-of-use restriction with a local user setting?

#11 Updated by Pedro Venâncio over 3 years ago

Hi Christoh,

From my investigation, I think the problem is in the explicit declaration of the BBox CRS, with the corresponding EPSG code.

If you see here

        <EX_GeographicBoundingBox>
            <westBoundLongitude>-7.30711</westBoundLongitude>
            <eastBoundLongitude>-6.94372</eastBoundLongitude>
            <southBoundLatitude>40.5624</southBoundLatitude>
            <northBoundLatitude>41.0166</northBoundLatitude>
        </EX_GeographicBoundingBox>
        <BoundingBox CRS="" minx="69950" miny="99950" maxx="100050" maxy="150050" />
        <EX_GeographicBoundingBox>
            <westBoundLongitude>-7.30711</westBoundLongitude>
            <eastBoundLongitude>-6.94372</eastBoundLongitude>
            <southBoundLatitude>40.5624</southBoundLatitude>
            <northBoundLatitude>41.0166</northBoundLatitude>
        </EX_GeographicBoundingBox>
        <BoundingBox CRS="EPSG:3763" minx="69950" miny="99950" maxx="100050" maxy="150050" />

the BBox extent is the same in both cases in GetCapabilities, but QGIS master only interprets the BBox correctly in the second case, except for WGS84, that works in every case.

#12 Updated by Giovanni Manghi over 3 years ago

  • Operating System deleted (Windows)
  • Resolution deleted (fixed/implemented)

#13 Updated by Jürgen Fischer over 3 years ago

  • Subject changed from WMS not working on master 2.15.0-80 to WMS not working on master a625eeb (2.15.0-80)

#14 Updated by Martin Dobias over 3 years ago

  • Status changed from Reopened to Feedback

Pedro,

is it possible to access the WMS server somewhere so we can test it?

#15 Updated by Martin Dobias over 3 years ago

  • Status changed from Feedback to Closed

#16 Updated by Martin Dobias over 3 years ago

(Thanks to Pedro who provided me with WMS server to replicate the problem)

Also available in: Atom PDF