|
POST
|
You could do this with a search cursor. 1. Create a dictionary of OID keys and values of [SHAPE@, Intensity, Field] 2.Iterate through each OID to find matching SHAPE@ and Intensity and append them to a list. 3.you should have a list of all OIDs classed as identical by position and Intensity. Iterate through that list using the initial dictionary to find where field is N or Y
... View more
03-27-2020
11:40 AM
|
1
|
1
|
1870
|
|
POST
|
Perhaps copy the connection file to the server with a full path, have you set up setparameter etc as derived output? On publishing you should be able to specify the level of error messaging.
... View more
03-27-2020
05:11 AM
|
1
|
0
|
2108
|
|
POST
|
This script makes no sense, can you be clear what you exactly want to achieve.
... View more
03-25-2020
02:57 PM
|
0
|
0
|
7762
|
|
POST
|
I don't see anything wrong with the statement, as it's in Raster Calculator not map algebra, the quotes are needed. I would troubleshoot by performing some simple expressions on each raster to see if the rasters themselves are the issue.
... View more
03-23-2020
09:11 AM
|
0
|
0
|
7317
|
|
POST
|
A useful workflow for me is to write the expression first in the 'Select by attribute' window and see if it returns the expected results, then enclose the expression in quotations. for example a simple selection "Id" = 0 becomes '"id" = 0'
... View more
03-22-2020
07:17 AM
|
2
|
0
|
4350
|
|
POST
|
Nearly there, but you need to pass in 2 arguments. #prelogic codeblock
def Reclass(arg1, arg2):
if arg1 in ["222", "333"]:
return "<Null>"
else:
return arg2
#code
Reclass(!NAME!, !PNAME!)
... View more
03-22-2020
06:57 AM
|
1
|
1
|
1519
|
|
POST
|
import arcpy
#from arcpy import env
#i prefer to be explicit in module use
#use raw formatting
arcpy.env.workspace = r"C:/EsriPress/Python/Data/Exercise07"
#lower case
#is this in the workspace? if not use a full path
fc = "airports.shp"
#arcpy.da.searchcursor is best
#rows = arcpy.SearchCursor(fc)
#fields = arcpy.ListFields(fc)
#for field in fields:
#if fields.name == "NAME"
#for row in rows:
#print "Name = {0}".format(row.getValue(field.name))
try:
with arcpy.da.SearchCusor(fc, "NAME") as cursor:
for row in cursor:
print("Name = " + row)
except:
print("No field 'NAME' found")
break
... View more
03-21-2020
11:07 AM
|
1
|
0
|
2166
|
|
POST
|
I would read all of the geometries into 2 dictionaries then run a nested for loop to grab the OIDs which match (geometry.distanceTo <=1600 etc.) then a search and update cursor to concatenate and append the string.
... View more
03-21-2020
05:16 AM
|
0
|
0
|
890
|
|
POST
|
Hi Brandon. I can't think of any possible workaround. perhaps you could use the spare time to do an esri MOOC? https://www.esri.com/training/mooc/ although you will have to download Pro and will be provided with a license for the course duration.
... View more
03-20-2020
01:00 PM
|
0
|
0
|
1639
|
|
POST
|
import arcpy
input_table = r'C:\'
#create a list of unique names
#a set has no duplicates
abbr_name_list = []
with arcpy.da.SearchCursor(input_table, "ABBR_NAME") as cursor:
for row in cursor:
abbr_name_list.append(row[0])
abbr_name_set = set(abbr_name_list)
#make a list of ABBR_NAMEs in the set along with the cell IDs
abbr_name_cell_id_list = []
for abbr_name in abbr_name_set:
cell_id_list = []
with arcpy.da.SearchCursor(input_table, ["ABBR_NAME", "CELL_ID"]) as cursor:
cell_id_list = []
for row in cursor:
if abbr_name == row[0]:
cell_id_list.append(row[1])
if len(cell_id_list) != 0:
cell_id_string = str(cell_id_list)
cell_id_string = cell_id_string.replace("u","")
cell_id_string = cell_id_string.replace("[","")
cell_id_string = cell_id_string.replace("]","")
cell_id_string = cell_id_string.replace("'","")
cell_id_string = cell_id_string.replace(" ","")
item = (abbr_name + "-" + cell_id_string)
abbr_name_cell_id_list.append(item)
for x in abbr_name_cell_id_list:
with arcpy.da.UpdateCursor(input_table, ["ABBR_NAME", "GridIndex"]) as cursor:
for row in cursor:
if str((x.split("-"))[0]) == str(row[0]):
row[1] = (x.split("-"))[0] + " - " + (x.split("-"))[1]
cursor.updateRow(row)
... View more
03-20-2020
09:24 AM
|
0
|
0
|
2038
|
|
POST
|
a spatial relate would be nice, someone please make that btw Maybe your script could select only new features to run the join on, i.e hold a text file somewhere which references the most recent object id, select those greater than it then run the join and replace the oid in the text file.
... View more
03-20-2020
04:38 AM
|
0
|
1
|
1268
|
|
POST
|
do you have multiple instances of the table open? close down all your ArcGIS applications and open up a fresh mxd then retry.
... View more
03-20-2020
03:45 AM
|
0
|
0
|
1517
|
|
POST
|
Hi, try adding an else statement to handle the bulk of the values which don't meet the condition. def Reclass(arg):
if arcg.endswith(""):
return "3"
else:
return arg
... View more
03-20-2020
03:18 AM
|
0
|
0
|
1517
|
|
POST
|
Hey you're very welcome Johnny. Two final points: 1. dependant on the buffer distance you may want to consider a "GEODESIC" buffer to preserve true distance. 2. Buffering country sized polyline data is extreeeeeemely processing intensive
... View more
03-19-2020
01:22 PM
|
1
|
1
|
582
|
|
POST
|
of course, I should have noticed this. fcs is just a list of the string names of the feature classes/shapefiles in that workspace. simply join the workspace path to fc in fcs to give a full filepath for fc in fcs: fc_path = os.path.join(arcpy.env.workspace, fc)
... View more
03-19-2020
12:34 PM
|
0
|
3
|
3014
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-13-2025 01:08 PM | |
| 1 | 09-25-2025 03:19 PM | |
| 1 | 09-24-2025 02:35 PM | |
| 1 | 09-17-2025 02:42 PM | |
| 1 | 09-10-2025 02:35 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|