Tagged Questions

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

learn more… | top users | synonyms (1)

4
votes
0answers
57 views

Using QGIS plugins from Python [duplicate]

Is there a simple way to automate calls to QGIS plugins from a QGIS Python script? Either from console or a plugin? I am ideally looking for a way to specify input/output parameters and bypass GUI. ...
2
votes
1answer
154 views

Embedded python script module import issue

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a ...
2
votes
1answer
38 views

How to Set the width of a dropdown box?

I have created my own script in ArcGIS 10.1 and for one of my parameters I have a drop down list that the user has to select from. The longest entry in that list is only 6 characters, but the width ...
2
votes
1answer
280 views

How can I dynamically trim the informational border off of FAA sectional raster charts?

I'm trying to write a script that can automatically use GDAL to crop the informational border from the FAA's published sectional charts (GeoTIFF) found here: I know that I can use gdal_translate ...
0
votes
1answer
649 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 ...
2
votes
0answers
283 views

QGIS 2.0: Automating tasks, text files and shapefiles

Wondering if it's possible to automate some repetitive tasks in QGIS (2.0). This is my general workflow for importing some xyz type text files from another software package which export (not overly ...
6
votes
2answers
298 views

How to replace a cyrillic symbol in an attribute table using python?

I've tried searching for an answer and I've already seen some similar themes here, but I still haven't been successful in replacing Cyrillic symbols in an attribute table, which is why I'm asking for ...
0
votes
1answer
51 views

How to run only the newly added portion of a python script? [closed]

I was wondering if there is a way to run only the newly added portion of a python script? Usually I add a few lines of codes in the end of my script but I have to run the whole script to reach them ...
2
votes
2answers
166 views

How do I produce map images for Wikipedia?

I would like to make several map images (e.g. SVG or PNG) like those on wikipedia but in not popular projection. I am interested in scripting solution. Here I found this note: Generation Notes perl ...
2
votes
0answers
39 views

Script tool does not create output variable

I have the following problem. I have created a python script, which output should be a list of values (res[i]=*something*). Now I would like to create a script in my toolbox so i could use it from ...
3
votes
1answer
200 views

Looking for help for automatically making a QGIS map

Im looking at making a standalone script, that on execution will run the QGis MapComposer using a previously generated template and output a PDF/PNG of the map. This process of making a map will be ...
2
votes
2answers
806 views

How to programmatically convert arbitrary XML data to shapefile?

EDIT: Based on the answers below I decided to do some programming. I'll be using GEOtools for this, a java lib: http://www.geotools.org/ I have the following XML: <shapes ...
5
votes
2answers
193 views

Field calculator script to work out first 5 dominant area fields?

I have 5 fields of different landcover types with areas of each and found below: > PRC_Water| PRC_Bare| PRC_Urban| PRC_LVeg| PRC_LVeg| > 5 20 40 20 15 I have ...
0
votes
1answer
232 views

How to script map production in GRASS?

I'm trying to automate my production of maps with GRASS. What I want to do can be described in fairly generic terms: I have two layers (one vector, one raster), which will be identical in every map. I ...
3
votes
2answers
397 views

Using ArcScripts

I use ArcGIS 10 I want to use an arcscript to compute an index of ruggedness for each cell of my map. For this purpose, I found, Evan's TRI.aml script here: ...
0
votes
1answer
482 views

How to debug Background Processing Error from ArcPy & Geoprocessing tools?

When I run a script in the background or Toolbox tools I will get a Background Processing Error. The script isn't the issue because it's happened several times today. When it does crash it will ...
0
votes
0answers
168 views

Arcpy - change layer from sde connection to file geodatabase

We are copying data from our corporate office to field offices and we are creating a file geodatabase at these field offices. We are copying the layers that point to sde and they need to point to the ...
1
vote
0answers
199 views

Calculating the closest distance between two points in ArcMap 10.2

I am looking for a script to calculate the closest meter to a set of addresses. I have a feature class of meters and a feature class of addresses. I have populated the address with fields for ...
2
votes
0answers
116 views

How to call ArcPy script from Windows Service? [closed]

I'd like to call arcpy script from Windows Service. Here (Calling arcpy/python from .NET?) I read that I can load python script. What do I need to load arcpy script?
3
votes
2answers
542 views

Script or model to create random points having multiple minimum distances within a polygon

Given: A single part polygon, total number of points to place inside that polygon, and table specifying the size of each subset (number of subsets n >= 1) of that total number of points and each ...
1
vote
1answer
311 views

How to avoid setting env.workspace and other paths/settings all the time

I have some scripts that are constantly setting env.workspace of arcpy. Usually, I have a caller script(script1.py) that may call some other script (script2.py). I've created a file globals.py with ...
1
vote
1answer
181 views

Batch Aggregate Raster using Python

Trying to write a python script to batch Aggregate a bunch of different rasters. get a Parsing Error Syntax error for line 11. # Batch Aggregate raster tool import arcpy from arcpy import env from ...
1
vote
2answers
304 views

Median value for a case within ArcGIS 10.1

Similar to this post (ArcGIS median value from a layer) I am looking for a toolbox to get the median value for a data field by a case. For example, say I have dataset with percent tree cover for each ...
1
vote
0answers
52 views

Is it possible to create a geoprocessing package from a script tool that runs and EXE?

Following the guidelines from the following link, you can create a script tool from an executable . . http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000003t6000000 ...
0
votes
0answers
53 views

Arcpy - loop through subfolders and change mxd settings [duplicate]

I'm trying to run a python script that uses arcpy and os.walk modules. The aim is to find all mxds by specyfying top workspace level only and for the tool to loop through all subdirectories and locate ...
1
vote
1answer
137 views

Improve Python script logic/structure for erasing features with arcpy

EDIT: Too big a question, I think - so, to refine it: Please help me define (and therefore, research/learn how to use) the Pythonic concept for writing a script that can take one input variable, ...
2
votes
1answer
2k views

How do I select by location based on selected features with Python?

Is there a way with Python to do Select by Location with the Use selected feature option? I'm trying to automate a process and am running into barriers. I need to be able to select the 2 lines ...
8
votes
1answer
190 views

Where to find and share Python geoprocessing scripts? [duplicate]

Where are folks storing and sharing their Python geoprocessing scripts? For example, I know that GitHub has some shared scripts. ESRI is phasing-out ArcScripts, which is still really handy, and ...
-1
votes
1answer
64 views

Is it possible to import/run AML script into GRASS?

I have an AML script that has instructions to import tmp files of (grid, network, basin...) is there any way to run the script in GRASS? I tried to converted to Python but I couldn't do it for the ...
3
votes
1answer
353 views

'Pausing' a Python script tool to allow the user to provide input before continuing

I am using ArcGIS. I have written a Python script that creates various surfaces including NDVI. After the script creates those surfaces, I would like the script to stop running while the user ...
0
votes
0answers
92 views

Copy Raster Catalog from .mdb to .gdb, but only within a certain extent with arcpy?

I am stumped again, this website has really helped me before so here is another shot. I am trying to copy a raster catalog from a personal geodatabase to a newly created file geodatabase but only ...
2
votes
1answer
930 views

Incremental “auto save” in ArcMap edit session

Is there any way to add automatic incremental saving to ArcMap 10.1 editing sessions? I found this script for 9.x but it doesn't seem to work with the newer versions. I'm looking for a script or add ...
2
votes
1answer
231 views

how to loop grass command in python and put variable in output file

first day Grass programming with python scripting; first prob; simple I want to reclass the same raster several times; and save the file with the value loop variable at the end ... can not get it ...
6
votes
4answers
1k views

How to check via Arcpy if ArcMap is currently in an edit session or not?

I've created a Python add-in button that helps speed up my coworkers workflow by copying one feature class attribute to another. It uses the arcpy.UpdateCursor function to update a row in the target ...
1
vote
0answers
151 views

Change ArcGIS License using Script [duplicate]

I am using ArcGIS Desktop 10 and we have three different servers for accessing concurrent use licenses of ArcView, ArcEditor and ArcInfo. So, whenever I need to switch to other product, I have close ...
2
votes
1answer
215 views

Generate unique ID upon creating a feature?

Looking for a way to generate a unique Global ID within a feature set when a new feature is created. For example, every time a sewer manhole is added, we need to generate a new unique Global ID that ...
0
votes
1answer
289 views

Running a script with QgsFeature from within the console

I am trying to run a script from the QGis Python console (similar to: http://spatialgalaxy.net/2012/01/27/qgis-running-scripts-in-the-python-console/) The line feat=QgsFeature() operates fine from ...
0
votes
1answer
153 views

How to add layer in Arcscene using script tool

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(r"F:\project\Final\Ground floor\steps.lyr") ...
12
votes
2answers
375 views

Measuring Script Writing Competency

I've been asked by my manager to come up with some sort of competency measure for an employees understanding of scripting/programming. Because I am a self taught programmer, I really don't have a ...
1
vote
1answer
276 views

Does Identify tool of ArcGIS for Desktop have Python script behind it?

Can anyone let me know the Python script for "Identify" tool in arcmap10. I need to create a customized script tool for that and add in a toolbar.. Pls help...
2
votes
0answers
48 views

Difficulty in running the script

I have developed a script tool for adding a layer in the current map document. It did not work.. The message is "Completed script addlayer...". But there were no layers added in the TOC. Another issue ...
1
vote
1answer
123 views

Adding parameters to a category in a script tool

There is plenty of documentation on how to add parameters to a category in a python toolbox, (See the bottom of ...
4
votes
1answer
735 views

What causes ModelBuilder error occurred in script on this page MdDlgContent.htm?

I've been creating a model in Arc 10.0 for a few days now without problems. Then I added the Calculate Field Tool. I selected Make Variable --> From Parameter --> Expression. When I check off "Model ...
4
votes
2answers
1k views

ArcGIS script tool: Can you have an input parameter set to optional and have the tool work when an input is not provided?

I'm building a script tool that processes shapefiles ( GPS data collected on weekly basis). The tool is set up to take an input for each shapefile ( in this case Sewer, Storm, Sign). On some days, ...
2
votes
1answer
171 views

Select and zoom python script

I am attempting to make a simple select and zoom python script for my address points. Currently the script will complete successfully but will not select or zoom to the entered point. I am using two ...
2
votes
1answer
512 views

Calculating mean upslope aspect from each cell in DEM using Python?

I am trying to write a python script to calculate the mean aspect upslope from each cell in a DEM. I have the general workflow down, but my final output is restricted to angles between 0 and 90 ...
3
votes
5answers
5k views

Renaming a field using arcpy

What I need to do: rename a field name of a table/feature class copy all values to the new field So far I have done following code as artwork21 suggests: EDIT: import sys import traceback import ...
2
votes
1answer
243 views

Difficulty converting standalone script to ArcGIS tool

As my title says, I am currently trying to make my (working) standalone script into an ArcGIS tool so I'm not the only person in my office that can use it. It essentially selects all the data within ...
4
votes
2answers
492 views

ArcGIS Conflation Tool Recommendation or Custom Script for Comparing Points

Can anyone recommend conflation tools for ArcGIS Desktop (10 or 10.1, paid or free) or a scripting outline / procedure (or just a script) to have a technician efficiently process the following rules? ...
3
votes
1answer
175 views

Beginning Arcpy: Asking for a quick review of my script

I cobbled this code together from ESRI documentation and stackexchange answers. I tried to use SearchCursor(points, fields=fieldname) but I get this error: TypeError: SearchCursor() got an ...