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
5k views

How to get the extent of each polygon in a 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 ...
8
votes
4answers
5k views

How to remove a feature layer in an ArcPy Script

So, 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. ...
1
vote
1answer
346 views

Calculating mean upslope aspect

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 ...
6
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 ...
3
votes
5answers
3k 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
137 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
1k 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
174 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
351 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
696 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 ...
7
votes
1answer
410 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 ...
9
votes
7answers
772 views

Are there any “highly customizeable” GIS platforms out there or am I doomed to manual labor?

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
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
970 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 ...
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
172 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, ...
6
votes
1answer
959 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
217 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
361 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
590 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
475 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
186 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
555 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
365 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
237 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
964 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
223 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
327 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 ...