Tag Info

Hot answers tagged

4

You can start with the top left corner of the map canvas and add some offset if you like. iface.mapCanvas().mapToGlobal( QPoint( 0, 0 ) )


2

There are two things you will need to do in python in order to solve this problem Calculating the values There is no support for aggregate expressions in QGIS, so you will have to resort to implementing your own logic with python. You can do the following: Use QgsVectorLayer.maximumValue( fieldIndex ) if you just need the maximum value of a given field. ...


2

If it's just one additional information for each layer, maybe you could pass it through the metadata. In other case, if there are different informations for each feature in the layer you could join an attribute table.


2

You can get a list of items in the composition with the items() method, and then test the item type using type(), so something along these lines should work: maps = [item for item in composition.items() if item.type() == QgsComposerItem.ComposerMap] To be exact, you may want to use: maps = [item for item in composition.items() if item.type() == ...


2

I couldn't find the field count in the fTools anymore (QGIS 2.0). But I managed to get the number of lines within a polygon using the plugin MMQGIS. Assuming you have a line layer test.shp and a polygonlayer buffers.shp you have to do the following: Choose MMQGIS > Combine > Spatial Join Select the parameters: Output Shape (Target) Layer: ...


1

You can use the classQGSCredentials to set and get credentials: http://qgis.org/api/classQgsCredentials.html


1

GDALTools are a core plugin of QGIS, and will be installed by default. If you are missing some parts of the Vector, Raster or Processing menu, please add a screenshot.


1

Following that super blog post http://www.lutraconsulting.co.uk/blog/2014/07/06/qgis-layer-tree-api-part-1/ I will be able to sort manually my layers/groups using layerTreeRoot and moving nodes at the right position. Not as straight forward, but it should work. Here a snippet for moving one node (a group in this case) self.treeRoot = ...


1

Here is a way to set a primitive progress bar. Design is based on example you can found within the PyQgis Dev. Cookbook (see section 11.2) Example is designed to work with features of a QgsVectorLayer but it shows the main steps you could adapt for your process algo. The key to your problem is to find a way to evaluate the progression of your algo within ...



Only top voted, non community-wiki answers of a minimum length are eligible