1
vote
1answer
20 views

Using update cursor with list of shapefiles

I'm still pretty new to using cursors. What I'd like to do is create a list of shapefiles. Within those shapefiles I would like to populate a field "NAME" with the shapefile name less the .shp ...
3
votes
2answers
35 views

ArcPy Data Access Insert Cursor not writing geometries to feature class?

I'm running ArcGIS 10.2.1 and am having troubles with the Insert Cursor in the arcpy module. I have an empty feature class in my geodatabase and have created the short script below to try and find the ...
0
votes
1answer
45 views

Splitting the job on Arcpy SearchCursor

I'm running a for loop with a cursor to disaggregate a large feature class into many smaller ones (of one polygon each). ArcMap crashes after about 1100 iterations, and I am trying to break the job ...
1
vote
2answers
75 views

How to copy data from one table to another using cursors?

I'm going to be as descriptive as possible. I have a table (TA) with values which are null for some rows, filled out for others. I have a table (TB) with the null values filled out. Dec in TA is the ...
3
votes
1answer
258 views

Arcpy Update Cursor (arcpy.da.UpdateCursor()) not saving changes to 'SHAPE@LENGTH'

Looked around and found other Cursor questions, but nothing dealing with updating 'SHAPE@LENGTH'. I am running ArcGIS 10.2.1 and have a multipoint shapefile that I am grouping into polygons based on a ...
0
votes
1answer
138 views

Polygon Neighbors Analysis script (ArcPy 10.1) producing erroneous results?

I'm struggling with a python script that is supposed to calculate a field for a polygon feature class. The calculation is of the average of a field value (P_TOT_DEV) for each of a given polygon's ...
0
votes
1answer
31 views

Copying extents between features

I have a Building feature class whose individual building footprint extents I want to match to associated Level feature classes. Unfortunately, the Level data was converted from DWG files with only ...
9
votes
5answers
371 views

How to improve performance when using ArcGIS cursors in Python with big tables?

I have a pretty big point feature class in a file geodatabase (~4 000 000 records). This is a regular grid of points with a 100m resolution. I need to perform a kind of generalization on this layer. ...
1
vote
1answer
256 views

Insert Cursor fails to write results to table

Insert Cursor fails to write results to table. The Search Cursor is returning the results, but errors when trying to insert into field. # Insert Cursor for GDB table to GDB table # Import modules, ...
0
votes
0answers
65 views

arcgisscripting - setValue error

I'm having difficulty isolating this problem - at the point I attempt to alter a record with update cursor, the script returns a 999999 error. I've tried running this script without ArcMap running in ...
2
votes
0answers
85 views

Can I use a cursor to select two rows and compare attributes

Can I use the cursor search function to look at the first two rows in a table and select them so I can compare attributes and possibly merge them or change attributes? I am using ArcGIS 10.0
2
votes
2answers
65 views

How do I skip rows with searchcursor based on an interger value

For example, if I have 100 records, and I want to sample 10% of the records. How do I tell the search cursor in arc10 to read the value of the 9th record, or every 10. I tried to do row[0 + count] and ...
1
vote
3answers
296 views

Does arcpy.SearchCursor function support field indexing?

Does the arcpy.SearchCursor function support field indexing? In the sample script below, can I sent my cursor to loop through the values in the first field by setting an index to search the first ...
2
votes
1answer
237 views

Only perform Near analysis on selected rows

I am writing a Python script to perform a near analysis on features from two different shapefiles with common attributes. This is happening in a Search Cursor. However, whenever I tried to use the ...
1
vote
1answer
178 views

Updating the value of a field with pre-defined values

I am trying change the value of a row for a field whose type is "short" in arcmap using a python script. with arcpy.da.UpdateCursor(FILENAME, FIELD) as cursor: for row in cursor: row = ...
1
vote
1answer
123 views

Stuck updating one field based on the condition of another using Acrpy or Field Calculator

I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with ...
2
votes
1answer
199 views

How to read XY, get raster value and then update field?

I've written a script to run through a point layer, using the SearchCursor in the data access module and then read the XY values. Within the with statement, I then use GetCellValue to get the ...
0
votes
1answer
561 views

How to Export to PDF after zooming to extent of each feature that meets SQL where clause?

I realize that I've asked two similar questions recently, but following suggestions in the comment chain, I'll make this a separate question (separate as it is not the no output problem in ArcPy: ...
4
votes
3answers
400 views

How to create Where Clause from user input via Python list?

I am trying to perform a query based on values in a Python list. The where clause will then be used in an Update Cursor, so that the rows NOT equal to the values in the list will be deleted. This is ...
2
votes
1answer
374 views

How to use ArcPy cursor to define each feature sequentially as current selection of layer?

I want to implement a script that runs through each feature of a feature class, zooms to the extent of the feature, sets the scale to 1:5.000 and adjacent takes a picture of the scene. The steps are ...
14
votes
2answers
2k views

Exporting table to XYZ ASCII file via ArcPy?

I'm looking for a way to export an ArcGIS table (created with the Sample tool) to a text file via ArcPy. I can do this in ArcGIS via the context menu by right-clicking the table, but have not found ...