The act of setting up computing instructions, usually stored in a file and interpreted at run time.

learn more… | top users | synonyms (1)

0
votes
0answers
20 views

Is there a Python equivalent to QGIS Raster Calculator's “file1.asc” AND “file2.asc”

I would like to script a calculation equivalent to QGIS Raster Calculator's "file1.asc" AND "file2.asc". I have 18 data raster files which I would like to do the equivalent of ADD to each of five ...
2
votes
1answer
32 views

if __name__==“main”: in standalone Python script for QGIS

I am working on a standalone Python script for loading shapefile layers into an application window with my central widget being canvas. The previous code I had written is almost identical to the code ...
0
votes
0answers
16 views

Can a QGIS model be executed as part of a script?

Can a QGIS model be executed as part of a script? e.g. PowerShell script copies over source data using FTP, then runs the QGIS model, and finally emails success/fail of the process
1
vote
0answers
55 views

Can QGIS do automated spatial ETL? [closed]

Can QGIS do automated spatial ETL? ... especially the automated point I'm aware of tools like FME, Talend, etc. but price is a concern, so I'm looking for FOSS alternatives that provide spatial ETL ...
3
votes
2answers
216 views

Automatic selection of pixels, from a raster series, greater than minimum image of the series

Given a series of rasters, and the raster image of the minimum values of the series, I am looking for a python script capable of selecting, for each raster, the pixels whose values are greater than ...
1
vote
0answers
59 views

How to create a script using wgrib2 command

I have several model data with the following format postwrf_d01_YYYYMMDD_INIT_f00000.gr2 where INIT = 0000, 0600, 1200, 1800, each consisting of up to several hours of forecast (f00000 to let's say ...
1
vote
1answer
30 views

Splitting shapefile into features and keeping attributes

I want to split a shapefile so each feature becomes its own shapefile. The below works: with arcpy.da.SearchCursor(catch10, ["FID", "SHAPE@"]) as cursor: for row in cursor: out_name = ...
2
votes
1answer
38 views

QGIS Python variable not updating after new features are inserted

I have the following script that sets the a feature id automatically after a new feature is digitized. I added the function inside the project's Macro section inside openProject() function: The ...
3
votes
1answer
33 views

QGIS python getting number of new features to be stored in layers

I mean, how could I get the number of features that have been created in a given layer and that are pending to be saved in the layer when "Toggle editing" or "Saving layer edits"?
2
votes
1answer
40 views

QGIS Error while executing Python function in openProject() Macro: “QgsMapLayerRegistry is not defined”

I have the following script that sets the a feature id automatically after a new feature is digitized. I want the following function to be executed automatically when project is opened (and layers ...
1
vote
1answer
57 views

Use Only First “x” Characters from Table in qgis:selectbyexpression

I have a list of street names in this format: STRNAME Elsinore Neil Young Penny Fall And a shapefile ("input_streets") with street names in this format: STREET Elsinore Av Neil Young St Penny Lane ...
1
vote
0answers
11 views

Create a script/tool to run Crystal Reports after a Geoprocessing step? [closed]

We currently provide Crystal reports to our clients that order data requests. I have automated some of the process, but is there a way to incorporate a script/tool/model that would then take my ...
1
vote
1answer
49 views

refresh programmatically created composer

I am trying to create a composer using pyqgis. Everything works as expected. The only difference compared to the manual creation of a composer is, that I am not able to update the layers (by pressing "...
4
votes
1answer
103 views

QGIS script to calculate stats for a single band raster

Can anyone help me to write a script code, in QGIS script editor, for calculating the main stats (minimum, maximum, mean, median, standard deviation,....) for a single band raster? Actually I am ...
1
vote
1answer
45 views

QGIS Script Editor to get operations between raster and float number

I am looking for developing python codes mainly for working with raster data, in particular satellite imagery from Landsat. I need to write a script (into the QGIS Script Editor) to make operations ...
0
votes
1answer
86 views

Save raster layers in a python script

Is there a way to loop through every selected layer in qgis and save it as a .tif file with the same layer name using a python script? This is the code I am using, but it does nothing at all. It runs ...
1
vote
0answers
16 views

GRASS 7.0.3 - Script to automate multiple simulations?

I am working in GRASS 7.0.3 and want to conduct a complex analysis of Least-Cost Paths of the many-to-many type. Specifically, I do have my elevation raster (ASTER DEM) and point data of 300 random ...
2
votes
1answer
46 views

Using Shortcut for QGIS Processing Script

I grabbed code from here to assign shortcuts for quickly changing to preset scales. When I did it for one shortcut, it was working - but then, when applying several ones it didn't anymore - though ...
1
vote
1answer
74 views

Load multiple files from folder for further processing

I'm working on a processing model and I'm looking for a possibility to load multiple shape-files from an Input-folder for further processing (first clip them all to a certain extend, then assign them ...
3
votes
1answer
140 views

Script to save lots of shapefiles into different CRS in QGIS

I have a lot of shapefiles that I need to save in a different CRS... is it possible to automate this process with a script in QGIS?
2
votes
0answers
28 views

In QGIS 2.12 processing R scripts fails (plots remain blank) due to a wrong variable name - Is there a workaround?

I am trying to execute r scripts in 2.12. All of them fail. Plots remain blank. It seems that the variable "Layer[[Field]]" returns NULL: E.g: hist(Layer[[Field]],main=paste("Histogram of",...
4
votes
1answer
159 views

Automating QGIS project composer printing?

I have a large project which consists of around 10x QGIS project files. Each project contains a print composer with an atlas set up to generate up to 10 maps. What is the easiest way to automate the ...
1
vote
1answer
60 views

QGIS Processing Script will not Validate

I am writing a script for QGIS that will identify the perimeter of only external facing walls. The script is probably a little long to post directly into this post, but it is accessible here. The ...
2
votes
1answer
122 views

Capturing Output Messages from GRASS when Running Python Scripts

Thanks to the excellent documentation here: https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_7 I've figured out how to access GRASS modules in ...
3
votes
1answer
179 views

Running ArcView Avenue scripting files in ArcGIS?

Is there any way possible to run ArcView 3.3 Avenue Scripting files (.ave and .avx files) into the newer versions of ArcGIS 10.x? I am aware about the fact that ESRI has stopped supporting its ...
1
vote
1answer
40 views

Set a Vector input as a variable in QGIS Tool Script

In a QGIS script, how do you set a Vector input (via your tool's GUI) as a variable which can then be used in subsequent processing in your tool's script? I know how to set a map Layer as a variable, ...
2
votes
2answers
177 views

Dissolve line segments in QGIS if they touch and fall within the same class. (tools or script?)

I have line segments that have the following 3 attributes (Class, start_point, end_point). I would like to merge/dissolve line segments that fall within the same class if they intersect (touch). i.e. ...
2
votes
2answers
50 views

Moving Point Features (within a Polygon) to the Edge of those Polygon Features

I have a bit of a complex task, and was wondering if anybody has knowledge that could assist me. Data: Water utility data that is not connected through a geometric network. Data includes Parcel (...
1
vote
0answers
50 views

Implementing Python script in QGIS with input variables?

I would like to implement this script in QGIS: How to draw perpendicular lines in QGIS? and be able to choose input data from the layers in my map, and iterate over them. The script from the link ...
0
votes
1answer
45 views

Count Number of Unique 2-Field Combinations in QGIS Table

I have a table where properties are identified by their PID. A property can have multiple civic address points (e.g. larger buildings), but even when they do they still tend to border on only one ...
2
votes
1answer
104 views

Proper Use of QGIS tool: “Frequency analysis”

Trying to use the "Frequency analysis" tool in a script but getting errors. The Online documentations for this tool: processing.runalg('qgis:frequencyanalysis', input, fields, output) My Script: ...
5
votes
1answer
117 views

Create a temporary intermediate layer in a processing script

My algorithm needs a temporary layer in a QGIS processing script. I can use regular pyqgis api to create a temporary layer but want to know if there is a preferred and processing-specific way of doing ...
0
votes
0answers
54 views

Collector Python data editing

So just to start off with... I have a horrible rudimentary level of Python, so if someone plans on dropping code as an example, I will definitely have trouble following it. Apologizes abound... I do ...
0
votes
0answers
84 views

QGIS 2.8/.10/…crashes when I run, into PyQGis Console, a script within “exit command” of any GUI designed with the same pyQgis script code…Why?

I use QGis 2.8 or 2.10. I open Console PyQGis, so I can write Python specific code that I can design any GUI, as a simple Window Form. After I wrote this code I run this script created and it's ok ...
2
votes
1answer
65 views

How to write QGIS script to load Output file to Map Project with Desired Name?

Good news: the following line of code does produce the output as a shapefile with the name I want ("MyFile") and where I want it ("path"), path = "/Users/User1/Desktop/" processing.runandload('qgis:...
2
votes
1answer
84 views

Scripting with “self” in QGIS

What is "self" and how can I use it error-free in a Q script? Example: mc = self.iface.mapCanvas() But when I try to run this in the Console I get the following error: NameError: name 'self' is ...
1
vote
1answer
29 views

How to Make Scripted Tools Load Output File Automatically into QGIS Project?

When writing your own scripts, and using some of the pre-fab tools how do you make the output load automatically into your QGIS project? Example: In the Help Tab of the QGIS tool "...
1
vote
1answer
62 views

What are the 'output_layer' Parameter Options for QGIS tool “saveselectedfeatures”?

After a few comments and my own consideration I've completely Edited the content (and title) of this post. QUESTION What are valid "output_layer" parameter options when scripting with the "...
0
votes
1answer
36 views

How to Correctly fill in Parameters of QGIS Toolbox Tool “selectbyexpression”

I'm trying to use the tool "qgis:selectbyexpression" in one of my own scripts. But it doesn't work. My question is simple: "Why?" :) My hunch is with the 2nd parameter, the 'expression' (see "HOW ...
2
votes
1answer
83 views

Setting Instance of MULTIPLE LAYERS using “mapLayersByName” in QGIS Python Scripting?

I'm currently using "mapLayersByName" successfully to set one active layer at a time as follows... vl = QgsMapLayerRegistry.instance().mapLayersByName('My_Layer')[0] iface.setActiveLayer(vl) Can ...
0
votes
1answer
54 views

Copying Multiple Selections (by Attribute) to One Output Shapefile using QGIS Python scripting?

INTRODUCTION The code below makes a selection and then saves to an 'Output' file (shapefile?) each time through the "FINAL ITERATION LOOP". Each 'Output' file will contain all selected civic address ...
5
votes
1answer
120 views

Understanding background to Single Hash (#) Vs. Double (##) in QGIS Python Scripting?

First of all I understand the double hash (##) is used to define the Inputs / Outputs in a script's GUI. If there's more to it than that please let me know. In all other Python coding I've done ...
4
votes
2answers
254 views

Iterate an intersect between polylines and polygons in QGIS using Python script

I have a shapefile made up of 127 separate polygons that represent different districts. Overlaid on this layer is a polyline layer of 2800 streets, some which are completely bound by the polygons and ...
1
vote
2answers
74 views

How do I export data to a new table?

This is my script and I need to create a new attribute table which contain the information on the print line. Could someone help me? import arcpy from arcpy import env import datetime env.workspace= ...
1
vote
2answers
129 views

QGIS Tool Scripting Help with “Select by attribute”

** I've gone back and edited (shortened and focused) my own question QUESTION: Why am I getting the error message "The following layers were not correctly generated: Output", when writing a script ...
1
vote
1answer
77 views

qgis-processing: how to specify optional outputs?

Suppose a script has a variable number of outputs, which may or may not be produced depending on settings: ##Input_layer=vector ##Output_1=output vector ##Produce_output_2=boolean ##Output_2=output ...
3
votes
0answers
69 views

Possible to create AutoCAD-like grading lines in ArcMap?

I often need to show grading for roads and ditches. This is what the map readers require and what the standard symbology for grading is. These 3D lines can be easily created in AutoCAD civil 3d and ...
0
votes
1answer
67 views

Creating a Python Script [duplicate]

Is there any information out there on how to start creating scripts using Python and QGIS 2.10? I only have a little coding experience and an very unsure of how to start. My first script would ...
-3
votes
1answer
84 views

How to write a script that will merge shapefiles? [duplicate]

We use an application called IntraMaps Roam. Our guys go out in the field, mark up their maps with GPS points, and then bring them back to the office. They will copy their shape files to the server ...
2
votes
0answers
227 views

GeoServer 2.7.1 fails to start after installing 11-Aug-2015 scripting extension

This problem does not appear to be version specific for me. I have tried this several times with different versions and different system configurations. As the title states, when I add the script ...