A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

4
votes
1answer
97 views

Deleting geodatabases that are more than one week old?

I am using ArcGIS Desktop 10.0 and Python 2.6.6 and am trying to make an update script to copy the geodatabase to a backup folder with the date as part of the name, got that to work. Then export ...
4
votes
1answer
118 views

add-in to open automatically "data frame properties

How can created an ArcMap Python add-in using ArcGIS 10.1 to open automatically data frame properties And change the background color of another?
4
votes
1answer
484 views

How to extract certain values from a table using the SearchCursor Tool

I am trying to write a python script to extract certain values from a table: the table I am referring to is a big collection of nitrate values for different water depths, which are deposited in the ...
4
votes
1answer
78 views

get count of like features types based on field attributes

I'm trying to create an update cursor which will take the count of the number of like features in a field and then use that number in a random number generator. The field would look something like ...
4
votes
1answer
76 views

Changing default IDE for editing Validation code in ArcToolbox?

Do you know a way that I can change the application that opens the validation scripts in ArcGIS 10.2? At the moment hitting Edit... opens up Notepad, which ain't that friendly an IDE.
4
votes
2answers
191 views

ArcGIS Toolbox, parameters for python script not as positional arguments

I have an ArcGIS Toolbox with a bunch of parameters. A python script is used to perform some raster operations, based on this parameters. I am using Python argparse in the script to get the ...
4
votes
1answer
203 views

ArcPy script with cursors running slow?

I've got 2 polygons layers (no gaps): IDUs and crops. What I want is to identify the 3 largest crops by % area for each IDU. This seems common enough but I couldn't find a way to do it all using ...
4
votes
2answers
373 views

Setting the Centroid of a Set of Polygons

I'm trying to shift a set of rectangle polygons over an area of interest (AOI). I thought it would be as easy as setting the SHAPE@TRUECENTROID of the polygon area of interest to the ...
4
votes
1answer
142 views

end execution of script and send email if schema has changed

I would like to append the data from one feature class to another after confirming that the schemas match in both feature classes. I can append the data from one FC to another by using this simple ...
4
votes
2answers
302 views

How to select parcels in ArcPy situated in a different county than is written in the attribute table?

I have two polygon feature classes: one with parcels, the other one with counties (40 counties) I have to identify the parcels that in the attribute table belong to county 'X', but spatially they ...
4
votes
1answer
993 views

Geographic transformations and arcpy

I have a script that goes through all the rasters in a particular folder and then reprojects it to another coordinate system, using arcpy. My problem is that i keep on getting the following ERROR ...
4
votes
1answer
1k views

Refresh combo box in add-in

I've got an add-in with a combo box and want to refresh the list in the combo box after an event in one of the other tools in the same add-in toolbar. Can I call the combo box somehow to refresh it ...
4
votes
1answer
173 views

How to create list from spatial join table using ArcGIS Desktop and ArcPy?

I have performed a spatial join on some data and now I would like to take that data and create a list. I'm trying to do this dynamically so that it can be easily repeatable via a script or model. I ...
4
votes
2answers
622 views

Randomly select a record to update using arcpy.da.UpdateCursor

This question is related to my question here. What I would like to do is use a cursor with a where clause to select a number of records. For each row, the values in two fields, TYPE_A and TYPE_B ...
4
votes
1answer
224 views

How to select points within polygon constrained by field?

I've created a polygon from a raster dataset: arcpy.RasterToPolygon_conversion(RasterInt, "C:/arc/poly_int.shp", "NO_SIMPLIFY", "Value") The 'value' field has numbers 1-37, which map to the ID ...
4
votes
1answer
180 views

Map automation, create and populate inset maps for densely-labelled areas

I would like to know if it is possible to automate the example in the picture below, unlike the picture below i'm using vector data. I would like for a fixed scale generate map, but when labels are ...
4
votes
1answer
1k views

How to write values from arcpy statistical output to table?

The attached script is my stalled attempt to perform the following workflow: Create a table and create fields Loop through a folder of point shapefiles and perform average nearest neighbor analysis ...
4
votes
2answers
532 views

Getting buffer wizard-like speed in Python (vs using MultipleRingBuffer_analysis)

I've got a script that takes a single input polygon feature, throws 10 buffers around it at tenths of a specified input distance, and then symbolises the output based on an existing layer file. ...
4
votes
1answer
358 views

How to join MySQL data with GIS data using arcpy?

Here is my problem, I have a MySQL database with table in it that has 4 columns: ID, Owner, Address, Legal. And I also have an ArcGIS GDB that has a parcel layer that has in it a PID field. I am ...
4
votes
2answers
1k views

How to draw rectangle to clip layers using python addin in ArcGIS 10.1?

I want to clip rasters in data view using interactive rectangle (to define Area of Interest) and add them to current dataframe. Following is a piece of code which is not returning anything. Any ...
4
votes
2answers
561 views

Keep nonintersecting polygons during clip

I am using ArcMap 10. I have two datasets, one of which consists of many small contiguous polygons, and one which has many small non-contiguous polygons. The first dataset is census blocks, and the ...
4
votes
1answer
2k views

Problem getting the arcpy mapping module to export a layout view map

I'm using the arcpy mapping module to create a series of images and am having trouble exporting a map document to PNG in layout view; I can only get the script to export the data frame view. I've seen ...
4
votes
2answers
790 views

Comparing two shapefiles based on ID and spatial

I have two shapefiles that contain position information for individuals, one is their reported location (line segments) and the other is their high-frequency recorded location (point data); they have ...
4
votes
2answers
1k views

Set Data Driven Scale from Arcpy

Is there a way to set the data driven scale from arcpy? Looking at the documentation for the DataDrivenPages class, it doesn't seem to be accessible from outside of ArcMap. The script I run within the ...
4
votes
2answers
5k views

arcpy.Delete_management not deleting a geodatabase folder

This script runs fine the first time but fails when run the second time. The issue seems to be that the KMLToLayer_conversion statement creates a file geodatabase (no surprise) that subsequently ...
4
votes
1answer
1k views

Exporting and editing annotation feature class using ArcPy?

I would like to convert labels to annotations and make some advanced editing for these labels using ArcPy. How would I do this? I'm using a file geodatabase and ArcMap 10.
4
votes
1answer
347 views

Batch Sum Fields Script using ArcPy?

I have created a python script that batch summarizes all string fields within a fc table based on the concatenation of two fields. The script loops through a list of the fields, however it stops ...
4
votes
1answer
450 views

Controlling time slider using arcpy

I am trying to control the time slider object through my code in the python console. As given in couple of examples, the time property of a data frame could be controlled by Data frame time property. ...
4
votes
4answers
6k views

Automating Select by Location in ArcGIS Desktop?

I have 2 shapefiles (A and B) each with thousands of polygons. I want to select polygons from A which intersect a specific polygon from B, and save the selected polygons from A as a new shapefile. I ...
4
votes
1answer
2k views

Create overlapping polygons from contour lines

Working in ArcGIS 10, I have a set of contour lines representing density of commercial square footage, and I have a set of points representing local maxima for each peak of the dataset. For each ...
4
votes
1answer
7k 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 ...
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 ...
4
votes
1answer
61 views

Error saving object from python script using GetParameterAsText

I have a script that takes in a line, and creates a certain polygon based on this. My code obtaining the input information is as follows: inFC = arcpy.GetParameterAsText(0) hasClearway = ...
4
votes
3answers
68 views

Trying to list datasources in mxds

I've written a tool that prompts the user for a directory path, and optionally a single mxd. It then crawls the directory for mxds (or just the single one) and writes some of the properties of the ...
4
votes
1answer
111 views

Arcpy describe raster colormap

Does anyone know a way to use arcpy.describe to see if there is a colormap on a raster? Can't find anything in the help.
4
votes
2answers
507 views

Can one parameter choice on Python toolbox tool set Display Names of other parameters?

I would like to be able to create a Python toolbox tool (or a Python script tool) where a choice made from the first parameter (Category in the images below) changes the Display Name of other ...
4
votes
1answer
368 views

SQL-query in arcpy - SELECT WHERE feature between two values

I need to select features between two values in python with arcpy. However, whenever I try to run the code below, it returns with error message "An invalid SQL statement was used". whereclause = ...
4
votes
1answer
179 views

Intersecting overlapping polylines using ArcGIS for Desktop?

I have 4 multipart polyline shapefiles (download a sample dataset here). The geometries are identical, except for the length of segments in each shapefile. They represent 4 variables describing an ...
4
votes
1answer
331 views

Can ArcGIS ModelBuilder be exported to Python and run in QGIS?

Is it possible to construct a geoalgorithm on the ArcMap modelbuilder, export this entire algorithm to python syntax (without having ANY knowledge of python) and then import this algorithm to QGIS and ...
4
votes
1answer
413 views

extend line to feature. programatically

Thanks in advance for any help. I'm trying to programmatically extend hundreds of lines (blue in image) to a single polyline feature (red in image). Sometimes the lines intersect each other, but I'd ...
4
votes
1answer
286 views

How to implement multiprocessing with multiple geoprocesses?

I am relatively new to Python and thought I would give a stab at multiprocessing. I have a script that runs well in IDLE or as an ArcMap toolbox script. After perusing these forums and docs.python, I ...
4
votes
1answer
2k views

How to use a feature set as an output parameter in a Python Toolbox?

I'm having trouble setting a "Feature Set" output parameter from a .pyt .. I'm using ArcGIS 10.1 SP1. Here’s a short script that can be invoked either from a classic toolbox (thru the main() ...
4
votes
1answer
622 views

mosaic raster to file geodatabase yields missing raster sections

Since upgrading to ArcGIS 10.1 (SP 1) from 10.0, I've been encountering an issue when running the arcpy.MosaicToNewRaster_management() tool with output to a file geodatabase. I'm principally working ...
4
votes
1answer
783 views

Reset python add-in

I have a toolbar which enables a second and third combobox when a selection is made on the previous. I would like to add a button to 'reset' the toolbar. Basically reload the toolbar to it's original ...
4
votes
1answer
287 views

changing symbology

I have problem with my script. Layers are in one geodatabase, and have names like: orne1942, orne 2003, orne 2009 (the same forpart e.g. orne). Script should changing symbology layers wich have the ...
4
votes
1answer
466 views

Is it possible to run an arcpy execute SQL method without connecting to any database or server?

I want to simply process a layer by writing a tool script in a toolbox without having to connect any database, so I think I may have to set up a workspace environment in ArcMap, but I'm not sure if I ...
4
votes
1answer
3k views

Append, Insert or load Data into geodatabase table field

I am attempting to calculate point stationing (footage) along a pipeline at a set interval via python script, thing is I'm just now learning to code in Python, I come from a VBA programming ...
4
votes
1answer
824 views

python crashes creating many Feature Classes in multiple Feature Datasets

I'm trying to populate a Geodatabase with roundabout 60 Datasets with a new Featureclass for each Dataset. To do this, i wrote a python-standalone-script that loops through these datasets and creates ...
4
votes
1answer
938 views

Python scripts runs from PythonWin but not ArcCatalog (ArcGIS 10)

I add a field to the target FeatureClass it is not present, via arcpy.AddField_management(...). Works fine from PythonWin, but the AddField call fails when the script is run from ArcCatalog. I have ...
4
votes
2answers
1k views

Getting the Field Alias from a layer, from within a Map document

I've got a very simple script, that loops through all the layers in a mxd and loops through the fields, and prints out the Alias Name for the field, but I am having some problems, it seems to be ...