Tag Info

Hot answers tagged

10

If I got you right, the answer is yes, QGIS supports dynamic layer names. You would need to write a Python macro to be ran every time the project is opened. This would be the workflow: Go to on QGIS->Project->Project Properties and replace openProject() with the following Python code: def openProject(): import re, qgis iface = ...


2

You can do that from the QGIS Python console. Follow this workflow: Open the QGIS Python console Adjust the following line to match the path of your text file and copy the whole line to the QGIS Python console: textFilePath = '/tmp/non_grouped_layers.txt' As you can see, in the example above, I want to create a text file named 'non_grouped_layers.txt' ...


1

I would use below code-- If you have access to "Data Access Module" import arcpy,os,sys pattern = 'fish_46.shp' folder = 'C:\Users\USER_NAME\Desktop\delete'## root folder field = 'Id' ## your field where calculation to be applied files_process = [] for root,dirs,files in os.walk('C:\Users\USER_NAME\Desktop\delete'): for filenames in files: if ...


1

By using the new Layer tree (aka legend or ToC) added by Martin Dobias since QGIS v.2.4, you can load a layer to the top of the ToC following these steps: Get a reference of the layer tree root = QgsProject.instance().layerTreeRoot() Create the layer object from PyQt4.QtCore import QFileInfo fileName = "/path/to/raster/file.tif" fileInfo = ...



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