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

learn more… | top users | synonyms (2)

0
votes
0answers
19 views

Which is the faster way to copy data to another feature class: Feature Class to Feature Class or Insert Cursor

I have a feature class with 1 million records. Which is the faster way to copy data to another feature class: Feature Class to Feature Class or Insert Cursor?
1
vote
1answer
33 views

ArcGIS ArcPy update attachments table rows

Some background: We were using Collector on Android to collect data for a layer, and we found out that the pictures that were attached contained no EXIF tags at all, including the orientation tag - ...
0
votes
0answers
20 views

Not able to apply update cursor on OS MasterMap feature classes created using OS Translator II

I am using OS Translator tool to convert OSMasterMap GZ files to PostgreSQL database. The feature classes created are query layers and cannot be edited in ArcGIS. Now I am writing a code to add new ...
1
vote
1answer
90 views

error trying to create two variables Cannot acquire a lock

I am trying to create two variables one for x vertices and another for y vertices, when I leave the vertices as x, y the code runs but not when I separate the vertices into verticeX & verticeY ...
2
votes
1answer
67 views

Implementing UpdateCursor?

I previously asked Updating attribute information about this script last week. I have amended it and am confused. I need to write the ADMINAREA value to the empty LOCALITY fields from TWB_Suburbs to ...
0
votes
1answer
45 views

Python Script to update all feature classes/datasets in gdb with search and update cursor?

I have two geodatabases, one is a production sde database, the other is a backup in a local file geodatabase. The script runs as a task once a month and is very resource intensive. I am using ArcGIS ...
1
vote
3answers
54 views

Using arcpy.SearchCursor SQL clause?

I got a table with the name Predios like this: OBJECTID PRM_IDENTIFICA 1 4030200606130 2 403020060615 3 40302006011700 Can I use search cursor to find the records ...
3
votes
1answer
56 views

How to use search cursor in a given extent

I want to perform a selective search cursor for a feature class for a given extent. I have tried setting env.extent in the below code but it is returning the whole feature class instead of a fixed ...
0
votes
2answers
224 views

Can I use my SearchCursor in Select by Location

I am trying to select the largest polygon that contains each feature in a feature class but none of the features in another feature class. I have written the code that seems logical to me but (of ...
5
votes
3answers
3k views

Debugging RuntimeError: workspace already in transaction mode from arcpy.da.UpdateCursor and ArcSDE feature classes?

I am making my first attempt at editing an ArcSDE feature class with python through a da.UpdateCursor. I'm essentially taking code I've written for a file geodatabase feature class and applying it to ...
2
votes
0answers
23 views

Creating new feature class in ArcPy gives error 000210? [closed]

I am trying to create a new attribute table and I keep getting the same error. import os import arcpy import math folderpath = 'C:\Users\Michaelf\Desktop\GEOG M173' arcpy.env.workspace = folderpath ...
0
votes
1answer
546 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 ...
1
vote
1answer
52 views

Arcpy update cursor: stop iteration error

I have 1 csv with municipalities and their corresponding zip codes and a GDB of houses which contain address, municipality but no zip codes Objective: add the zip codes to the GDB table import csv ...
0
votes
1answer
40 views

Automation KeyError using Search Cursor / Data Dictionary

I recently received help in modifying a previous code for structures as part of project. The first time I ran it the code worked fine, but when I went to double check it. I keep receiving: ...
2
votes
2answers
744 views

Adding values in X column to list using ArcPy?

My apologies if this question has been asked before. I've spent some time searching for a similar question with no results. Is it possible to add each value under X column to a list using ArcPy? I ...
0
votes
2answers
148 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 ...
3
votes
2answers
39 views

Arcpy Update Cursor with Character Length

I am attempting to create an update cursor to concatenate fields of a parcel ID based on the amount of characters in the MAPNO field. This is important because the spacing between MAPNO and LOT of ...
0
votes
1answer
53 views

Using InsertCursor and SearchCursor with Nested Loops

I have a script that's parsing through text within each record of a table/field, and inserting those values into field/records of another table. Here's an example of the text being parsed (from ...
3
votes
1answer
76 views

Updating attribute information

I need to write a script that updates the "LOCALITY" field in a feature class if it is empty with the suburb it is in. I have identified the number of properties with select by location and the ...
2
votes
1answer
29 views

Script Tool Automation of Search and Update Cursor?

I keep recieving the following error: RuntimeError: An invalid SQL statement was used. [SELECT [ID_NUMBER,COLLECTION,COLLECTED_,COLLECTI_1], OBJECTID FROM OFFICIAL_STRUCTURES2015] import arcpy as ...
1
vote
1answer
26 views

Arcpy: Insert a text if filed is empty

I want to run a python code that, if 4 fields are empty, insert in the first of them a text. The fields are all designed to contain text. My code is: import arcpy import xlrd import numpy import ...
1
vote
1answer
56 views

Create points along selected line using arcpy

How to make this script take a list of distances along a selected line and create a point featureclass with points at these distances? import arcpy from arcpy import env import os ...
1
vote
1answer
60 views

Arcpy store field value as variable

I am trying to write a script that will go through a grid layer that has individual 535 grid squares. I want to find a way that will tell me how much gas main is left to be checked in each grid. Any ...
3
votes
2answers
42 views

Search for textbits in QGIS

Is there a way to search for only parts of text in QGIS. Imagine I have a field in my attributetable called myField and I have several entries there, something like This is awesome Even more awesome ...
1
vote
2answers
115 views

Scripting (Python) Feature Class content into Shapefiles following an UTM data structure

Consider a Feature Class and two of its fields are "UTM_grid" and the "OID". Scripting with python 2.7 for ArcGIS 10.3. "UTM_grid" field contains the geographic info (e.g. B1SD40B) and was broken ...
1
vote
1answer
20 views

Search and Update Cursor Automation: Avoid <Null> Values and Recognize Data Values

I am attempting to Search Cursor through a joined table. (I do not have access to the original separated tables) If the value of "COMPANY" and "DATE_" are then they will be skipped and it is ...
1
vote
1answer
32 views

count if a row value is within a dynamic range?

I am after doing a COUNTIFS in python. I need to check each row ± 250 with other rows and if this row is between that range then count 1, then next row, .. and do the same thing. and if there are any, ...
2
votes
2answers
69 views

Update Cursor: Unable to populate specific field

I am attempting to create a loop to recognize the entry/exit point of a pipe to/from a structure by associating it with a North, South, East, or West direction and then populate the corresponding ...
-4
votes
0answers
54 views

can't get tuple to run [duplicate]

I am having some trouble getting my code to run particularly for my tuple. I am trying to get the distance from any city to a lake by calculating the minimal Euclidean distance from the city ...
3
votes
3answers
217 views

Duplicating polygons in Layer using ArcPy cursors gives AttributeError: 'tuple' object has no attribute 'getValue'?

I am trying to Duplicate some polygons in the same layer with the same attributes, But it will duplicated them with Null Geometry, i have tried getValue() method, but i got error import arcpy ...
1
vote
1answer
41 views

How do I get arcpy.Select_analysis to skip conditions that don't exist

I have data from 2007 to 2015 of various animals that I'm trying to break up by year and name. I wrote a little for loop that goes through all the items in my attribute table (gps_points). The ...
2
votes
0answers
28 views

How to get 4 values for different Indexes and names of rasters for set of points? [closed]

I am trying to get 4 values for different Indexes and names of rasters for set of points, but get problem with defining function def extractIndex(raster, pathName). #List of Folders 4 Folders ...
1
vote
1answer
24 views

Getting NameError when using Cursors to read vertex coordinates in ArcPy? [closed]

I am new to python and having trouble Looping each feature in the new polygon shapefile, then use geometry cursors to read vertex coordinates of this lake polygon, identify the city that is the ...
2
votes
2answers
26 views

Reference Items in Generated List for Multiple Record Selection and Iterate

I'm new to Python and am having trouble with a list of all things. The data I am currently working with consists of multiple road segments (contained in 'STREETNAME' field) each of which has a ...
1
vote
1answer
34 views

Updating Field to Calculated Variable using Arcpy

I'm trying to use the updateCursor to insert a calculated value in the correct field. However, I keep on receiving an execution error. I think it is an easy fix, but I am new to arcpy and cannot ...
3
votes
1answer
43 views

ArcObjects in ArcMap 10.2.2 UpdateCursor refer to a calculated field value in the same Cursor

Is it safe to calculate a field value inside an update cursor and refer back to this calculated value to change another field value of the same row? I think some code will actually explain my ...
1
vote
2answers
21 views

trying to update empty string field with a string

I need to update a column of values such that empty fields are changed to the string "OFF_ROAD." I've looked up a plethora of examples, and this is what I'm trying to get to work, but when I run it, ...
1
vote
0answers
38 views

Import csv value to an empty field in a point feature class

I have a .csv with three colums and a point feature class with an empty field that i would like to fill with a value of the csv. In the .csv i have 15 rows with a code. In the feature class just one ...
0
votes
2answers
27 views

Getting name of raster in point shp.file Attribute Table using ArcPy? AttributeError: 'unicode' object has no attribute 'contains'

I am trying to get name of raster for corresponding point if point belongs to raster and fill column "name" in points Attribute Table: but no names in Attribute Table column "name" of point's ...
0
votes
1answer
53 views

Attribute table updating using ArcPy cursors?

I have a line type shapefile representing the road network of a country. That the country has experienced more change in the road names is why I want to create a script that will help me make update ...
1
vote
0answers
26 views

Scripting cursor updates to ArcGIS Online feature is somehow failing

I'm charged with maintaining QA logs embedded in a feature on ArcGIS Online. Basically I just have to change some fields in the feature. The problem is that I wrote scripts using cursors to update ...
2
votes
2answers
47 views

editing and manipulating tables with python

I’m new to ArcMap and was wondering if anybody could help me out. I have a shapefile with counties and wells in that county. In the table I’m trying edit it so that for each county calculate the total ...
1
vote
1answer
47 views

Comparison between two fields of two tables using ArcPy cursors?

I would like to make a comparison between two fields of two different tables with a Python script. Fields for comparison are ROAD_NAME and NAME.ROAD. The idea is to check whether each element of ...
4
votes
1answer
169 views

Generic error on an “if” in arcpy

My code has to check if a value in a shapefile attribute table belongs to a certain group of landuses. Below I paste my code: cursor = arcpy.SearchCursor(buf_intersect) fields = ["GTYS_Branc", ...
3
votes
1answer
292 views

Alternative to an arcpy script for points to lines to polygons?

I'm relatively new to arcpy and python, so I feel like I could be missing something obvious in regards to tool options for what I'm trying to achieve. I have a script that creates triangular ...
0
votes
2answers
104 views

Attribute field based off intersecting polygon

I need to add a polygon for each bookmark (which works fine) and then attribute a field based off which Zip Codes the bookmark polygon intersects. I dont know if I am on the right track. The code ...
1
vote
1answer
30 views

The same value for X and Y in Attribute Table

I want to extract X and Y coordinates of points from shp file - infc, and put them to corresponding columns in Attribute Table. My code just give the same X and Y for all points in Attribute Table: ...
2
votes
2answers
77 views

Update Cursor for automation of tedious data entry which keeps crashing ArcMap

I coded the Update Cursor for automation of tedious data entry where I am applying a previous Survey Company Identification Data to STRUCTURES_15096.shp from "OFFICIAL_STRUCTURES2015.shp" and it keeps ...
-1
votes
1answer
53 views

Insert Cursor not creating polygon

I used this code to create a polygon in my map, but the polygon isn't showing up anywhere. Does anyone know why? Here is my code: fc = "U:\BuildingFootprints.gdb\BuildingFootprintsCopy" cursor = ...
0
votes
1answer
87 views

Having arcpy.da.SearchCursor access only selected row in attribute table?

In ArcMap 10.2, I'm attempting to build a tool that, when run, will iterate through a network of pipes to locate an outfall point. My network is composed of polyline data representing pipe, with input ...