[QGIS-Developer] Script vs plugin conundrum
Greetings! I can use the QGIS 3 vector dissolve function in the script console like this: import processing processing.run('qgis:dissolve', {'INPUT' : 'c:/temp/input.shp', 'OUTPUT' : 'c:/temp/dissolved.shp'}) But I don't understand how to replicate this from within a version 3 plugin. My basic problem is that I can't locate the 'processing' object - what do I import? Or do I have to go about this in a completely different way from within a plugin? Rich ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Simultaneous v2 and v3 versions of plugins
Many thanks Borys - that's very clear. Rich On Mon, Apr 2, 2018 at 12:33 PM, Borys Jurgiel <li...@borysjurgiel.pl> wrote: > Yes, QGIS always gets the highest version number matching its > compatibility range. > > > > E.g. if TomBio tools 2.8.0 are for qgisMinimumVersion=2.8, and TomBio > tools 2.9.0 are for qgisMinimumVersion=3.0, then the latter is the > newest, but is only available for QGISes meeting the >= 3.0 requirement. > > > > Btw. there is also a second reason the former is not available for QGIS 3 > at all: its qgisMaximumVersion is by default assumed to be x.98 (where x is > taken from the minVersion), what completely isolates the compatibility > ranges. > > > > Regards, > > Borys > > > > > > Dnia poniedziaĆek, 2 kwietnia 2018 13:08:56 CEST Richard Burkmar pisze: > > > I'm creating a QGIS v3 compatible version of a plugin which is already > > > available from the official repository for QGIS v2 users. My question is, > > > when I submit the new version v3 compatible version of the plugin ( > > > https://plugins.qgis.org/plugins/), will QGIS v2 users still be able to > > > download the v2-compatible version from the repository? > > > > > > Rich > > > > > ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[QGIS-Developer] Simultaneous v2 and v3 versions of plugins
I'm creating a QGIS v3 compatible version of a plugin which is already available from the official repository for QGIS v2 users. My question is, when I submit the new version v3 compatible version of the plugin ( https://plugins.qgis.org/plugins/), will QGIS v2 users still be able to download the v2-compatible version from the repository? Rich ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGIS and ArcGIS in UK Government
It's not a detailed comparison but this short blog post, published yesterday, from a couple of Defra employees (UK Government Department for Environment, Food & Rural Affairs) indicates that Defra recognises the value in using and supporting both QGIS and ArcGIS side by side. https://defradigital.blog.gov.uk/2017/02/20/the-right-gis-tool-for-the-job/ The really interesting revelation for me was that Defra is now officially supporting QGIS. Not so long ago I supported a Defra employee with QGIS and he had to jump through all sorts of hoops to get it installed on his work machine. Budgets in UK government are tighter than ever, and tighter than most at Defra. I can only see this journey continuing in one direction. Rich ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Can't find make using OSGeo4W Shell
If I open 'OSGeo4W Shell' from the installed shortcuts with either of the following versions of QGIS (all installed from the 64 bit standalone for Windows), and type 'make' in the shell, my the command is found and my plugin's makefile is executed: 2.8.2 2.12.3 But if I do the same for the following versions, the make command can't be found (the shell reports 'make' is not recognised as an internal or external command...): 2.16.1 2.18 Can anyone shed any light on this and what I need to do to fix the problem? Rich ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Batch generation of map images with MTR
Many thanks for all the help. Before I got the responses, I found a way to make it work, but I'm clearly not working with the new paradigm, so I will revisit it soon. That code looks very neat Nathan. Thanks for the tip about Atlas Andreas - I will look at that too. Thanks and best wishes, Rich On Wed, Nov 5, 2014 at 11:02 PM, Nathan Woodrow madman...@gmail.com wrote: Hey Richard, There is a new class you can use for the rendering because we now have MTR you have to wait for the image, or listen for the done event. The code is pretty easy and you can see an example of me using it here: https://github.com/DMS-Aus/qgis2img/blob/master/qgis2img/render.py#L43 The basics are: job = QgsMapRendererParallelJob(settings) job.start() job.waitForFinished() image = job.renderedImage() settings is a QgsMapSettings class which you can make or take from the canvas using iface.mapCanvas().mapSetttings() QgsMapSettings has a list of layers to render so you can update that without changing the layers on the canvas, it's very handy. Give that a try and see how you go. - Nathan On Thu Nov 06 2014 at 1:30:54 AM Richard Burkmar rich.burk...@gmail.com wrote: My apologies - I didn't check the latest version of MMQGIS so my statement that the animation feature doesn't work with the latest version of QGIS was incorrect. It seems that they have solved the problem that I encountered, so I'll take a look at the code there. (I hope that this message comes out in the correct thread - I couldn't see how to do it, so I'm sending a message with the same title. I'm new to these mailing lists.) Rich ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Batch generation of map images with MTR
I have code for a python plugin (https://plugins.qgis.org/plugins/TomBio/) that follows this pattern: * display vector layer A in map canvas * use the canvas saveAsImage method to save map image * hide vector layer A from map canvas * display vector layer B in map canvas * use the canvas saveAsImage method to save map image * hide vector layer B from map canvas This works very well in QGIS 2.0.1 - it can rapidly generate hundreds of map images. But I updated to 2.6 and it no longer works. All the map images are created without the vector layers being visible. It seems like the layers are only actually rendered at the end of the process. I tried using the canvas refresh method in the loop, but it made no difference. I also compared the behaviour of the MMQGIS plugin's animation tools, which work in a similar way, and they have the same problem - i.e. they don't work with QGIS 2.6. I just joined the developer list and looking back over some previous posts and doing some background reading here - http://www.lutraconsulting.co.uk/products/qgis-mtr/ - it seems as though the introduction of multi-threaded rendering (MTR) may be responsible. Is there any way I can work with the new rendering system to get this pattern working in recent versions of QGIS? ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Problem with sub-layer visibility in WMS raster layer
I'm trying to solve a problem involving a change to QGIS handling of the setSubLayerVisibility method for a WMS layer. I've noticed the difference between versions 2.0 and 2.6, but I don't know when it was introduced because I don't have the other versions installed. The code below will create a WMS layer from the UK National Biodiversity Network (NBN). (The code starting 'NHM...' specifies that this is a UK species distribution map for the Robin.) The WMS layer is created with four sub-layers. The code below turns off visibility for three of the sub-layers, leaving only one visible. (In the plugin I change the sub-layer visibility depending on the extent of the map.) If I run the sample code in QGIS 2.0, I see only the Grid-2km sub-layer. But if I run it in QGIS 2.6, I see all four sub-layers - the setSublayerVisibility method has no effect. Can anyone confirm whether or not this is a bug, of if there has been a change to handling sub-layer visibility that I should be aware of? url = (url=https://gis.nbn.org.uk/SingleSpecies/NHMSYS530739; + layers=Grid-100mlayers=Grid-1kmlayers=Grid-2kmlayers=Grid-10km + styles=styles=styles=styles= + format=image/pngcrs=EPSG:27700) rlayer = QgsRasterLayer(url, 'NBN WMS layer', 'wms') QgsMapLayerRegistry.instance().addMapLayer(rlayer) rlayer.setSubLayerVisibility(Grid-10km, False) rlayer.setSubLayerVisibility(Grid-2km, True) rlayer.setSubLayerVisibility(Grid-1km, False) rlayer.setSubLayerVisibility(Grid-100m, False) ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Batch generation of map images with MTR
My apologies - I didn't check the latest version of MMQGIS so my statement that the animation feature doesn't work with the latest version of QGIS was incorrect. It seems that they have solved the problem that I encountered, so I'll take a look at the code there. (I hope that this message comes out in the correct thread - I couldn't see how to do it, so I'm sending a message with the same title. I'm new to these mailing lists.) Rich ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer