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

2018-04-24 Thread Xristos Xristoou
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 :

> 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  i...@gmail.com>> wrote:
>
> I would like to add in QGIS real time weather data.
>
> I found this link 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=7=10=image/
> png=precipitation==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@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

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

2018-04-24 Thread Michel Stuyts
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 
> wrote:

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=7=10=image/png=precipitation==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@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

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

2018-04-24 Thread Luigi Pirelli
qgis in debug mode... btw you should find messages in messagelog and
layer.isValid() = False

src/core/qgsmessagelog.cpp: 27: (logMessage) [0ms] 2018-04-24T09:48:50
WMS[1] Download of capabilities failed: Error downloading
http://wms.openweathermap.org/service?SERVICE=WMS=GetCapabilities -
server replied: Not Found

***


src/core/raster/qgsrasterlayer.cpp: 118: (QgsRasterLayer) [97205ms] Entered
src/core/raster/qgsrasterlayer.cpp: 1221: (setRenderer) [0ms] Entered
src/core/raster/qgsrasterlayer.cpp: 591: (setDataProvider) [0ms] Entered
src/core/qgsproviderregistry.cpp: 408: (createProvider) [0ms] Library name
is
/mnt/data/PROGRAMMING/QGIS/QGIS-master/build/output/lib/qgis/plugins/libwmsprovider.so
src/providers/wms/qgswmsprovider.cpp: 108: (QgsWmsProvider) [0ms]
constructing with uri
'crs=EPSG:900913=7=10=image/png=precipitation==
http://wms.openweathermap.org/service'.
src/providers/wms/qgswmscapabilities.cpp: 40: (parseUri) [0ms] uriString =
crs=EPSG:900913=7=10=image/png=precipitation==
http://wms.openweathermap.org/service
src/providers/wms/qgswmscapabilities.cpp: 86: (parseUri) [0ms] mBaseUrl =
http://wms.openweathermap.org/service?
src/providers/wms/qgswmscapabilities.cpp: 98: (parseUri) [0ms] Entering:
layers:precipitation, styles:
src/providers/wms/qgswmscapabilities.cpp: 101: (parseUri) [0ms] Setting
image encoding to image/png.
src/providers/wms/qgswmscapabilities.cpp: 151: (parseUri) [0ms] Contextual
legend: 0
src/providers/wms/qgswmsprovider.cpp: 313: (addLayers) [0ms] Entering:
layers:precipitation, styles:
src/providers/wms/qgswmsprovider.cpp: 325: (addLayers) [0ms] set visibility
of layer 'precipitation' to true.
src/providers/wms/qgswmsprovider.cpp: 334: (addLayers) [0ms] Exiting.
src/providers/wms/qgswmsprovider.cpp: 1155: (retrieveServerCapabilities)
[0ms] entering: forceRefresh=0
src/providers/wms/qgswmscapabilities.cpp: 1926: (downloadCapabilities)
[0ms] entering: forceRefresh=0
src/providers/wms/qgswmscapabilities.cpp: 1936: (downloadCapabilities)
[0ms] url =
http://wms.openweathermap.org/service?SERVICE=WMS=GetCapabilities
src/core/qgsnetworkaccessmanager.cpp: 96: (queryProxy) [0ms] using fallback
proxy for
http://wms.openweathermap.org/service?SERVICE=WMS=GetCapabilities
src/core/qgsnetworkaccessmanager.cpp: 223: (createRequest) [0ms] Created
[reply:4b80020]
src/providers/wms/qgswmscapabilities.cpp: 1982: (capabilitiesReplyProgress)
[140ms] 162 of 162 bytes of capabilities downloaded.
src/providers/wms/qgswmscapabilities.cpp: 1982: (capabilitiesReplyProgress)
[0ms] 162 of 162 bytes of capabilities downloaded.
src/core/qgsmessagelog.cpp: 27: (logMessage) [0ms] 2018-04-24T09:48:50
WMS[1] Download of capabilities failed: Error downloading
http://wms.openweathermap.org/service?SERVICE=WMS=GetCapabilities -
server replied: Not Found
src/core/qgsproviderregistry.cpp: 430: (createProvider) [0ms] Instantiated
the data provider plugin: wms
src/core/raster/qgsrasterlayer.cpp: 616: (setDataProvider) [0ms] Data
provider created
src/core/raster/qgsrasterpipe.cpp: 165: (set) [0ms] 14QgsWmsProvider
src/core/raster/qgsrasterpipe.cpp: 143: (interfaceRole) [0ms]
14QgsWmsProvider role = 1
src/core/raster/qgsrasterpipe.cpp: 81: (insert) [0ms] insert
14QgsWmsProvider at 0
src/core/raster/qgsrasterpipe.cpp: 63: (connect) [0ms] Entered
src/core/raster/qgsrasterpipe.cpp: 143: (interfaceRole) [0ms]
14QgsWmsProvider role = 1
src/core/raster/qgsrasterpipe.cpp: 97: (insert) [0ms] inserted OK
src/core/raster/qgsrasterpipe.cpp: 63: (connect) [0ms] Entered


Luigi Pirelli

**
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
*
https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition
* Hire me: http://goo.gl/BYRQKg
**

On 23 April 2018 at 21:28, Xristos Xristoou  wrote:

> 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=7=10=image/png=precipitation==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:
>
> 

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

2018-04-23 Thread Xristos Xristoou
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=7=10=image/png=precipitation==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@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user