A site-package created by Esri to expose ArcObjects to Python.

learn more… | top users | synonyms (1)

1
vote
2answers
691 views

How to automate relative filepath when adding a new toolbox to the arcmap catalog?

So I'm creating an arcpy script for a custom toolbox and I want to make it so that a user can essentially utilize the script in that toolbox without having to change the source path (which I made ...
5
votes
2answers
817 views

How to check if domain already exists?

I am trying to check the existence of domains in my file geodatabase which contains 4 domains (automatically populated after I created some annotation feature classes). My code is as follows: import ...
4
votes
2answers
2k views

Check if shapefiles exists in folder

In ArcGIS modelbuilder I want to check if a shapefiles exists, if not I want to create the shapefile in that folder. I guess the calculate value tool within ArcGIS modelbuilder can be used, but I need ...
2
votes
2answers
537 views

How to truncate file geodatabase tables with python?

Everything is in the title. I need to truncate file geodatabase tables (1 or all) with python. What is the code for that? Thank you in advance!
4
votes
3answers
1k views

arcpy join field tool is not licensed

I am using ArcGIS and arcpy to process some shapefiles. When I try to use the function arcpy.JoinField_management() the program stops and Python says that the tool is not licensed. This confuses ...
4
votes
2answers
748 views

How to use Matplotlib in Python 2.6 installed by default ArcGIS 10.0 installation?

I am wondering if anyone has successfully run Matplotlib with the default installation of Python 2.6 that comes Arcgis 10.0. It does not seem to work with the python version installed by Arcgis 10.0. ...
1
vote
1answer
710 views

arcpy: creating polyline features from the following text file format

I am looking into a way of reading the following file format with python, where 0 0, 0 1, 0 2, ect... is the polyline object number and 0(1) 464736.1645 260940. 098377 are x, y coordinates of ...
1
vote
1answer
852 views

ArcGIS Python Script Tool Validation: Control Overwrite Behavior

I'm creating a script tool to read the USGS earthquake GeoRSS feeds. It works fine as a script with hardcoded values. The script also works fine as a tool for creating a new feature class for a given ...
5
votes
2answers
2k views

ArcGIS 10 Python script to search directories and subdirectories for intersects and clip them

I'm trying to develop a tool that queries our company's data stores for any data that intersects a feature. So when we acquire a new property we can run this tool and it will find all of the data we ...
4
votes
2answers
519 views

ArcGIS Spatial Join Options Missing

The ArcGIS SpatialJoin online help page has a long list of match_options when joining data spatially, including HAVE_THEIR_CENTER_IN. However running the arcpy.SpatialJoin_analysis tool in Python ...
4
votes
2answers
2k views

Arcpy Insert Cursor not inserting all rows

Good morning all, I have a script here that takes data from a cross-tabulated non-spatial dataset where monthly values are stored in a single table row for a given year and linearizes those data so ...
5
votes
2answers
689 views

Create a polyline buffer with Arcpy

I'm trying to write a python script with ArcPy that draws arcs and I've achieved something with creating a buffer and then clipping it with a bounding box so I only keep the length I need (I thought ...
10
votes
1answer
3k views

Python Script to Create Table Using Data Driven Pages

I am trying to convert some python script to display a table (based on a dbf) of features located within a specific data driven page. So far, I have the script successfully able to refresh the map to ...
2
votes
2answers
603 views

How do you use folders as input/output parameters

What I want to do is to go into a folder, find a layer file, pull it into an MXD, then export a jpeg in an output folder. Everything is great except I don't know how to set the input/output folders. ...
3
votes
1answer
939 views

How can I create an empty feature class in a file geodatabase based on the schema of an SDE feature class?

I have 150+ feature classes in SDE for which I need to create an empty feature class in a file geodatabase. For these feature classes I need to import the attributes and the name of the feature class ...
4
votes
1answer
965 views

how to turn on labels of a layer file with arcpy

I am unable to turn on the labels with the python script. I am not sure why! Please do not direct me to another post as i have read them all. This is the most recent one i've tried, with obvious ...
5
votes
3answers
1k views

Using arcpy what is the most efficient way of projecting a selection from a large data set?

I have a large data set X(x1-xn) from which I must select consecutively the attributes A(a1-an) from X.fieldsSRC or X.fieldDST and project the selections. I have a functioning arcpy script that does ...
2
votes
1answer
640 views

write multiple statistics analysis into the same output file with arcpy

How can I add multiple stats from the arcpy.Statistics_analysis to a single output file. Can I create a text file instead of a table ? Using one of the examples in help.arcgis, if I add other stat ...
3
votes
1answer
810 views

Select Layer by Location Produces Empty Output in Python

I am new to using Python scripts to execute ArcGIS tools. In my first script I am attempting to loop through many Select Layer by Location operations on overlapping feature classes. I want to create a ...
1
vote
1answer
225 views

ArcPy: Creating weekly-sum layers by summing field values from seven consecutive daily .dbf's

So I have 490 consecutive daily rainfall shapefiles/.dbf files in a single directory. Each consists of a uniform even-spaced grid of 220 points having uniform pointIDs, number of records, field names ...
12
votes
1answer
1k views

How to get size of file geodatabase feature class on disk?

Is there a simple way to determine the amount of hard drive space a feature class takes up? I feel like I'm missing something simple, but I don't recall a method that does so. You would think that ...
1
vote
1answer
1k views

Delete SDE feature class features with ArcPy

I'm working on a script that will empty my SDE database of all data. How would I go about deleting features from feature classes using ArcPy? I have an SDE connection created with a user that should ...
2
votes
2answers
576 views

Zoom to Selected feature, without using 'current' in python

I am wondering if it is possible to build a zoom to geoprocessing service without using 'current' for the mxd variable in pyhton. Using 'current' my tool works in arcmap, but not in my gp service. ...
1
vote
2answers
348 views

ArcGIS Server GP Service: How to create a txt file or rename a dbf to txt in the “%SCRATCHWORKSPACE%”

My end goal is to get an excel (I'll probably just settle for .csv) file loaded from a silverlight app into my "%SCRATCHWORKSPACE%" for my gp service. I will be linear referencing the data onto a ...
5
votes
1answer
615 views

Stop an arcgis model until all values are collected and then continue

This is similar to Modelbuilder - If precondition is false, continue iterating next input but I want the iterate tool to run to collect all the values and only then continue to the merge. Any ideas? ...
1
vote
1answer
91 views

Other than the methods stated on the Desktop 10 Sharing Tools section, are there any other ways to distribute custom toolscripts?

Essentially I want to be able to distribute a custom script and it seems that I cannot create a .tbx file, so I looked into the other methods, but they are all only for Python modules it seems. What I ...
4
votes
2answers
941 views

Dynamically change zoom level of overview map to fit with current extent in DDP

I am using DDP pages in a large mapset with pages ranging from 1:7500 to 1:130,000 and the overview map is zoomed out to far to see some of the smaller zones. Is it possible to set the overview map to ...
2
votes
1answer
249 views

ArcPy / DDP - alter graticule logically in varying map scales

Morning -this question appears on many sites and I was wondering if there was a script that is now available that resolves it? Please also upvote ...
1
vote
1answer
443 views

Generate MXD layer info report

I'd like to generate a report about MXD layers for a handful of MXDs. I want the report to display their name, workspace path and scale range settings. I can get the first two with ArcPy but I didn't ...
3
votes
3answers
3k views

Add feature layer to display with in a script tool for desktop mapping 'App'

The point of this question is to find a way to programatically change the map extent based on user input. My method involves creating a Feature Layer & Selection, but if you have another ...
1
vote
1answer
226 views

Small issue with field calculator

What am I doing wrong in this field calculator logic? Pre-logic def re_score(elev_t,f2, contour): f2=contour if elev_t.endswith('.5'): f2 = "Midi" return f2 Expression for field "Contourtyp" ...
3
votes
2answers
1k views

Python and Data driven pages - Advanced use

I need to make a number of maps where only one input changes (a layer with the range of a radio tower) and I want to add the layer, apply symbology, zoom to it, change the title to include the name of ...
1
vote
2answers
770 views

arcpy.Delete_management not deleting

I'm struggling with deleting an mxd in a for loop. My code is: import arcpy, glob, os, datetime, time from time import strftime for filename3 in glob.glob(os.path.join(folderPath, ...
1
vote
1answer
208 views

Index out of range error when cleaning up variables

I'm running a script that parses points from a flat database structure into individual feature classes with related tables. A search cursor runs through and stores each field's data in a variable ...
4
votes
3answers
839 views

Using threading module with Arcpy: Manager/Worker architecture

I asked this question on Stack Overflow on how to setup a manager/worker scenario. But I am getting some error when trying to use threading on my Python install with ArcGIS 10 (just the python ...
3
votes
1answer
2k views

error on mxd.save/saveACopy

I'm trying to use arcpy to save an .mxd and am having an issue. It doesn't matter if I use mxd.save or mxd.saveACopy I get the same error. I know it doesn't look like I am doing anything w/ it here, ...
4
votes
1answer
862 views

Script tool Value ERROR 000735: Output Layer: Value is required?

I've been struggling to get my script tool to run without receiving the following error: <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid. ERROR 000735: ...
1
vote
1answer
471 views

Creating bulk field aliases for several layers within same ArcSDE feature class using ArcPy? [duplicate]

I have an ArcMap with ~200 layers from the same sde feature class. After I finished adding all the layers it was brought to my attention that we need to add field alaises for the attribute table. ...
2
votes
1answer
314 views

Use arcpy.SearchCursor with raster

How can I efficiently subdivide one raster into multiple rasters using the arcpy.SearchCursor? For example if I have a slope and I was to subdivide into 3 rasters: slope1 with values between 0 and ...
8
votes
2answers
2k views

How to Rotate Features in ArcGIS for Desktop using ArcPy?

I have a series of polygons that I want to rotate. Each polygon has a rotate angle and an anchor point (xy coordinate) stored as field values. As it happens, all anchor points are on a vertex of ...
4
votes
1answer
972 views

Sorting a table on multiple fields using ArcPy

I'm trying to sort a table based on three fields with ArcPy (which should be only one line of code), and I had a "tool is not license" error. I just saw that sorting with multiple fields as parameters ...
3
votes
2answers
2k views

Customizing label features using arcpy

I have a script that creates symbology for a polyline (contours) and then adds it to a .mxd file. My problem is that it picks the “FontName” as the default field to label on the map (see attached ...
1
vote
1answer
131 views

How to select and update from multiple tables?

I have two feature classes which have common Valve ID #s. One table has multiple service connections with a unique number. I need to select all services linked to each valve and collect the ...
2
votes
2answers
1k views

Shape files are not being adding to MXD using arcPy

I want to add a shapefile to an mxd document using arcpy but it generates the following error when used by adding script in arctoolbox import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") ...
1
vote
3answers
2k views

Error when creating insert cursor in arcpy

I've written several scripts that copy data from MS Access db into a new, empty ESRI Geodatabase. I've pretty much copied the code and changed it for each table -- the first two scripts have worked ...
0
votes
1answer
426 views

raster in TOC to geotiff on disk in ArcPy

I am really hoping that someone out there who knows a bit about ArcPy in ArcGIS10 can help me out. I am attempting to automate some work w/ netcdf files. Basically, I am able to automate the creation ...
1
vote
1answer
537 views

Specifying which ArcSDE feature class Geoprocessing Service is to update?

I want to have a geoprocessing service update sde. I am getting an I/O Error saying data doesn't exist. I imagine because the connection file (copied from my ArcCatalog folder) I placed next to the ...
2
votes
2answers
757 views

How can I “select by attributes” based on membership in py dictionary?

I am trying to write a script in arcpy that checks to see if elevation values in a point file are found in a dictionary, and if they are to produce a new point file with just those entries. Sounds ...
1
vote
1answer
895 views

How do I get statistics out of a table using Python in Arc 10?

I am very new to programming (I started learning this semester) and would very much appreciate helop with one piece of a project. I have the following table, and I need to write a script compatible ...
2
votes
2answers
1k views

ArcGIS and Python Issues with Different Versions

As we know, there are few versions of Arcgis (9.x,10) and Python(2.x,3.x) are in use. Issues are facing when we run scripts/toolbox of arcgis since the script written in one version of python and the ...