Hot answers tagged

4

Saving this in a Python file and using it in the --code arg should do what you need: from PyQt4.QtCore import * from PyQt4.QtGui import * import os from qgis.core import * from qgis.gui import * from qgis.utils import iface for comp in iface.activeComposers(): print comp folder = r"C:\temp" title = "testing" printer = QPrinter() ...


4

## Iterate through each of the buildings That should be a single comment sign (#), not a double one, otherwise, it tries to parse it as if it was a parameter, and it fails BTW, you do not need to add the script from file. Just save it to the scripts folder, and it will be automatically added to the toolbox Hope this helps!


4

Short answer: No, this is not possible. You need to have ArcView 3.x to run these files. I seem to remember there used to be an ArcView project importer made by Esri that allowed for ArcView 3.x projects to be imported into ArcGIS Desktop. However I'm not sure (Actually, I'm quite certain) that Avenue code is not converted by the importer. If you want to ...


2

The latest versions of the Processing plugin (from 2.10 onwards) contains a couple of errors in the code for the Frequency Analysis tool. You can manually update the tool (located in C:\Users\You\.qgis2\python\plugins\processing\algs\qgis\scripts) or create a new script and use the following code, which is directly taken from the tool, but includes the ...


2

@GeoJohn: I don't know if you've solved this, but the result of the pointGeometry.projectAs("WGS 1984") needs to be assigned to a result variable (e.g., projectedPointGeometry = pointGeometry.projectAs("WGS 1984")). The original pointGeometry is unchanged by the projectAs method. The result variable should have the location in decimal degrees. I need to do a ...


1

I think I understand now. Let me know if this is not what you're looking for. >>> import subprocess >>> p = subprocess.Popen(['v.in.ascii', 'input=/home/username/Desktop/temp.txt', 'output=raster_pnts','x=1','y=2','fs=\',\'','--o'],stdout=subprocess.PIPE, stderr=subprocess.PIPE) >>> stdoutdata, stderrdata = p.communicate() ...


1

zoneStat = QgsZonalStatistics (polygonLayer, rasterFilePath, 'pre-', 1) zoneStat.calculateStatistics(None) calculates by default just Count, Sum and Mean (as you can tell from Raster -> Zonal Statistics in QGIS Desktop, it can do a lot more). If you, for instance, want to compute just the Mean you have to use: zoneStat = QgsZonalStatistics ...



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