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

learn more… | top users | synonyms (1)

12
votes
5answers
6k views

Obtaining extent of each polygon in shapefile?

In arcgis 10 and python I want to get the extent (xmax, ymax, xmin, ymin) info of each of the polygons in a shape file. I can get the extent of the whole shape file using ...
43
votes
10answers
3k views

Alternatives to using Arcpy

I seem to use ESRI's Arcpy site package for virtually all of my python geoprocessing. To ESRI's credit, these are an incredible suite of tools that can help accomplish a great deal. However, I would ...
3
votes
5answers
4k 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 ...
8
votes
5answers
6k views

Remove feature layer using ArcPy script?

I have an ArcPy based script where I'm trying to intersect two layers where one layer must have its centroid in the other layer. Since I need to know that one layer (feature_layer below) includes ...
6
votes
1answer
2k views

How to write standalone Python scripts using QGIS?

I've been learning how to use the Python Console in QGIS using references from qgisworkshop.org. I'm familiar with writing standalone scripts in ArcGIS and want to learn how to do the same with QGIS. ...
2
votes
1answer
425 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 ...
12
votes
6answers
5k views

Bulk field rename in file geodatabase

I have a file geodatabase with several hundred feature classes in it. Some feature classes have a field that got named incorrectly, and it got named "SCHEMA_FEATURECLASS_ENTITY" instead of just ...
7
votes
2answers
2k views

How to create a checkbox parameter in a ArcGIS custom Python tool?

I am working on creating an ArcGIS tool from a Python script I am writing. I am wondering if it is possible to have a checkbox parameter. Basically what I want to do is have a parameter where the ...
9
votes
2answers
2k views

Python scripts that run inside ArcMap vs ones that run outside?

I'm just starting to get into Python scripting for work.. I'm currently creating a script to automate a process. Basically, it asks the user the client name, gets a projection if available, creates ...
2
votes
1answer
193 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 ...
5
votes
2answers
2k 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 ...
4
votes
2answers
3k views

Any idea how to resolve “ImportError: No module named arcgisscripting”

I am trying to run a ESRI python script from eclipse and get the following message: "ImportError: No module named arcgisscripting" I can run this in IDLE... any ideas?
3
votes
3answers
195 views

ArcGIS NEAR returns -1

We are running an ArcGIS 10.0 geoprocessing script written in Python that (as part of many steps above & below) runs the NEAR command. Both the input and output datasets (shapefiles & ...
3
votes
1answer
381 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 this the output for the script ...
2
votes
1answer
749 views

Importing QGIS core into Python on OSX

I am interested in learning how to write standalone scripts using QGIS. An answer to my previous question directed me to the PyGIS CookBook which has the following instructions for importing the ...
13
votes
1answer
2k views

How to have a python script self terminate in ArcMap10?

I have tried sys.exit, but it doesn't seem to work in ArcMap. Anyone know how to do it?
9
votes
1answer
3k views

How to export only certain columns to a CSV file in ArcGIS?

I've written a python script using arcpy which outputs a polygon feature class into a File Geodatabase. I have added a function to export the attributes to a separate CSV file. I am using the code ...
8
votes
1answer
179 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 ...
7
votes
1answer
436 views

How to simulate moving vehicles?

I have a point layer (stored in SQL Server 2008) that is being served up by a map service in ArcGIS Server 10.1. I am consuming this service in a web client. Lets say the points are boats out at ...
8
votes
7answers
787 views

Are there any “highly customizable” GIS platforms?

I'm new to this site which I find useful and refreshing until now. And to my question ( WARNING: it's a bit long, so you can skip right to the question two paragraphs down). I was educated in GIS ...
9
votes
2answers
4k views

How to make a button that calls a python script as a command rather than a script tool?(ArcMap 10)

I believe that in Arc9.3, commands could be created using VBA scripts. To add a custom command, you would navigate to Customize > Toolbars > Customize... and click UIControls. However, UIControls is ...
6
votes
2answers
3k views

How to calculate XY coordinates in Decimal Degrees from projected dataset in model or script?

Is it possible to calculate points XY coordinates in Decimal Degrees in model or script when a feature class is in projected coordinate system? It's easy when a FC is in geographic coordinate system: ...
6
votes
3answers
2k views

How to send someone a file of a custom python script with all parameters for the popup interface already defined?

I have a python script in ArcGIS 10 that when clicked, has a popup for a user to choose parameters. I would like to send this file to someone else. While I could send them the python code and have ...
6
votes
1answer
1k views

ArcGIS median value from a layer

I've been hunting around ArcGIS 9.3 and having no success at finding a tool/function that can give me the median (not the mean/avg) tabular value of a spatial database. For example, if I have a data ...
5
votes
1answer
1k views

Working around the raster calculator in ModelBuilder - ArcGIS

I am experiencing a problem with the raster calculator in the Model Builder under ArcMap 10. I need to combine two layers: a drainage map (issued from a series of previous operations on a DEM) and a ...
4
votes
6answers
2k views

script for automated line drawing procedure for set of start and end points

A colleague conducted a field survey and recorded the start and end points of the transects with a GPS. These points have been imported to ArcMap 9.3 as 2 point layers. Both layers have a "transect ...
3
votes
2answers
198 views

ArcGIS Calling Wrong fme.exe When Python Script Converted To An ArcGIS Script Tool

I'm using this this bit of code to execute a FME Workbench file through a Python script ... import os os.system("fme.exe P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw") However, ...
2
votes
1answer
62 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 ...
0
votes
1answer
63 views

QGIS Model Builder Script - Possible to merge layers in a folder?

I would like the user to select a folder via the interface in which all the vector shapefiles inside that folder would be merged. I have been using the Model Builder and looking at example scripts ...
6
votes
1answer
1k views

Setting units in python using ArcGIS 10

I want to calculate the area of each polygon in a shapefile. How do I control what the units of measurement are? def getArea(shapefile): """Print area of polygons""" Rows = ...
5
votes
3answers
221 views

Methods for lat/lon quality control?

I have a database with fields including latitude, longitude, city, state, and country. When mapped, it is clear that a number of the sites are in the wrong location - most commonly because of a sign ...
5
votes
2answers
2k views

(New at Python Scripting) Creating a Loop so i can replace text in page layout in multiple mxds instead of one mxd at a time

I found some code on a website that will perform a search and replace on page layout text elements. Currently you can only do it one MXD at a time. I was hoping to change the code so I can do a search ...
4
votes
2answers
412 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? ...
4
votes
5answers
675 views

Python loop Polygon to raster not working

I want to convert a large number of different shp polygons to raster in ArcGIS 10.1, using an existing field column "class" for the new raster classes. I am not very fluent in python but I thought ...
4
votes
5answers
510 views

Can a new point automatically be populated with data from the containing polygon

I need some help to create a script. Imagine that I'm using 3 shapes: 1 point and 2 polygons. When I create a new point I want it to assume some attributes of the polygons in which that point is ...
4
votes
2answers
2k views

How to install add-ons in GRASS?

How do I install the r.inund.fluv script in GRASS? https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.inund.fluv/
3
votes
1answer
221 views

How to run OSgo4W shell script on Windows?

I have a lot of DEMs that I want to use to create hillshades, slopes and color relief from and would like to automate the processes using a shell script within OSgeo4W shell. Here is the code I used ...
3
votes
3answers
611 views

How to merge a large amount of polygon-features in a script?

We have a very large shapefile with over 30000 features and want to merge it with a script on a server. Currently we try it with QGIS, but the processing takes way too much time. Is there a way to do ...
3
votes
1answer
407 views

Python conditional on current and previous row

I need to calculate a new field with a python conditional where some values only occur if a sequence in a separate attribute field (X) occurs. For instance my data set looks like this. Y is the ...
3
votes
2answers
247 views

Finding script location… dynamically

Should be a simple question... but those can be the hardest. I have created a script that uses ESRI's arcpy site package and it functions properly in a stand-alone environment. I am now trying to ...
2
votes
2answers
1k views

Help with ListFields and CalculateField_management syntax

I need some assistance with the syntax for a CalculateField_management calculation as I have still yet to master all the python syntax rules. What I am trying to do is find the max value in a ...
1
vote
1answer
241 views

Setting Script Tool Parameters Using Python and ArcGIS 9.3.1

Can't quite figure this out and i'm sure it's a simple fix. I have a script that utilizes the AGSSOM tool. It first stops all published services, allows for databases to be tidied up by ...
0
votes
1answer
154 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 ...
0
votes
1answer
359 views

Calculating length with Python and the PYTHON_9.3

(Please critic wholly if possible) If I have polyline data in NAD83 and I want to calculate geometry using the PYTHON_9.3 parameter from the arcgisscripting.create(9.3), I am getting mixed results. If ...