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

learn more… | top users | synonyms (2)

0
votes
1answer
29 views

Can't get new rows added with Arcpy / InsertCursor

I'm not getting any errors but can't seem to get these rows added. Everything else in the script works fine. I only dabble with Python occasionally so please forgive me for missing anything obvious ...
0
votes
1answer
33 views

Finding field with maximum value and field name using ArcPy cursor?

I was wondering if an equivalent of summary statistics exists for finding such statistics across fields rather than records in a table. For example, of several fields, I wanted to find which one has ...
0
votes
2answers
64 views

Creating a dict with Search Cursor

I need to find how many routes are assigned to each account number in a feature class. I'm using search cursor twice, first to build a set of account numbers, second to get the number of times a route ...
1
vote
4answers
58 views

Iterate through a list to use then use SearchCursor to populate new list

I have a featureclass of buildings. Each one has a unique number ("BO_UNIQ"). I create a list of these unique numbers (1251 elements). I then want to iterate though this list and get facility names ...
1
vote
0answers
26 views

Pycharm cannot find reference 'SearchCursor' in 'arcpy.da'

Whenever I try to use a search cursor from arcpy in pycharm, I get this unresolved reference error. I should note that it was working fine earlier in the night, I have no idea what happened. I've ...
2
votes
1answer
26 views

moving the objects in a feature class by a field within the table of that feature class

I have a feature class and I want to move its objects based on two fields in it I used the following code but get error: with arcpy.da.UpdateCursor(fc2,["SHAPE@XY","centerpo_4","centerpo_5"]) as ...
0
votes
3answers
86 views

Use if statement to delete row data, ArcGIS 10.3.1, Python 2.7

I have a indoor positioning shp file. I need to do the data cleaning for the further analysis. and here is the attribute table: Field(Sheet1_minor) is the name of beacon, and Fields(Beacon_41_B1,B2,...
2
votes
1answer
29 views

Adding values from list into Attribute with UpdateCursor?

I have a list of values of buildings total height and want to update the corresponding field in the shapefile. fclass is my shapefile totalh is the field which i want to update totaheight is a list ...
2
votes
1answer
58 views

ArcPy Insert cursor losing vertices when writing Polygon features?

I'm currently trying to code a geodesic buffer from points (the one that is implemented in ArcGIS is very slow). The idea is to calculate 100 point coordinates (P_Buffer) around an initial point (P) ...
0
votes
1answer
35 views

Holding onto row values while using cursors

I'd like to be able to use an update cursor to go through rows in a table, holding onto the previous rows value, and comparing it to the current row value, to populate a new field with this value. ...
0
votes
1answer
67 views

Using arcpy.SearchCursor() for multivalue field?

I need to make a multivalue field to be selected as:   Input_Features = arcpy.GetParameterAsText (0) Num_Pop = arcpy.GetParameterAsText (1) #(It contains population data for the periods 2020, 2025, ...
0
votes
1answer
41 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
40 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
23 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
98 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 ...
1
vote
3answers
61 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 ...
0
votes
1answer
58 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 ...
3
votes
1answer
62 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 ...
2
votes
1answer
68 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 ...
1
vote
0answers
24 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 ...
1
vote
1answer
64 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 ...
3
votes
1answer
78 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
31 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
28 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 ...
0
votes
1answer
57 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 "...
1
vote
1answer
58 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 arcpy.env....
3
votes
2answers
43 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
1answer
65 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
41 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 ...
1
vote
1answer
22 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
33 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
71 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 ...
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 ...
1
vote
1answer
37 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 ...
1
vote
1answer
47 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
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
2answers
23 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, ...
2
votes
0answers
30 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
0answers
39 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
28 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
55 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
2answers
116 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 ...
2
votes
2answers
49 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
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 ...
1
vote
1answer
56 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 NAME....
4
votes
1answer
174 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", "...
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: ...
1
vote
1answer
32 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: ...
-1
votes
1answer
57 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 = ...
2
votes
2answers
81 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 ...