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

learn more… | top users | synonyms (1)

0
votes
1answer
60 views

Converting Raster datasets into layers using ArcPy/ModelBuilder?

I am new to ArcGIS and ArcPy (just started using them on Wednesday). I am using a model to create a Point Density plot from a Shape File, with the output being a Raster dataset. I want to ...
2
votes
4answers
173 views

raster area calculation using python script

Hi I am a beginner to python programming in GIS and am trying to calculate the area of a raster. When I ran the program, I got error message below. I am also providing my code. Any help would be ...
1
vote
1answer
102 views

Writing multiple file geodatabase tables into csv file with arcpy

I was asking a question about Merging geodatabase previously, (link: Merge from arcpy.ListTables() producing duplicate rows?) and although the script worked, it took more than 9 hours to run when ...
2
votes
1answer
230 views

calculating zonal statistics of raster data in multiple overlapping zones and combining them into one table

The aim here is to calculate the max, min, mean, range, sum, count and std of raster data contained in areas delimited by polygons (much like what the Zonal Statistics as a Table tool from Spatial ...
0
votes
1answer
64 views

Creating new layers using ArcPy to define Definition Query for each field value?

I am trying to set multiple definition queries for one layer based on one field using python. ie. I have a City layer with a field that holds the city name. I want a copy of the layer in an MXD ...
0
votes
2answers
20 views

Making fields added to attribute table appear without closing/re-opening? [duplicate]

I'm using ArcPy and am experiencing some troubles. I added some fields to an existing arc (coverage) but then do not appearing in attribute table. Only when i close arcgis and reopen the fields appear ...
4
votes
1answer
105 views

How to cancel tool execution in python

I've written a python function that calls a tool (Import CAD to GDB) in a loop. When I run it I have seen that it hangs sometimes, and I have to force the script to quit. I am wondering if there is a ...
1
vote
0answers
72 views

Debugging ArcPy script to search, get value, compare to field names and sum field values?

`I am looking to do the following task: Look at the values in RegID_6k99 field (numerical field). Select all records where "RegID_6k99 == 0". In this case 6 records should be selected. For each of ...
2
votes
1answer
30 views

ArcPy Empty Buffers

I have written an ArcPy script to process a DTM into a point feature class to be used in Landform classification and ranking. It successfully produces what I need most of the time. Randomly the ...
1
vote
2answers
52 views

What's the best way to get the OBJECTID name?

What's the best way to get the OBJECTID name of a feature class? I know you can use "OID@" in a cursor to get the field, but can you get the name from that as well? I'm writing a script, and need to ...
0
votes
2answers
110 views

How to copy attribute table values from one feature class to another

I am looking for a way to copy attribute values from one attribute table to another. I am mainly looking to do this using python, so would prefer a way to do this with a tool or a a stand-alone python ...
0
votes
1answer
104 views

Arcpy Subtracting rasters error - TypeError: 'unicode' object is not callable

I have a script which subtracts 2 versions of the same raster from each other (one newer than the other) and then extracts the additions & deletions that have happened. I created a simple test ...
-1
votes
3answers
52 views

ArcGIS arcpy code fails in Toolbox mode

This code executes correctly in Python window but fails with ERROR 000732: Input Table: Dataset JHJ does not exist or is not supported # Import ArcPy and other required modules import arcpy ...
1
vote
1answer
92 views

How to get the name of a subtype field in a feature class in Python?

I have a geodatabase with many feature classes. Some of the feature classes have subtype fields. Their names vary feature class by feature class. I now want to find the names of those subtype fields. ...
1
vote
1answer
92 views

ArcGIS 10.1 arcpy Update Cursor is returning a list instead of a row

I keep getting the following error: Traceback (most recent call last): File "R:\GIS_ScriptsandTools\PullHotParametersLabel.py", line 16, in TitleLine = ""+row.getValue(IDfield)+" ("+ ...
0
votes
3answers
50 views

FeatureClassToFeatureClass_conversion in ArcGis 10.1

I have many > 60 .dwg files I want to convert just the polyline parts of these and have put together a list of python commands using excel to get something like this: However when I try running ...
1
vote
2answers
39 views

Filter by quantity / query in ArcGIS

I have some data stored in a CSV file containing name and date ranges. For example: ID | Name | Start | End | X | Y ------------------------------- 1 | Test | 2014 | 2015` | ... | ... | 2 | ...
1
vote
1answer
76 views

Executing tool comes back with an error arcpy.JoinField_management

I have this script snippet, written by Aaron. import arcpy import os #set workspace arcpy.env.workspace = "C:\\Users\\Documents\\Wetland\\New_Folder" #in the folder "New_Folder" is a geodatabase ...
3
votes
1answer
282 views

How to change value of an individual pixel using arcpy?

I want to change the value of an individual pixel in a raster using arcpy. The code I wrote for changing the value is below, but it changes all of pixels in my raster. How can I set an individual ...
2
votes
2answers
66 views

Check if a single feature is completely within another (arcpy)

I have a feature class that contains one polygon feature, and I need to check if said feature lies completely within another polygon feature. Used selectLayerByLocation and then retrieved the count ...
1
vote
1answer
118 views

Iterating over all features in featureclass to intersect them individually with polygon using ArcPy?

I've got a point featureclass, and I'm trying to individually intersect each feature with a polygon featureclass to get some information about which polygon each feature is in. I did one intersect ...
1
vote
1answer
50 views

Intersection of two polyline geometries not returning expected coordinates?

T2B = arcpy.Array([arcpy.Point(1,2),arcpy.Point(-1, -2)]) L2R = arcpy.Array([arcpy.Point(0, 2), arcpy.Point(1, -2)]) L2R_line = arcpy.Polyline(L2R) T2B_line = arcpy.Polyline(T2B) cent = ...
1
vote
1answer
74 views

Python Toolbox (.pyt) Tool Output Layer Name

How can I manipulate the TOC display name of my output parameters when using a Python toolbox (.pyt) Tool class. I tried adding a symbology layer, however this has no affect on the TOC name. Is it ...
0
votes
1answer
40 views

Script never finishes and throws no errors. Creates lock on file until restart?

I have a simple script that gets all layers in a gdb and uses them to clip a DEM. What's happening though is it starts the clipping but never finishes and after killing the process I am unable to ...
4
votes
5answers
364 views

Dissolving polygons fails on computers with small amount of RAM

When I'm trying to dissolve a polygon through an arcpy script the operation fails with the 999999 error on computers with small amount of RAM [~3 GB] (known issue). Unfortunately neither this, that ...
2
votes
1answer
76 views

forLoop & joinField & different names

I have a folder with an output (shapefiles) from an iteration. On this output, I want to perform a join between two attributetables. So far so good. Here comes the tricky part. There are different ...
2
votes
4answers
92 views

How to set a minimum point snap distance?

There are two points: A and B. I need to snap any points within a 65 m search radius (blue buffer) of point A. However, the snap distance of B needs to be exactly 5m apart from A (i.e. located ...
1
vote
2answers
127 views

Error in Select Layer by Location python script?

I keep on getting an error on Select by location that the file cannot be found and the inputs are invalid, but I can't figure out what I'm doing incorrectly. I realize some of my variables ...
2
votes
0answers
18 views

How to add report to layout using Arcpy [duplicate]

I have a script that creates MXDs and layouts dynamically, i need to to add to each data frame in the layout report using arcmap report wizard rather then export to pdf, is it possible ?
1
vote
1answer
43 views

How can I do a definition query on a layer and zoom to it?

I am trying to do definition query to a layer and to zoom to the same layer, but I got an error ("SyntaxError: can't assign to operator") ?? dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # the ...
1
vote
1answer
66 views

Definition Query then Zoom to Layer Automation?

I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step. the concept is like that, a dialog comes up with one form ...
6
votes
5answers
176 views

How to access adjacent rows with cursor?

In the attached screenshot, the attributes contain two field of interest "a" and "b". I want to write a script to access the adjacent rows in order to make some calculations. To access a single row, ...
1
vote
0answers
34 views

Real-time Feature/Geometry Aggregation in Map Service Layer

Use-Case Provide a map service layer that perform a real-time aggregation of geometry objects grouped on a set of criteria from a normalized data source, labeling the resulting image based on data ...
2
votes
2answers
77 views

Call field from zip() into Field Calculator expression ArcGIS

I've been trying to find a way to call in field names from a zip(). Basically I have 12 fields called "Flw_days1", "Flw_days2" etc and corresponding "Depth" fields that need to be calculated using the ...
1
vote
1answer
48 views

how to separate a list of features from its shapefile_

I tried to copy all features in a list of dictionaries. the code looks as follows: def iterate_features(self): feature_set = arcpy.SearchCursor(self.address) for feature in feature_set: ...
1
vote
2answers
200 views

ArcPy setup and operation

I'm looking getting familiar with using ArcPy scripting within ArcMap to automate some common requirements (buffering, etc), however have some queries on how this is all set up. I'm running Arc 10.2 ...
1
vote
1answer
41 views

Select parcels from SDE layer using table list and exporting to shapefiles

Using a table of county fips codes and state name, I need to select from a large parcel layer stored in SDE and export to individual shapefiles based on the fips code and state name from the table. ...
0
votes
2answers
70 views

How to handle list variable in a where clause

I am calling a list of names in from a text file and would like to use each of those to make new layers. I am running into an issue where I get "TypeError: cannot concatenate 'str' and 'list' objects" ...
2
votes
1answer
87 views

How to turn on all fields before appending?

I'm using append on model builder, no test schema type. In order that field will match they need to be at the same order, and visble. How can I turn on all fields of input layer before appending ...
0
votes
1answer
53 views

Understanding arcpy.Describe IOError?

I am trying to find out if an mxd contains any schematic diagram layer through a python script tool. I am looping through all the mxds those are added to the python script tool and in each mxd ...
3
votes
1answer
128 views

How do I change to a Historical version using Python and arcpy

I am having an issue trying to change to a historical version on an SDE feature class using Python and arcpy.ChangeVersion_management. I am able to manually change the version to a specific date and ...
4
votes
2answers
148 views

Using Spatial References with ArcPy after *.prj files no longer installed by ArcGIS 10.1 for Desktop?

I'm writing a python script that uses the CreateFeatureclass_management tool, without a template. One of the required parameters is a spatial reference. I used to be able to point to the system *.prj ...
0
votes
1answer
40 views

Updatecursor returns with 'variable not defined'

I am fighting a bit with the cursor function since this morning. Thanks to the help of the people here and some tutorials I found I got this far import arcpy arcpy.env.workspace = ...
1
vote
1answer
46 views

SearchCursor returns strange value

my searchCursor look like this. arcpy.env.workspace = "C:\\Users\\Documents\\Scoring\\Ecodis_clip_split" #set workspace to folder with values eco = arcpy.SearchCursor ("NAME.shp", "", "", "area_ha", ...
0
votes
3answers
98 views

UpdateCursor 'is not defined' Python

I have several files (shapefiles). Table 1 has only one row with several fields whereas Table 2 has several rows. What I want is to take a value from Table 1 and populate all rows in Table 2. I used a ...
3
votes
1answer
68 views

How do I classify number values in Python to assign it to a group?

I have calculated the number of points that exists for a SqMi area and am trying now to assign it to a certain group based on where it falls in the classification. Does anyone know a tool that I can ...
2
votes
1answer
59 views

What are resources to learn ArcGIS for someone who already knew Python [closed]

I know that there are several resources recommendation questions, however, they are all from GIS people trying to learn Python (for example, here). My situation is the opposite: I have worked ...
0
votes
2answers
69 views

Arcpy: calculating a field based on feature class geometry, eg 'if FC ==“POINT” calculate xy coord

I have a script that populates new fields based on user input. I would like it to also add the XY coordinates in DD if the Feature Class is a point feature, else, it moves on to the next command. I ...
0
votes
1answer
37 views

Adding field to table without path to table (python) [closed]

I want to add a field to my table in the FieldCalculator. import arcpy arcpy.AddField_management("veg8", "test", "TEXT") An error message occured doing this and I figured out that I need to set a ...
1
vote
2answers
50 views

Arcpy text strings as gp expressions

I’m using a while statement to count down from x until it = y. Each loop decreases x by 1. This variable (among other variables) is passed into a geoprocessing tool’s expression variable as a ...