All Questions
116 questions
0
votes
2
answers
159
views
Updating z values from joined table using ArcPy?
I have joined two tables. The first table includes the current z values, while the new table includes new z values. I first tried to snap, but this didn't update the Z values, only X and Y. How can I ...
0
votes
1
answer
174
views
SearchCursor not reading the last row
Let's say I have a layer made up of pre-selected features from another layer:
selects = arcpy.SelectLayerByAttribute_management (S_FIRM_Pan, "NEW_SELECTION", "DFIRM_ID = '{}'".format(fipC))
If I get ...
0
votes
1
answer
147
views
Updatecursor returns with 'variable not defined'
I am fighting a bit with the cursor function since this morning.
Thanks to the help of the people here and some tutorials I found I got this far
import arcpy
arcpy.env.workspace = "C:\\Users\\...
0
votes
1
answer
487
views
arcpy.UpdateCursor setting value to 0 instead of Null
I'm having issues setting a row value to 0 when joining a csv to a shapefile. When the shapefile value is not in the csv, the row is getting set to 0 instead of null. This is a huge problem as i'm ...
0
votes
1
answer
571
views
Update Cursor to Polyline Creates Records with Missing Geometry
I am working on an arcpy script to create a polyline feature class with a single polyline feature between each 2 points in a sequence of points. I use a search cursor to first create a table with all ...
0
votes
2
answers
3k
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 ...
0
votes
1
answer
297
views
Calculating well densities in selected counties using ArcPy?
I am trying to calculate:
total numbers of wells that fall into each county in a shapefile, and update the county table with the total count.
calculate the well density (how many wells there are per ...
0
votes
1
answer
392
views
Reading column line by line from table in geodatabase using ArcPy?
I have a table in a geodatabase.
It looks like this:
id table_na
0 1 ER_ASTENOT_ASTOTA
1 2 INT_ASTENOT_ASTOTA
2 3 ER_ASTENOT_ASTTOM
It has more columns though.
Can you tell me how ...
0
votes
2
answers
129
views
Iterating over (selected) features by the same id
I have a feature class Test_NearestNeighbor_Code. This feature class has 7373 polygon features and a column/ field called osm_id. I want to do a calculation with all features that have the same osm_id....
0
votes
2
answers
122
views
Iteratively Updating Just Bottom Row in Table using ArcPy?
I see lots of examples of updating a specific column down ALL rows of a table, for example:
with arcpy.da.UpdateCursor(Input_Layer, ['Column_1','Column_2']) as cursor:
for row in cursor:
...
0
votes
2
answers
430
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 ...
0
votes
1
answer
1k
views
Understanding UnicodeDecodeError: 'utf8' codec in ArcPy script?
I work with arcmap 10.3 and python 2.7.8. I have more than 500 shapefiles that located in many folders and subFolders. All Sub Folders are located in one large directory. I try with arcpy to detect ...
0
votes
1
answer
979
views
arcpy.da.UpdateCursor updating field based on the previous row
I am quite new to python.
As you can see from the image attached to this post. I have polylines with From junctions (fnode) and to junctions(tnode) field. My goal is as following:
To update draw ...
-1
votes
2
answers
1k
views
Updating Z coordinates of points in polygons with ArcPy
I am trying to update Z values of polygon shape with ArcPy. This script is working without error but increasing the first (0 position vertex) vertex twice. I want to update only once. How can I avoid ...
-1
votes
2
answers
2k
views
Counting number of instances of certain field value using ArcPy?
I am creating code that accesses a shapefile named Schools.shp. I data I am trying to locate is the attribute field named FACILITIES. Within the FACILITIES field I am trying to get values that the ...
-2
votes
1
answer
177
views
SQL statement (where_clause) does not work for UpdateCursor syntax but same works for SearchCursor syntax
feature class fc1 (daily data) and feature class fc2 (geodatabase) both have unique_id field which will be used to map Col1 rows in fc1 to update corresponding Col2 rows (not all rows) in fc2. Below ...