Re: [Qgis-developer] PyQGIS and checking WMS layers have data
Thanks for the suggestion. I have taken a slightly different approach, and I am checking the file size of my PDFs using the following: os.path.getsize(file) There is an obvious difference between the file sizes of the PDFs where the wms loaded, and those where it failed. If the pdf is too small, it tries to create it again. Hopefully it won't get stuck in a loop where if it fails once it will always fail!! James Fra: Gino Pirelli [mailto:lui...@gmail.com] Sendt: 9. oktober 2013 20:30 Til: Stott James Kopi: qgis-developer@lists.osgeo.org Emne: Re: [Qgis-developer] PyQGIS and checking WMS layers have data probally solution is connecting to the slots of the QgsRasterLayer class public slots: void showStatusMessage( const QString theMessage ); /** \brief Propagate progress updates from GDAL up to the parent app */ void updateProgress( int, int ); /** \brief receive progress signal from provider */ void onProgress( int, double, QString ); ciao Luigi Pirelli (luigi.pire...@faunalia.itmailto:luigi.pire...@faunalia.it) ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] PyQGIS and checking WMS layers have data
Hi all, I have a loop in my code that makes PDFs for a number of polygons and the base mapping comes from an aerial photography WMS. So for each polygon, the python code moves the map to the extent of that polygon and the makes a PDF. However, some of my maps end up with white backgrounds where the aerial photography hasn't loaded/displayed. Is it possible to make sure that a WMS has loaded its data before a PDF is made in python? Or does the problem lie with the network connection at the time that PDF is made? Is there any way I can catch these instances and maybe load the WMS again? The last time I ran the script, of the 1465 PDFs it created, about 21 had a white base map, so generally it works really really well. I have checked that there is actually data for these 21 areas, and there is. It also seems to be different areas that do not load each time I run the script. Many thanks James ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] PyQGIS and checking WMS layers have data
probally solution is connecting to the slots of the QgsRasterLayer class public slots: void showStatusMessage( const QString theMessage ); /** \brief Propagate progress updates from GDAL up to the parent app */ void updateProgress( int, int ); /** \brief receive progress signal from provider */ void onProgress( int, double, QString ); ciao Luigi Pirelli (luigi.pire...@faunalia.it) ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer