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

learn more… | top users | synonyms

0
votes
0answers
11 views

Using ArcPy update cursor to update overlapping feature values?

I have a Geodatabase in ArcGIS 10.2 and would like to update the blank values in the 'Soils' field from the 'Landuse' Feature Class in the 'soils' Feature Class where the 'SoilType' falls within ...
1
vote
1answer
33 views

Exporting shapefile to csv with cursor

I'm trying to export a shapefile to a csv file using a cursor. I found this quesion asked and answered here: Exporting table to XYZ ASCII file via ArcPy? However I only want to export several ...
2
votes
2answers
27 views

Controlling default value of arcpy.AddField_management

I have a large collection of shapefiles that use text fields to hold numerical values. I have created new fields, and populated them with the numerical equivalent of the text field. When adding the ...
-2
votes
0answers
24 views

Another set of questions - Cursors [on hold]

yet another set of question please: i) How do I use a cursor to parse through the features in this dataset to determine if any hydrants are more than ten years old (hint: use the Year_Const field). ...
0
votes
1answer
12 views

Using Update_Cursor to fill new field

The goal is to crate a new field call "Full_Address" in which the "ADDRESS", "CITY","ST_ABREV" all appear together. I can get use row.getValue for 1 field but not more. import arcpy in_table = "C://" ...
0
votes
1answer
45 views

Updating field in feature class using ArcPy cursor?

I want to update a field in my feature class. I tried to use a da.SearchCursor (code below) but was quickly reminded that tuples are immutable... I ran the code but it failed with a TypeError: 'tuple' ...
0
votes
1answer
20 views

update cursor datetime if start date greater end date

I have 2 date fields in my feature class. If the start date is greater than the end date, I want to add 24 hours to the end date. I am getting a SetValue error. cursor = arcpy.UpdateCursor("PolyFc") ...
0
votes
0answers
20 views

Multiple Together Several Fields, then Use Update Cursor

Is it possible to preform multiplication on several fields of an attribute table together and then use an update cursor to assign the resulting value to a specific field?
1
vote
1answer
63 views

Using Update Cursor?

I am currently trying to get my update cursor to populate every row in each attribute table for 175 different feature class fields. I have written the script and it is populating the first row but all ...
0
votes
2answers
35 views

Update Multiple Columns within One Update Cursor

Are you able to update several fields within an attribute table at the same item within one Update Cursor command. Code Example: with arcpy.da.UpdateCursor (fc, fields) as cursor: for row in ...
0
votes
1answer
43 views

Check field type and execute depending on it using ArcPy?

I had a script that converted data from a clients site to a usable GIS format until they changed the output. I've tried two different directions with no luck. Due to how an earlier part of the ...
2
votes
1answer
35 views

Is it possible that ArcObjectsed ITable.Search hits default table version but cursor iterates over the edited current version of the table?

I'm very new to ArcObjects and working on an ArcMap addin. I'm having some trouble with understanding the results I'm receiving from my queryFilter. It seems doing a ITable.Search(queryFilter, true) ...
0
votes
1answer
68 views

Inserting row into table and then updating it in sum of each column using ArcPy?

My problem is the following: I have a table with an unknown number of columns (n) Use arcpy.ListFields create a list of columns and generates Field name list Then, using arcpy.da.InsertCursor create ...
3
votes
2answers
151 views

How to calculate a value based on another field under arcpy.da.UpdateCursor and cursor.updateRow?

I am trying to do a calculations under arcpy.da.UpdateCursor. I want to calculate the values for the records that have FIPS=06037. I want to take the values from "kg" column and populate the new value ...
2
votes
1answer
93 views

Using ArcPy to Read from Excel Spreadsheet to Python Dictionary

How would I go about creating a script that reads a specified excel spreadsheet and places the values in a dictionary? I have read about the xlrd library and how the library in such endeavors to read ...
0
votes
2answers
35 views

Trying to delete identical values within an update cursor

I'm trying to use the DeleteIdentical_management tool within an update cursor. I'm pretty sure I'm going about this the wrong way, I'd like to see if someone could help. I'm relatively new to python, ...
0
votes
0answers
88 views

How to use python in arcgis to create new layer from selection and export into individual maps

I am trying to create county level maps by looping through a master file for each county. However, I get an error message when I try to run the code. I'm not sure what is wrong with my code and I ...
1
vote
2answers
136 views

How to set NULL value by arcpy.da.InsertCursor on date column?

How to set NULL value by arcpy.da.InsertCursor on date column? I try insert "NULL", None, '', 0 dictIN= [{'field1':"test1",'date1':'01-02-2015','date2':''},\ ...
1
vote
2answers
155 views

Why is my cursor empty?

Yesterday I set up a Python script using a cursor on a layer. Today I've tried running again and no matter what I run it in, the cursor is empty. I've tried removing the query on the layer, tried ...
0
votes
1answer
67 views

Passing ModelBuilder parameter to update cursor gives ERROR 999999?

I have two point layers. I trust the geometry (read: x and y coordinates) from one of them, but not the attributes data. I trust the attribute data but not the geometry from the other one (the ...
0
votes
2answers
122 views

How to add XY point and update attributes with ArcPy 10.0

I would like to create a script tool that takes 3 parameters in ArcMap: Google maps coordinate (e.g. -33.876846, 151.215117) text string text string The coordinates would define the XY geometry, ...
2
votes
3answers
92 views

How to update the Z value using an UpdateCursor?

I have created the following script to mimic the ArcGIS 3D Analyst tool, FeatureTo3DByAttribute, which creates a 3D copy of a 2D feature class and sets the Z to a specified attribute. import arcpy, ...
0
votes
0answers
12 views

Importing XML Schema, Update/Delete Field Names

Presently, I am trying to write a script to import a XML workspace that contains the outline of schema. I want to create a tool/script that allows the user to import it, specify the number of certain ...
0
votes
2answers
67 views

RuntimeError: Underlying DBMS error ORA-00936: missing expression schema.tableName STATE_ID is not column in table?

I created a search cursor to retrieve some data from a feature class. The broken example shown below is used successfully in other scripts I created. The only difference that comes to mind is I'm ...
0
votes
1answer
34 views

Update Cursor not updating field correctly [closed]

I've got an issue with an update cursor not working correctly. The kicker is that when I dissolve by the field that isn't updating correctly, the output is actually correct. I have the same syntax on ...
2
votes
0answers
36 views

Updating Cursor to Include Newly Created Features

I am using ArcMap 10.1 and python to create cursor that starts at the one and only row of a polyline shapefile, some code runs to create a new feature based on the position of the exisiting feature, ...
1
vote
0answers
72 views

How to auto-increment attribute fields using cursors and conditional statements?

I am trying to create unique IDs for an attribute named "FACILITYID" (str) and have got a ton of help from related posts and online python tutorials. I selected the rows I wished to create unique ID's ...
0
votes
1answer
40 views

Changing field values using arcpy

Say I want to make my field buff_dist longer than by 400ft, I want to write a code that will go through the table and change the field value by adding 400ft to it's value. How would I write that? I ...
0
votes
1answer
31 views

How do SearchCursors sort records

How do arcpy searchcursors sort records if there is no 'sort_field' specified? It seems, on the surface, to sort ascending by the primary key. However, I don't want to base my script around this ...
1
vote
2answers
132 views

Does arcpy.GetParameterAsText() have a data type?

import arcpy # Retrieve input parameters inX = arcpy.GetParameterAsText(0) inY = arcpy.GetParameterAsText(1) inDescription = arcpy.GetParameterAsText(2) incidentsFC = "C:/Data/Yakima/Incidents.shp" ...
1
vote
1answer
51 views

How do you calculate a new field for a raster table based on value from a joined table?

I need to know whether it is possible to calculate a new field for a raster table based on a value from a joined table. Ideally I'd like to be able to accomplish this task without having to add table ...
0
votes
4answers
82 views

arcpy interate row, in a python script? SQL Select expression not working

I am creating a python script where I am trying to iterate over point feature class. I want to create seperate Feature classes from each individual day. So select daynumber and then export it to a new ...
0
votes
1answer
69 views

UpdateCursor stops after the first iteration

My arcpy script includes two updateCursor Objects. The first iteration of the "outer" coursor works fine, but the programm stops when it comes to the second iteration at updateRow(). Has somebody an ...
1
vote
1answer
19 views

The updateCursor doesn't update all the cells in the shp, just some of them

Dont know for sure what is happening, but when i use arcpy.UpdateCursor it only write some of the lines not all the lines. The code is: cursor = arcpy.UpdateCursor("FInal1a1.shp") for row in cursor: ...
2
votes
2answers
92 views

arcpy.da cursor : iteration not started

I am trying to convert cursors written in 10.0 to use the new arcpy.da module in 10.2.1. If I step through the code in debug mode, it steps into the for loop; however, when I attempt to run the code I ...
4
votes
1answer
123 views

How to add Attributes to a polygon with arcpy

I have a question about arcpy. I want to create a polygon FeatureClass with attributes. The code below is just test-code that generates some polygons for speed testing. I want to add some additional ...
2
votes
1answer
85 views

Do I need to set arcpy.env.workspace at the beginning of my python code?

I am new to Arcpy and have been doing simple tasks such as AddField_management and updateCursor. However I have been getting error msgs, such as errors 99999 etc. The errors I get are related to ...
2
votes
1answer
42 views

arcpy cursor not accepting float(Inf)

I have a vector layer in which I have added some fields of type 'float' using arcpy.AddField_management. I'm performing simple calculations between those fields using update cursors but the problem is ...
3
votes
1answer
32 views

ArcMap Using Python to Rename a Feature Class based on Print Results

I would like to rename a feature class based on the EDITOR and DATE fields. I wrote this code: import arcpy fc = "C:\Users\PythonTesting.gdb\MyFile" f1, f2, f3 = "EDITOR", "DATE", "OBJECTID" ...
0
votes
1answer
56 views

limit spatial extent of arcpy cursor

How do I limit spatial extent of features that is returned by arcpy.da.SearchCursor? Can I use arcpy.env.extent? Or somehow come up with sql statement to specify spatial relationship? Or do I have ...
1
vote
1answer
83 views

Problem with Nested For Loop in ArcPy

I have two vector layer files, 'hausnummer_cropped5' and 'gebaudepoints_cropped5 - Kopie2'. Both have a point geometry and I am trying to shift the locations of the gebaudepoints_cropped5 points onto ...
1
vote
2answers
110 views

How to get a search cursor on a particular version in arcpy

I have a versioned database in ArcGIS and I am wondering how can I tell arcpy what version to query. The closest I have got to an answer has been building a particular connection file that specifies ...
0
votes
2answers
57 views

How to set values from list to row using arcpy

I have list with values and I want to put them in rows for specific column. Here is my code: den = kol() # list with values with arcpy.da.UpdateCursor('Wojewodztwa', 'gest_zal') as cursor: for ...
0
votes
2answers
38 views

Randomly assign a value to a specificed number of rows in a feature class in ArcGIS

I have several feature classes, each with a million or so rows. In each of these feature classes I have an attribute ("STATE"), the value of which I want to randomly assign to one or another state (so ...
1
vote
1answer
65 views

arcpy insert cursor problem - adding multiple polygons

I am reading rows from a database with a field "Coords" that contains polygon coordinates in the format 40.090170,-83.007704|40.089878,-83.007724..... and inserting each row as a polygon. The first ...
0
votes
0answers
54 views

Issue with da.updateCursor on shape

I recently posted answer Determining Y coordinate for Create Fishnet from desired Angle of Rotation in Python/ArcPy? . While working on it I found something weird with da.updateCursor on shape field. ...
0
votes
0answers
42 views

GetParameterAsText() with Cursor

I'm trying to use the GetParameterAsText() for user input. When I use a value instead, it works fine but not with GetParameterAsText() Any help will be greatly appreciated AreaFilter = ...
0
votes
1answer
41 views

table update w/ cursor geometry conflict

I'm creating a table using arcpy with a list of results (stored in 2d lists) following an update to some features. This can sometimes include geometry, so I've attempted to substitute those for a ...
0
votes
1answer
121 views

Convert python from arcpy.da.SearchCursor to work in 10.0

I am using code such as for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"], spatial_reference=SR): # create inner buffer polyBuff = row[0].buffer(buffNum * -1) # create hull rectangle to ...
2
votes
1answer
63 views

Combining duplicate points while preserving their associated attributes

I'm working with building routes for a lit of technician's stops. In some cases, they have two "stops" at the same customer location -- turning on two types of service at a house, for example, is ...