Cursors are used by database programmers to process individual rows returned by database system queries.

learn more… | top users | synonyms

6
votes
2answers
212 views

What technology is used behind arcpy cursors?

I'm using ArcGIS Server 10.0. I have a geoprocessing using arcpy search, update and insert cursors. I'd like to know more about the technology behind these cursors. Does it use any driver or pool to ...
1
vote
3answers
328 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
263 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
197 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
48 views

Deleting the cursor object

Can someone explain why you need to delete the cursor objects and the iterator when you use for example: arcpy.UpdateCursor(blah) I've checked the esri docs and there doesn't seem to be an ...
1
vote
1answer
139 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
2answers
482 views

GROUP BY clause in the UpdateCursor arcpy.da

I need to specify a "group by" clause for UpdateCursor arcpy.da. From here I found out that it's possible to do using an optional pair of SQL prefix and postfix. But there are no examples and I'm ...
3
votes
2answers
596 views

Move the cursor backward - opposite of row = rows.next()

I'd appreciate if anyone could please tell me if there is a way to go up one row in python cursor. opposite of row = rows.next() Thank you!
2
votes
1answer
211 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 ...
2
votes
2answers
437 views

Field calculator or update cursor?

I have a feature class in which one field (let's call it "Field_A"), as yet empty, is to be populated by the contents of another field ("Field_B") multiplied by a certain number (I'll call it the ...
0
votes
1answer
622 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: ...
-1
votes
2answers
246 views

ArcPy: (SearchCursor/export to tiff ) with no output [closed]

I'm trying to write a script that uses a search cursor to loop through a field in a .shp file (Incident_Z) find every value that meets a specific condition (zip code=10004) and then at a scale of ...
4
votes
3answers
430 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 ...
1
vote
2answers
544 views

SearchCursor (arcpy.da), accessing data on joined tables

Can you access joined tables through a da.SearchCursor? I've found documentation to do this with SearchCursor (arcpy), but nothing for the 10.1 data access module.
2
votes
1answer
358 views

Am I over-complicating adding and then calculating fields? Suggestions for a better way? (Python)

I'm attempting to re-position a question I asked yesterday here. I am starting to think that the way I wrote my code just isn't the best way. Am I overcomplicating things? I know for a fact that ...
2
votes
1answer
799 views

Incorrect field name resulted in RuntimeError: ERROR 999999 (Also, better code for adding and calculating fields)

This is the bottom half of my code (and it's been edited somewhat to share publicly). The code works perfectly fine when the fieldList has only three fields in it, but when I populate it with all 108 ...
0
votes
1answer
222 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 ...
2
votes
0answers
174 views

Processing arcobjects cursor is taking long time

I am maintaining a code on arcobjects 10.1, and there is a bug happening. I have a code that is parsing through a cursor, and generate a where clause statement to run it on a second query. So the code ...
2
votes
2answers
394 views

Using select by location to update a field in a feature class

I am using Arc 10.1 and I am working on a script that takes a value from a field within one shape file and updates a field in another shape file based on its location. Basically I have smaller parcels ...
2
votes
1answer
159 views

Updating and inserting a field within the same loop

I am working with an empty feature class where I am writing a script to create polylines within the featureclass and attach an associated text value with the polyline. I am using a for loop as noted ...
1
vote
2answers
196 views

Batch set value/calculate field inside Cursor

I am matching data using a cursor, where one of the final steps is filling in a new attribute, match, with a value calculated during the cursor. This matching is done to an ID field in the original ...
0
votes
0answers
38 views

esri ArcObjects slow performance accessing features [duplicate]

I have to create my own control like Attributes Table using C#. My version of attributes table is very slow, for ex. for 300.000 rows in table and 140 fields it takes about 1 minute! esri Cursors are ...
0
votes
1answer
298 views

Stop a Cursor loop when only 1 item is selected with Python

I am trying to create a Cursor that goes through a selection process and stops looping when only one feature is selected. Basically, as the Cursor loops it subsets a selection, and instead of going ...
2
votes
1answer
391 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 ...
15
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 ...