Python is an open source interpreted programming language used in many GIS programs.

learn more… | top users | synonyms

10
votes
3answers
5k views

How to list feature classes with active “attribute domains”?

I have an Esri file geodatabase with attribute domains defined. I need to delete some of the attribute domains but can't because "The domain is used by an attribute rule.". How might I discover which ...
1
vote
3answers
5k 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
3answers
2k views

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy?

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy? is it possible to use ArcGIS 9.3 Geoprocessor Programming Model within ArcGIS 10?
12
votes
5answers
450 views

Smallest GIS library for embedded devices?

I need to use very simple geometry operations (read SHP or other standard format and simple searches) within an embedded device running a simple linux based os. What is the smallest and simplest API ...
1
vote
1answer
347 views

Opening ArcCatalog to FGDB causes application to fall over

I have some python scripts I have written to create a lot of objects. I write these, in code, to a couple of FGDB's. If I happen to open ArcCatalog in one of these FGDB's, the application falls ...
1
vote
3answers
971 views

Return results to user of python script from ArcToolbox : EDIT 9.3

I have a script in a custom toolbox which sums the values in a given field. After the user indicates which field (currently I have them typing it in but would love to know how to get the ArcToolbox ...
2
votes
2answers
902 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 ...
1
vote
2answers
2k views

GetParameterAsText() error in python script

i have a huge problem with an error . when i use getparameterastext and use it for searchcursor , i encounter to an error .for example the below code import arcpy featureClass = ...
3
votes
3answers
3k views

How do I export attributes with Python scripting in ArcGIS 10?

How do I export an attribute table to dbf or txt format by use of Python in ArcGIS 10?
2
votes
1answer
799 views

Area units for GEOS area property?

I'm working with GeoDjango and have a polygon in the WGS84 projection. I need to find its area in square meters. When I call polygon.area, I get some float out and I have no idea what the units of ...
3
votes
2answers
4k views

Change Symbology of layers from within ArcMap

Cheers, In an active Arc Map session - I want to change the symbology of a layer which is repeated multiple times in the mxd. Can I do this? The basic code I have for getting the layers is below. ...
14
votes
5answers
7k views

What's the easiest way to install GDAL and OGR for Python?

I am developing some code in Python, and I want to use the GDAL/OGR python bindings. What is the minimum I need to install in order to use the GDAL and OGR python bindings? What is the easiest way to ...
2
votes
3answers
1k views

Batch convert ArcGIS 9x files to 10

I would like to convert all mxd's in a directory and it's subdirectories to ArcGIS 10 mxd's. This is so that I can then run python to automate some updates within them. Is this possible? This is my ...
2
votes
1answer
1k views

How do I insert a DATAFRAME_ELEMENT value into a dynamically generated shape file containing its extent?

This is for ArcGIS 10, Python 2.65. I have code which captures the extent of dataframes within all mxd's in a directory. I also want it to add the dataframe name, scale and the name of the mxd it ...
3
votes
2answers
930 views

Fastest way to create an ESRI Grid and populate cell values?

In terms of processing speed what's the fastest way of creating and then adding values to a raster? The values will originally come from ASCII files which can be about 500MB in size - ideally I ...
1
vote
3answers
716 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 ...
11
votes
2answers
177 views

How could I rate roads for scenic drives?

relative GIS newbie here. I've been working on a personal project to rate roads on how nice a ride they'd be on a motorcycle. I wrote a Python program to work through road data in the TIGER dataset ...
0
votes
6answers
3k views

batch buffer with python in arcgis 10

Hi friends: i have some feature class(7 feature classes) and I want to batch buffer in ArcGIS 10 . I don't know how can I buffer at once. Please help me. sincerely
3
votes
1answer
458 views

ArcGIS GeoProcessing Model - Store List of Altered Features in Database

I am trying to build a GeoProcessing model which will find any parcels that have had their geometry values changed and store the corresponding parcel numbers in a separate non-spatial table. I am ...
3
votes
2answers
166 views

How to bring polygons closer to a point?

I have some scattered polygons with a lot of space between them. I want to make a thematic map but all that white space doesn't look very good, so I want to bring the polygons closer to the center of ...
1
vote
1answer
535 views

Win7 GRASS 7 & i.landsat.toar

Hello has anyone got experience running i.landsat.toar ? The output files I get are empty, the command takes but a moment to complete. However when run in verbose mode all the calculations are done, ...
8
votes
6answers
882 views

How do I generate thumbnails images from lots of shapefiles?

A colleague and I recently released an Open Source project called Mapoteca which is a set of Python Scripts that integrates with a GDAL/FWTools installation allowing a full walk-through of directories ...
1
vote
0answers
274 views

getting the correct location data with user input

I have some code others have provided, which I modified in order to run a Python script in a toolbox in ArcMap which accepts user input for a starting point, distance, and angle to create a shapefile ...
10
votes
1answer
1k views

Exit script with Python

I've got a Python script for ArcGIS that I'm working on, and I'd like to have the ability to have the script quit if it doesn't have the necessary data available. I tried a straight up sys.exit() but ...
9
votes
4answers
499 views

ArcView 3.x Avenue Bitmaps (Tabs?) vs. ArcView 10 Python Cursors

Note: While this question has an answer, any further tips for optimizing a cursor process would be greatly appreciated. I will be monitoring for any updates. Currently, my boss (who works in Avenue) ...
2
votes
0answers
580 views

Spatial Analyst Cell Statistics seems to give the wrong answer in ArcGIS 10.0

I have a script that calculates standard deviation for a list of grids using the Cell Statistics function in Spatial Analyst for ArcGIS 10.0 The syntax is this: stdevGrid = ...
4
votes
1answer
5k views

Thiessen Polygon delineation within a Feature

I am trying to create Thiessen (Voronoi) polygons, based on points within a defined shapefile extent. The output should be inclusive to the feature. The output I receive now is the rectangular area ...
3
votes
3answers
2k views

Using Mapscript to create a mapfile from scratch

Following a few online tutorials I have seen, I am trying to create a mapfile from scratch using mapscript. However, when I try to create the layer object, I get an error in the init of mapscript.py; ...
2
votes
4answers
2k views

How can you auto-populate field using spatial location of another feature and its attributes?

I want to auto-populate a field based on the spatial location of another feature's attribute. Add a point on top of a building. The point automatically adds the name of the building. This seems like ...
7
votes
2answers
4k views

Basic Field Calculator Python Question

I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why. I'm trying to create a ...
9
votes
3answers
2k views

ArcGIS Python Tool - Importing Custom Script Into ToolValidator Class

I had posted a question last week about customizing a ToolValidator class and got some very good answers. In working with the proposed solutions, I have created a custom module that performs queries ...
6
votes
2answers
791 views

ArcGIS Python Tool Script Parameter - Binding Objects to a List Parameter

I am working on a python based script/tool. I would like to make use of drop down lists for several of the parameters. This is very easy to do if the lists are just plain old strings. Does anyone ...
3
votes
1answer
692 views

Can ArcGIS Desktop 10 Add-in Use IronPython?

Coming from the same background as the original poster in this thread, I wonder if anyone has had any success creating an Arc10 Add-In using IronPython. I have been able to access ArcObjects via ...
9
votes
5answers
3k views

Compiling Python Scripts that use ArcGIS Geoprocessing Tools?

I've been coding with Python for several months now and have developed some reasonably complex scripts for primarily geoprocessing tasks. That being said, I'm still learning a lot as I'm coming from a ...
4
votes
4answers
645 views

Unable to save selected layer by attribute for ArcGIS Geoprocessing

I am troubles using the SelectLayerByAttribute() function for arcgis geoprocessing. I have a layer and I want to select everything that matches on a particular attribute. I call MakeFeatureLayer() ...
4
votes
1answer
1k views

Processing time using ArcGIS Hydrology toolbox tools in standalone Python script vs. ArcCatalog

My question is: what might cause the ArcGIS 9.3 Hydrology Toolbox Snap Pour Point and Watershed tools to run significantly slower in a Python script versus manually running the tools in ArcCatalog ...
0
votes
1answer
167 views

Accessing smb share on Trimble YUMA with python

I need to write a script that would import a .shp on the YUMA to a gdb on the script/host pc for manipulation with arcpy. I can't seem to find a smb python module. So Im not entirely sure on how to do ...
2
votes
1answer
577 views

Is there a way to set a mask(halo) for labels in a python script?

I currently am writing a python script and using a lot of the arcpy mapping module functionality. I have been using the LabelClass of the arcpy mapping module to automate the display of labels with my ...
8
votes
0answers
373 views

Using a different Python IDE/debugger for ArcGIS [duplicate]

Possible Duplicate: How can I effectively debug arcpy Python scripts? I prefer to use PyScripter over IDLE as my IDE/debugger for writing GP scripts in Python. In ArcGIS, however, when I ...
3
votes
1answer
816 views

Cropping an image with a map extent

I have an raster file in my server space, which has the same projection as my webmap, and I would like to crop the image by passing the visible extent of a webmap. I think the cropping function is ...
2
votes
1answer
845 views

Export from SDE to SHP in ArcGIS 9.3.1 - problem: not exporting all fields

I'm exporting a layer from SDE to SHP by python script, and I'm doing it in 2 phases: the first includes select by location (for picking the relevant features) and the second phase includes the Select ...
27
votes
4answers
4k views

Performance of ArcGISScripting and large spatial data sets

I am currently writing a python script using the arcgisscripting module to process a reasonably large data set (~10,000 records in total) normalised over a small number of tables, 8 in total. The ...
9
votes
6answers
6k views

ArcGIS/ArcPy Python, how to get latitude and longitude of a projected point?

I have a point feature in a feature class that is being accessed by ArcPy. The point is projected but I need to find an efficient means to get the unprojected latitude and longitude for this point. ...
3
votes
2answers
3k views

Can you create labels based on an attribute field in a shapefile with Arcpy?

I was curious if anyone knew how to access the ArcGIS label engine with arcpy? I want to be able to label point features on my map in a python loop.
9
votes
3answers
3k views

Get all vertices of a polygon using OGR and Python

I'm having a little trouble with the Python OGR API. What I am trying to do is get all the coordinates of each vertex of the outer ring of a polygon. This is what I have so far: import osgeo.ogr ...
1
vote
1answer
2k views

ImportError: 'No module named pyproj'

im running mac os X with native python 2.6.1 install . Later today installed GDAL complete pkg, and added the program to the shell path on the terminal with the folowing cmd : ~: echo "export ...
3
votes
3answers
2k views

How to batch clip to single-part shapefile using ArcGIS 9.3 and Python 2.5?

How do I clip a shapefile to a single-part shapefile using ArcGIS 9.3.1 and Python 2.5? Example: I have a set of lines (lines.shp) I am trying to clip to each record in a shapefile called Grids.shp ...
4
votes
3answers
2k views

Python crashes during large cursor process

In a current project, I am attempting to extract several fields for each record of a table in a GDB that has ~8.5 million records. My current strategy is to create a search cursor, fetch the data I ...
4
votes
1answer
824 views

occasionally empty search cursor looping through a raster list with arcpy

I'm looping through a raster list, to export cell counts (from "Count" field in the table) to a text file, I'm only interested in cases where the field "Value" = 1, so I have included this in my ...
8
votes
3answers
3k 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 ...