3

I'm trying to add open data from MétéoFrance (French meteorological organisation) as WMS with QGIS 2.18.7 on Windows 7.

The URL looks like this, I've added it to my WMS connections (with my valid token):

https://geoservices.meteofrance.fr/api/TOKEN/ClimNormalesWMORes40EssMetroWMS?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=41.21598999999999791,-5.14082300000000014,51.48935699999999827,8.38489399999999918&CRS=EPSG:4326&WIDTH=515&HEIGHT=392&LAYERS=JANUARY_NORMALS_OF_MEAN_PRESSURE_REDUCED_TO_MSL&STYLES=DejaVuSans_circle_orange&FORMAT=image%2Fpng&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE

But if I add the layer to my empty project, nothing loads. The layer is in my list, but it doesn't show anything. The support told me, that there is always styles=DejaVuSans_circle_orange or format image%2Fpng (%2F replaces /) missing in my request.

The layer source is indicated as

contextualWMSLegend=0&crs=EPSG:4326&dpiMode=7&featureCount=10&format=image/png&layers=JANUARY_NORMALS_OF_MEAN_PRESSURE_REDUCED_TO_MSL&styles=DejaVuSans_circle_orange&url=https://geoservices.meteofrance.fr/api/TOKEN/ClimNormalesWMORes40EssMetroWMS?VERSION%3D1.3.0%26BBOX%3D41.21598999999999791,-5.14082300000000014,51.48935699999999827,8.38489399999999918%26CRS%3DEPSG:4326%26WIDTH%3D515%26HEIGHT%3D392%26LAYERS%3DJANUARY_NORMALS_OF_MEAN_PRESSURE_REDUCED_TO_MSL%26STYLES%3DDejaVuSans_circle_orange%26DPI%3D96%26MAP_RESOLUTION%3D96%26FORMAT_OPTIONS%3Ddpi:96%26TRANSPARENT%3DTRUE

Another possible URL structure is:

https://geoservices.meteofrance.fr/services/ClimNormalesWMORes40EssMetroWMS?version=1.3.0&token=TOKEN&BBOX=41.21598999999999791,-5.14082300000000014,51.48935699999999827,8.38489399999999918&CRS=EPSG:4326&WIDTH=515&HEIGHT=392&LAYERS=JANUARY_NORMALS_OF_MEAN_TEMPERATURE&STYLES=DejaVuSans_circle_noir&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE

But the structure above is the one that their service gave me.

In my browser a png appears, it seems to be the right data.

Even if I choose png and the DejaVuSans_circle_orange layer from the connection list, it doesn't work.

How can I add this parameters to my request? Or is there another way to load the WMS in QGIS?

  • What result do you get if you open the request in a browser – nmtoken May 19 '17 at 13:11
  • Is it really api/TOKEN in the URL? The following document donneespubliques.meteofrance.fr/client/gfx/utilisateur/File/… has a different URL structure – nmtoken May 20 '17 at 7:17
  • That's right, they have two different URL structures. With: geoservices.meteofrance.fr/services/… I get the same (no) result. – geai May 20 '17 at 7:59
  • In my browser a png appears. (It's not what I expected, but it seem to be the right thing.) – geai May 20 '17 at 8:05
  • The generated GetMap request looks correct, but to check that there is no other issue, it always good to run the request in the browser rather than through some client such as QGIS – nmtoken May 20 '17 at 8:06
1

When I add the following WMS to QGIS, from the same supplier, I get a map and a legend (https://geoservices.meteofrance.fr/api/my-token/MF-NWP-GLOBAL-ARPEGE-05-GLOBE-WMS?)

For example, I can load the following layer PRESSURE__MEAN_SEA_LEVEL

When I look at the GetCapabilities response for this service/layer I can see:

<Style>
 <Name>P__SEA__NO_SHADING</Name>
 <Title>Style de représentation d'un champ de pression réduite au niveau de la mer, avec isolignes sans remplissage</Title>
 <LegendURL>
  <Format>image/png</Format>
  <OnlineResource xlink:href="https://geoservices.meteofrance.fr/api/__my-token__/MF-NWP-GLOBAL-ARPEGE-05-GLOBE-WMS?service=WMS&version=1.3.0&sld_version=1.1.0&request=GetLegendGraphic&layer=PRESSURE__MEAN_SEA_LEVEL&style=P__SEA__NO_SHADING&format=image/png"/>
 </LegendURL>
</Style>

Now, when I look at the service in your question (https://geoservices.meteofrance.fr/api/my-token/ClimNormalesWMORes40EssMetroWMS?), I can't get any style variant to provide a map in QGIS, for the JANUARY_NORMALS_OF_MEAN_PRESSURE_REDUCED_TO_MSL layer and I get no legend.

When I look at the GetCapabilities response for this service/layer I can see:

<Style>
 <Name>DejaVuSans_circle_orange</Name>
 <Title>Valeur numérique et position station (point orange) </Title>
</Style>
<Style>
 <Name>Synopsis</Name>
 <Title>Valeur numérique uniquement</Title>
</Style>
<Style>
 <Name>DejaVuSans_circle_noir</Name>
 <Title>Valeur numérique et position station (point noir)</Title>
</Style>

In other words there is no LegendURL and that certainly means that QGIS can't create a legend for the TOC.

I suspect that this is also the reason why no map gets drawn, for example when I add a new layer from a WMS service I see, in order, QGIS making three requests (after I select the layer in the Add WMS Layer dialogue):

  1. GetCapabilities
  2. GetLegendGraphic
  3. GetMap

My thinking here is, if the GetLegendGraphic operation/URL doesn't exist, perhaps QGIS stops making requests and the GetMap operation doesn't get called...

Looking at the Styled Layer Descriptor profile of the Web Map Service Implementation Specification I see that GetLegendGraphic is an optional operation for an SLD enabled WMS, so it appears that the service provider is not in error for not supporting such an operation.

It might be worth flagging this as a QGIS bug.

| improve this answer | |
  • Thank you for your answer! So do I get it right, that the missing GetLegendGraphic is a "mistake" done by the supplier? Or can I change my request so as to get the request that I need? – geai Jun 6 '17 at 8:11
  • I don't think you can change your request. Both QGIS and the supplier may be at fault. You'll need to check the SLD specification to see who is correct. You might be able to work around the issue by cascading the WMS through your​ own copy of MapServer or GeoServer... – nmtoken Jun 6 '17 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.