I would like to add in QGIS real time weather data.

I found this link and this link and I tried to follow the example, but without any success.

I've added a WMS weather data layer for precipitation to the QGIS map, as follows:

First, the parameters for the service:

service = 'crs=EPSG:900913&dpiMode=7&featureCount=10&format=image/png&layers=precipitation&styles=&url=http://wms.openweathermap.org/service'

Next, create the raster layer, specifying WMS as the type:

rlayer = QgsRasterLayer(service, "precip", "wms")

Finally, add the precipitation layer to the map:


the example didn't show any error in the code and no data was added to the weather layer either, I'm not sure why?

  • 3
    According to openweathermap.org/api you need an API key to access their service. – AndreJ Apr 10 '18 at 14:57
  • @ AndreJ I have API key but hot to add correct in services ? – Mar Apr 10 '18 at 17:48
  • it is documented here openweathermap.org/api/weathermaps – Mapperz Apr 10 '18 at 18:12
  • dpiMode=7& is certainly wrong possibly 72 is meant, You are using CRS as a parameter so check you are using version 1.3.0. Can you actually post the WMS GetMap request that is made to the server. – nmtoken Apr 10 '18 at 21:59
  • @Mapperz but icant use this docs to add in QGIS,@nmtoken i test your proposal but don't work again – Mar Apr 22 '18 at 12:27

Your Answer

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

Browse other questions tagged or ask your own question.