[Qgis-user] Adding an OpenWeatherMap WMS layer using PyQGIS

Xristos Xristoou saxri89 at gmail.com
Tue Apr 24 08:08:28 PDT 2018


hello

i try to use  XYZ tiles Service: https://tile.openweathermap.
org/map/{layer}/{z}/{x}/{y}.png?appid={api_key}  (using layer name and my
key like docs) but dont add me layer is empty,any idea why ?
and i am sure that is not real time is a static map correct ?

thank for rensponse



2018-04-24 11:29 GMT+03:00 Michel Stuyts <michel.stuyts at edegem.be>:

> OpenWeatherMap deprecated WMS support. You should use their XYZ tiles
> Service: https://tile.openweathermap.org/map/{layer}/{z}/{x}/{y}.
> png?appid={api_key}
>
> More info on: https://openweathermap.org/api/weathermaps
>
> Michel
>
> On 23 April 2018 at 21:28, Xristos Xristoou <saxri89 at gmail.com<mailto:saxr
> i89 at gmail.com>> wrote:
>
> I would like to add in QGIS real time weather data.
>
> I found this link<https://www.packtpub.com/mapt/book/application_
> development/9781783984985/5/ch05lvl1sec98/adding-real-
> time-weather-data-from-openweathermap> and this link<
> https://www.gislounge.com/adding-real-time-weather-
> data-from-openweathermap-qgis-python-programming-cookbook/> 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:
>
> QgsMapLayerRegistry.instance().addMapLayers([rlayer])
>
> 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?
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180424/e4062a8c/attachment.html>


More information about the Qgis-user mailing list