A python API created by ESRI to perform geoprocessing and layer management.

learn more… | top users | synonyms

2
votes
3answers
113 views

SearchCursor() fails to read feature class

First of all, I would like to apologize if this problem is trivial for you guys since I am very new to ArcPy and Python in general. I want write a script to read attribute table from a feature class ...
11
votes
1answer
314 views

Teaching Python to Land Surveyors

Does anyone have any good examples of using Python to automate or simplify common surveying tasks? I'm teaching a Python/ArcPy lab this week for a GIS class. There are a number of surveying ...
11
votes
0answers
203 views

How can I utilize NumPy arrays to optimize big data geoprocessing?

I'm interested in learning how to utilize NumPy arrays to optimize geoprocessing. Much of my work involves "big data", where geoprocessing often takes days to accomplish certain tasks. Needless to ...
-1
votes
1answer
95 views

How to write Process Dialog log information to a text file in ArcGIS?

I have created a custom model. When this model is run, it shows a process dialog which has some log information. I want to write that log information into the text file for further analysis. Does ...
4
votes
1answer
38 views

Arcpy error message: 'Layer' object is not subscriptable?

What the code does successfully so far, is gets a list of the layers in the first data frame of the current map. What it doesn't succeed in doing is, joining the layer names to the gdb location using ...
2
votes
1answer
61 views

Calculate field result is float with Arc tool, integer with arcpy script

I am trying to calculate a field for some points within a python script using arcpy functions. (This is calculating the percentage visibility from a cumulative viewshed, if that matters.) # Process: ...
0
votes
0answers
38 views

Why does Clip analysis generate (some) empty output?

I am running a script that is working (see below) - it pulls a file from a folder, clips from that file based on an intersection with another file, and creates a new shapefile in a new folder. It has ...
3
votes
0answers
96 views

Python Script Crashing Inconsistently on Arcpy Batch LayerToKML script

I put together a script to take a TIGER shapefile of all census tracts in a state, select the census tracts by each county, and export them into individual county-level kml files. The problem is that ...
1
vote
1answer
71 views

Database Connections folder is empty when viewed with ArcGIS tool

I'm trying to create an ArcGIS tool which accepts an SDE connection file as an input. I made a new interface with an input parameter and set the type to Database Connections. When I open the tool and ...
2
votes
2answers
186 views

Why can't I import arcpy?

>>> import arcpy Traceback (most recent call last): File "<interactive input>", line 1, in <module> File "C:\Python27\lib\arcpy\__init__.py", line 21, in <module> ...
0
votes
0answers
33 views

How can I use NZLoad using python or arcpy script?

I have CSV file which has millions of feature class record merged with some metadata information which I want to load into Netezza database. I have tried it using insert query but it is very very ...
1
vote
0answers
74 views

arcpy ArcGIS Server

Could someone please help me by giving me an example on how to make/connect/Add ArcGIS Server connection via python/arcpy? Thank you in advance. I'm using ArcMap 10.0 I desire to "Use GIS Services" ...
4
votes
2answers
101 views

Python Script to convert a mass of KMLs to a single fGDB

I have a mass of KML files, approx 350+ that I need in a single fGDB. I lifted a string of code from ESRI help to attempt to do this - I got it working to the point of creating all the individual ...
1
vote
1answer
86 views

Cast arcpy result as an integer instead (arcpy.GetCount_management)

I am trying to get a number by counting how many points are in a shapefile. And this works (I think), except I then am running into trouble using that number somewhere else. Eventually, I'll be using ...
0
votes
1answer
35 views

SpatialJoin with “closest” option ok in python script but not when in arcmap toolbox

I have the following problem. I want to create a toolbox to obtain the distance between a polygon (Bldg.shp) and a point (pts.shp). I have started with a simple following python script: import arcpy ...
1
vote
3answers
98 views

How to create a spatial reference file

I am using python, arctoolbox and arcpy 10.0 I am running a script that is tied to an arctoolbox. The toolbox serves to enter in my parameters. I have a feature layer as an input. The feature layer ...
0
votes
0answers
55 views

arcpy Add Feature Class to Terrain error. LiDAR Processing Script

So here's another one for you ever so helpful StackExchangers (is that right?) Anyway, I'm writing a script to convert lidar data (in .las format) into a terrain without going through all the ...
0
votes
0answers
57 views

Connect script with a sub-menu entry within Python-Addin

I have created a menu entry using "pythonaddins" and it contains 2 sub-menus. Two separate scripts have to be linked to the sub-menus which should be invoked one-by-one when I click on sub-menu entry. ...
0
votes
2answers
121 views

Execute multiple process in parallel of Arcpy script

i have seen some not easy ways to do parallel processing, but i wonder if it is possible to simply execute multiple process of the same Arcpy script in the same time. the script make some changes in ...
5
votes
2answers
105 views

ArcMap Arcpy scripts: How to handle user password input?

I'm currently trying to write a script that has a username & password input which then returns some data if the user has appropriate access. The script works just fine when I hardcode my own ...
8
votes
1answer
214 views

Fastest methods for modifying attribute tables with Python?

A while ago, I wrote a quick Python function for converting an attribute table to a python dictionary, where the key is taken from a user-specified unique ID field (typically the OID field). ...
3
votes
1answer
91 views

Has anybody used arcpy.mapping.ExportReport successfully on 64bit machine?

The online help for arcpy.mapping.ExportReport says that it has some restrictions on use but does not list 64bit machines amongst them. I am running the following test from IDLE under ArcGIS 10.1 SP1 ...
3
votes
1answer
184 views

How to merge many shapefiles in different folders?

Directory structure is basically as such: county\City\prep\POI\Completed\C1, ...C2, ...etc\ I'm trying to write a script to go through the *\Completed*\POIS.shp and merge them all together, at a ...
1
vote
1answer
38 views

Filter ArcSDE layers of the TOC into a combobox

I've a list of layers of the current workspace in a combobox, but I want to list only the layers of the ArcSDE Connection, not the others I've in the TOC. How can I filter the name of this layers?
0
votes
1answer
110 views

Help with Python Update Cursor syntax

I'm having trouble running a loop to update the values in a particular field in attribute table by reading from a csv file. Any input is greatly appreciated. The following is the sample code: import ...
0
votes
1answer
62 views

Feature Layer Selections

I'm new to arcgis and arcpy, so some of my lingo and terminology may be off. I have a script that takes a feature layer as an ainput. From there I want to be able to count the number of selections in ...
5
votes
2answers
85 views

Is there a way to increase the search radius of nearest neighbors for the Nibble tool?

I am working with a raster map vegetation types. I have about 20 types with unique raster code values that can be sorted into three classes: 1 - vegetation types I want to expand using the nibble ...
0
votes
3answers
34 views

Using Sort_Management for multiple tables

I like to convert tables (100+) living in access database to a geodatabase tables, sorting them and deleting unnecessary fields in each table at the same time. I figured I use the Sort_management ...
1
vote
1answer
165 views

add attributes to newly created shapefile from existing shapefile using arcpy

I have created a new shapefile and want to add shape attribute from another existing shapefile. It will be a recursive process with update of shape attributes of new shapefile (ofc) more than 2 times. ...
0
votes
0answers
35 views

Dialogue/popup box in arctoolbox [duplicate]

I am using arcpy 10.0, python and arctoolbox. I was wondering if it is possible to have a dialogue box pop up within arctool box. I am familiar with arcpy.AddMessage("Your message here") ...
5
votes
1answer
77 views

problem with “Con” conditional expression

I created a python script where I use Con (Spatial Analyst). Till now I passed the where clause value as value>1000 and it worked fine for me. But recently I found some raster on which Con ...
3
votes
0answers
20 views

arcpy adding time to Raster Mosiac Footprint

I am trying to create a raster mosiac for use in animating data over time. The current workflow is: Create .gdb (arcpy.CreateFileGDB_management) Create Raster Mosaic ...
3
votes
1answer
251 views

ArcGIS 10.1 ERROR 000824: The tool is not licensed in arcpy

I try to run the Zonal Statistic as a Table through arcpy and it gives me: ERROR 000824: The tool is not licensed. Here is the doc for the function: ...
8
votes
2answers
292 views

Why is this simple arcpy script so painfully slow?

I have a simple arcpy script to update a field in a point shapefile with info from the polygon feature that it is within. It takes 9 minutes to do 100 points in arcpy but a spatial join in arcmap is ...
1
vote
1answer
81 views

Arctoolbox and python

I am trying to use arctoolbox and python so that the user can enter in parameters. In my script I have the following lines _StationInterval = arcpy.GetParameterAsText(0) I just want the user to be ...
3
votes
1answer
65 views

How to check if geometry is M aware?

I am trying to determine whether my shape file that I pass is in M-aware (has M value). I keep getting an error Attribute Error: 'Polyline' object has no attribute 'hasM' Not sure what I am doing ...
17
votes
8answers
621 views

What are some resources for learning Python and arcpy?

I would like to learn arcpy, but I do not know quite where to begin. Does anyone have any good advice on where I should start to learn arcpy?
1
vote
0answers
81 views

How to access selected feature attributes using Python Add-in button?

I'm trying to extract the attributes of a selected feature in ArcMap using an add-in button, but I don't know how to refer to this selection in the script. Later I need to copy these attributes into ...
2
votes
2answers
147 views

How to overwrite a Shapefile

I want to be able to overwrite a shapefile if it exists. I think my code needs some tweaking. I am using v10. I am able to delete the actual .shp file but the .dbf, .shx, etc still remain, so if I try ...
2
votes
2answers
42 views

How do I create a network from connected links

I have a bundle of links in 'some' networks. I need to find out which ones are connected to each other i.e. I need to find out which links are not connected to the 'main' network. I have been working ...
4
votes
1answer
130 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 ...
1
vote
1answer
81 views

Using field mappings to remove fields from a merged table

EDIT: Soreted, thanks :-) I'm trying to combine a (large) number of tables into a merged table, keeping only certain fields. I've tried the below, but it still gives all the fields. Any ideas? ...
6
votes
1answer
216 views

Why can't I access a table in a personal geodatabase (.mdb) with arcpy after installing 64-bit geoprocessing?

I wrote and ran a simple script last year - it cycled through some line features, buffered them and then intersected with some other lines - it all worked fine. I'm now trying to tweak the file to ...
3
votes
2answers
84 views

Polyline in shapefile

I'm still pretty new to arcpy and am still learning. I'm working on a script that has a polyline as its input. I'm able to traverse the polyline and get points at certain intervals. These intervals ...
1
vote
0answers
53 views

Is segment of polyline contained in polygon

I am pretty new to arcpy and am slowly learning all its functions. I have a scenario where I am traversing a polyline. I get a start point and an end point on the polyline and form a segment with ...
0
votes
0answers
45 views

Python code help for Program that “Reads a field in Feature class and Compares to PDFs Created from Feature Class” [closed]

I have a code that I found and I want to arrange it to do what I need it to do. I need some help making sure my correections will work. This program I think by what I read is searching through the mxd ...
0
votes
0answers
69 views

Help with Python Script “name 'path' is not defined” Failed to execute [closed]

I need someone to please check my code so I can understand how to fix it. This code is written so that a user can select an mxd, select the feature class of that mxd (to get a field that is filled ...
3
votes
0answers
92 views

Exporting records from an attribute table and placing them in a txt file

I am trying desperately to grab records in a shapefile's attribute table and copy them, with additional formatting to a txt file. Below is the code I have developed thus far: I have used the ...
3
votes
1answer
130 views

Arcpy does not execute “CopyFeatures_Management” to write a featureclass to an ArcSDE database

I have some problems with my Python script. The script gets an JSON with different information about images. The information includes general information about images and also the gps position of ...
2
votes
1answer
75 views

Select and zoom python script

I am attempting to make a simple select and zoom python script for my address points. Currently the script will complete successfully but will not select or zoom to the entered point. I am using two ...

1 2 3 4 5 18