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

learn more… | top users | synonyms (1)

-2
votes
1answer
193 views

How to write Process Dialog log information to 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
104 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
232 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: ...
1
vote
0answers
198 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 ...
2
votes
1answer
398 views

Why might Python Script be 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
178 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 ...
5
votes
3answers
4k 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> ...
1
vote
0answers
174 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
354 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 ...
4
votes
1answer
1k 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
85 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
526 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 ...
1
vote
1answer
228 views

ArcPy error: Add Feature Class to Terrain. [closed]

I'm writing a script to convert lidar data (in .las format) into a terrain without going through all the clicking and so I can send it out to neighboring states with similar programs (I'm using ArcGIS ...
0
votes
2answers
711 views

Execute multiple process in parallel of Arcpy script

I have seen some difficult ways to do parallel processing, but I wonder if it is possible to simply execute multiple process of the same ArcPy script at the same time. My script makes some changes to ...
5
votes
2answers
423 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
461 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). ...
4
votes
1answer
376 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 ...
4
votes
1answer
769 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
93 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
217 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
435 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
202 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
64 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
972 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. ...
5
votes
1answer
504 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
48 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 ...
4
votes
1answer
1k 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: ...
9
votes
2answers
969 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
138 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
170 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 ...
25
votes
9answers
4k views

What are some resources for learning 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?
2
votes
3answers
650 views

Python code : Help with using Search Cursor and Messaging the Total Count of Items from Field in Layer that was Searched

My program works but it is not displaying a message of the total sheet count found in attribute table that the search cursor searched through. For Example: It goes through the mxd chosen by user finds ...
1
vote
0answers
192 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 ...
3
votes
2answers
552 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
94 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
479 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 ...
2
votes
1answer
247 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? ...
7
votes
1answer
1k 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
153 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
96 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 ...
3
votes
1answer
177 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
594 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
154 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 ...
2
votes
0answers
188 views

Can not get text element to update?

I can not get text element to update? Text ELement has been added "Subdivision" Still not updating?.. class ButtonClass2(object): """Implementation for FemaMapper_addin.button (Button)""" def ...
1
vote
2answers
719 views

Select Layer by Location - Arcpy - Why are my inputs being interpreted as invalid?

I am working on a tool in a python toolbox and am totally confused about what is going on and causing my select by location operation to fail (Error 000368). I am trying to select the features in one ...
1
vote
1answer
278 views

How to add a table into the TOC in a Python script?

I recently experienced some troubles in adding a table from a specific folder to the TOC using a Python script. Any idea on how can I solve? Thanks, Annalisa
4
votes
1answer
250 views

Slow performance on splitting a shapefile by attributes

I've tried to develop some workflows with the ArcPy module for splitting a shapefile based on the unique values in a specified field. The code works as expected except one thing I am not able to ...
1
vote
0answers
61 views

Script Tool Problems ArcMap 10.0

I Have a scipt tool that runs when input shape files are added from the table of contents (added from drop down menu.) However this tool will not run when they shape files are added using the add file ...
5
votes
2answers
239 views

Exit Python script in ArcGIS 10.0

I have a script with an bail-out function like so: def die(): from sys import exit exit() Occasionally in the script I check a condition and exit if necessary. This works great in 10.1, ...
1
vote
1answer
625 views

arcpy points in polygon check

I have a list of points and a list of polygons both in a separate shape files. I am trying to write a ArcPy script to loop through the points, and then the polygons respectively and tell me when a ...