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

learn more… | top users | synonyms (1)

6
votes
1answer
2k views

ArcMap Field Calculator syntax (again)

I'm trying to string together a field calculator script that will populate all the records of a field at once based upon values in a number of fields. I can't even get the first part of the command ...
5
votes
3answers
2k views

Python: Combine multiple Shapefiles

i have got a lot of Point-Shapefiles (r20010101.shp, r20010202.shp, r20020101.shp...). Each of them has the same amount of points at exactly the same location. In a column that is named after the Date ...
4
votes
2answers
492 views

Monthly Average Solar Maps (R.Sun) in Grass

I'm trying to create monthly average maps as described in R.Sun in Grass. I have my DSM. In reading the page on OSGEO it mentions that it is possible without showing how. Ideas? I assume I will need ...
2
votes
1answer
400 views

Scripting in GRASS

Can anyone suggest me web-links to learn scripting in GRASS GIS (its utilities, examples etc.) other than those available in GRASS official Wiki/Sites?
4
votes
0answers
258 views

How to write a script to square polygon corners?

I'm looking for a script that will square the corners of polygons that are near 90 degrees but not exactly. Near could be dealt with via a variable, for example within 5 degrees of 90 (85 - 95 ...
3
votes
1answer
1k views

How do you make a SQL join query for a NULL in a search cursor in ArcPy?

I am trying to learn how to do some error catching/avoiding in ArcPy. Here is a simplified version of what I would like to do. I would like to take some points, and then check to see if there is a ...
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 ...
3
votes
1answer
700 views

How to Solve the error - “Python Plugin is Broken”?

I tried following the steps to build a python plugin for QGIS. (step 3 is where I am stuck at) 1) I used the Plugin Builder plugin to build the initial set of files. I call my plugin ...
5
votes
1answer
722 views

arcpy.mapping.ListLayoutElements() takes longer in a tool than in ArcMap

Has anyone else noticed that accessing elements from arcpy.mapping.ListLayoutElements() through a tool script takes longer than within ArcMap? Whether using a specific name, wildcard or nothing, the ...
1
vote
3answers
4k views

os.sep in python scripting

what is os.sep and when should i use os.sep while scripting for arcgis ? for example in below code i don't understand why should i use os.sep . import arcpy from arcpy import env import os # Set ...
2
votes
2answers
857 views

script to create points in interval 0.125 decimal degree

I have a polygon shapefile. I want to create points at an interval of 0.125 decimal degrees in this polygon. How can I create a script with python in ArcGIS 10 to automate the process of create ...
4
votes
1answer
290 views

ArcPy or FME for adding history to an object?

I have a very specific problem and I'm looking for a solution for it. I need to add some sort of history to an object. The history will be stored like this: begin_date end_date previous_id Suppose ...
1
vote
3answers
701 views

Automating capture of Extent from multiple mxds with multiple dataframes

I want to create a single shape file from multiple mxd's that have multiple frame sets with different extents in them. I have found/started a script to do this (attached) but can't figure out how to ...
8
votes
3answers
2k views

How do I use variables from one Python script in other Python scripts?

I want to set up a single python file containing variables that have the locations of all my data sources. This would then be used by all my other scripts, then as a data source changes, I only have ...
0
votes
1answer
112 views

d.legend script is not working

I'm using the d.legend script in grass but it is not working. I can only show/hide the legend using the 'add legend' option in the Map Display window in GRASS. I need to make d.legend script to work ...
4
votes
3answers
3k 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 ...
4
votes
2answers
255 views

How to select a subset of separate bands in GRASS GIS?

As you know landsat data has separate files for different bands. Creating a subset is a wise option to work on region of our interest. Therefore, I used this method to subset my image - d.zoom || ...
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/
1
vote
1answer
220 views

The resulting maps from a r.mapcalc script is not computed properly

This post is a continuation of my other post Why is my controlling shell script not working?. I created another post because this contains a separate issue that I encountered with the same scripts of ...
1
vote
1answer
327 views

Shell script commands

I have this shell script: #!/bin/sh r.mapcalc water = 120 d.rast water i=1 while [ $i != 100 ] do n=1 while [ $n != 10 ] do r.mapcalc < water.mapcalc d.rast ...
1
vote
1answer
239 views

Why is my controlling shell script not working?

I updated my post after I resolved the previous errors, but additional errors were produced. I want to create a controlling shell script that contains water.mapcalc within it. The problem is, I do ...
2
votes
1answer
2k views

Using python lookup table to compare records with existing geodatabases

I am trying to use python to look through an access table containing facilities that need to have geodatabases with geodatabases that already exist in order to generate a list of facility geodatabases ...
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 ...
4
votes
1answer
318 views

Programmatic Configuration of ArcGIS Server data and layers?

Hey all, I'm trying to figure out how people in the ArcGIS Server world script configurations. In the GeoServer world we have the REST Config API, which lets you configure connections to a database ...
1
vote
1answer
447 views

How to create GRASS scripts in C# in Windows

Most of the tutorials that I have seen are under Python and Linux. Is it Possible to create GRASS scripts in C# or atleast in Windows. I can create scripts using a different language as a compromise ...
0
votes
1answer
120 views

How to create a new table for a vector file?

I will use v.db.connect but i want to use a new table, and not an existing table to connect it to. What is the GRASS script for it? Thanks!
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 ...
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 ...
3
votes
4answers
898 views

Append to text file using ArcGIS and Python

I have wrote a small routine using Python for ArcGIS (9.3) that will get the count of 2 data layers, calc a percentage, and then write the text back to a text file (CSV) to create a sort of "report" ...
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 ...
3
votes
1answer
2k views

Create centreline from a polygon

I am working on a project to create a centerline from a polygon automatically. The user select a polygon and click a button, the centerline will create for him. I have tried the build-in function ...
11
votes
1answer
848 views

How can I display raised error messages to the user in the ArcGIS geoprocessing results window?

Question: Can print statemnts raised from a custom exception be displayed in the gp results window? Background: I modified a script that I found that takes two inputs from a user, finds the ...
4
votes
1answer
861 views

FIELD CALCULATOR VB scripting

In my attribute tables field. I am trying to get rid of the "&" in between names i.e. "John Adams & wife" and want it to say "John Adams and Wife" in all the attributes with "&". What is ...
5
votes
1answer
295 views

Postgres/postgis cursors

I have a road network with StreetName and min/max address ranges for each segment (ie- StreetName = 'Main St', Min = 100, Max = 199). I also have individual address points with similar information ...
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 = ...
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 ...
4
votes
1answer
2k views

How to change a text element's font size using python? (ArcMap 10)

I need my script to change the font size of a text element if the string is too long to fit in the title section of the map. I've looked into it using Arcpy, but haven't had any luck. Does anyone know ...
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 ...
4
votes
2answers
1k views

How does one build a Python script that exports to several output files?

I'm trying to build a Python Script that will receive one feature layer that will be clipped by several adjacent grid squares (each in a different shapefile) and output several shapefiles. Now, I've ...
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 ...
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 ...
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?
18
votes
6answers
4k views

Has anyone found any informative documentation about ESRI's ArcPy Python module?

Has anyone found any informative documentation about ESRI's ArcPy Python module?
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?