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

learn more… | top users | synonyms (1)

1
vote
0answers
48 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
28 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
36 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
28 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
28 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
1k views

ArcGis Server Java script API error code 500 while using proxy.ashx on one particular server

I am looking for help with using proxy.ashx in Javascript API on one particular server at a client site. We have a GP service that the proxy is used to access (when request is more than 2048 ...
3
votes
2answers
346 views

How to generate Buildings ID numbers inside parcels

In order to decrease manual data entry, I would like to automate a task to generate numbers for all buildings inside a parcel starting with 1. For example, I have 4000 parcels and each parcel has ...
1
vote
1answer
53 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
1answer
204 views

How to clip Census tract shapefiles to the boundaries of City Council shapefiles

Before I ask my question, I want to say upfront that I am woefully inexperienced with coding as well as GIS, which is part of the reason why I'm here. I am currently working on a project where I am ...
1
vote
0answers
10 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
0answers
15 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 ...
1
vote
1answer
36 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
95 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 ...
0
votes
2answers
180 views

Deleting rows on dbf table with python for ModelBuilder?

Being not very familiar with python, and after carrying out unfruitful long researches on internet, I submit to you my problem, hoping favorable reply. I have a DBF table with geochemical data and I ...
2
votes
1answer
118 views

Trying to generate a PDF for each feature in a feature class based on an attribute with Python.

I have a feature class of points that represent storm water inlets. I am trying to automate a process that does the following. finds all of the inlets that have a field called "Marker" populated ...
1
vote
1answer
41 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
85 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 ...
2
votes
1answer
44 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 ...
10
votes
3answers
2k views

Cannot run standalone QGIS script

I've been trying, along with this post, to run a script in OSGeo4w Shell, outside of QGIS. But I get the following error: ImportError: No module named qgis.core I have also read the following ...
1
vote
1answer
72 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
451 views

QGIS Join Attributes by Location not working from Python script

I have a shapefile with points, and a shapefile with polygons. I want to sum the attribute value of all points that are within a certain polygon, and I'd like to do this for each polygon in my ...
1
vote
2answers
73 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= ...
2
votes
1answer
164 views

forLoop & joinField & different names

I have a folder with an output (shapefiles) from an iteration. On this output, I want to perform a join between two attributetables. So far so good. Here comes the tricky part. There are different ...
2
votes
1answer
222 views

Conditional SQL Query

I've been running a code that searches a desired field in a feature class and performs an specified SQL query based on whether the field is string or double. The variables are just temporary fillers ...
5
votes
2answers
497 views

How to select all files in a directory for merging in Processing?

I'm writing a generic script which involves writing shapefiles to a directory which are then merged together. After writing the files out to the Output folder, I'm trying to get the ...
5
votes
1answer
113 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 ...
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 ...
2
votes
1answer
74 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 ...
1
vote
1answer
39 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, ...
3
votes
1answer
135 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
23 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 ...
3
votes
1answer
689 views

How to get the Flow or directional raster map using GRASS?

Aside from using r.fill.dir in GRASS, is this the script to produce the Flow or directional raster map? Is the output for the script the following graphic? ...
3
votes
1answer
134 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 ...
9
votes
3answers
3k views

How to use QGIS Zonal Stats Plugin from Python Console?

I am using the Zonal Stats plugin in QGIS to extract raster statistics from overlaying polygons (I have shapefiles of species distribution and I want to extract environmental data from within each ...
0
votes
1answer
34 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 ...
1
vote
1answer
59 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
109 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 ...
1
vote
0answers
319 views

Extract by mask run time error in VBA

I have the following script language code shown below within a main code just to run the tool of spatial analyst "Extract by mask". Unfortunately, when I run it I get a Run Time Error. I checked file ...
3
votes
1answer
133 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 ...
0
votes
2answers
697 views

How do you project a single pointGeometry object with arcpy?

In an attempt to create a python add-in for ArcMap that will pass x and y coordinates to another application via a mouse click on the map, I have written the following code. I need the output ...
2
votes
1answer
97 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: ...
1
vote
1answer
61 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 ...
2
votes
2answers
168 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. ...
4
votes
2answers
220 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 ...
2
votes
2answers
5k views

How to zoom to the extent of a query result

Does anyone know how to change the extent on the map in function of a query? in legende I have no problem using the function showResults (featureSet) {... but, can not get any display in AMD. Here ...
5
votes
1answer
108 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 ...
4
votes
4answers
4k views

Batch shapefile merge, with adding and calculating field

I have over 60 shapefiles, all in their own folders. I'm looking to add a field titled "Name" and then populate it with the name of the shapefile. I want to be able to do this so that I can then ...
2
votes
2answers
48 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
43 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 ...
2
votes
1answer
1k views

Getting Script Error has occurred in script on this page when running polygon to raster conversion? [closed]

i keep getting the script error problem every time i try using polygon to raster tool in ArcGIS 10.1. Please help me how I can solve this? screenshot embedded