Tag Info

Hot answers tagged

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

QgsMapToolEmitPoint implements the method canvasPressEvent while QgsMapToolAddFeature implements the method canvasReleaseEvent to trigger its actions. CanvasPressEvent is called before canvasReleaseEvent so if you replace the maptool in the first method, the second one will be called on the new map tool. I would recommend to create a new map tool that does ...


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

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

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. ...



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