|
POST
|
So there are several ways in which this can be accomplished. Without knowing your set up, it is difficult to say which one would be best but these may provide some streamlining. If your data is versioned, then the version will indicate what edits have been made by indicating the date and time in which edits to that version have been made. More complicated but equally streamlined is utilizing python scripts to account for any changes made to the database or to various layers, and have those edits either copied into or overwrite the existing values in each layer Create a custom tool (either ArcMap or ArcPro) to transfer attributes based on edit dates and other required attributes.
... View more
08-10-2021
12:57 PM
|
1
|
2
|
4342
|
|
POST
|
Typically SQL clauses in python look something like this: """"roadclass" = 2""" but in terms of a where in clause, try the expression in either map or pro and copy it into the script to see if it works. If a SQL expression isn't working, then you can try the SearchCursor option to find the values that you need.
... View more
08-10-2021
10:11 AM
|
0
|
0
|
2558
|
|
POST
|
So when you set up the script tool, you can set values to have multiple values rather than creating individual parameters for each point. In which case the end user can add as many points as needed. When in comes to the geometry, you have to identify the kind of geometry for the script to search for. So for instance: import arcpy
# Create a Describe object from the feature class
#
desc = arcpy.Describe("C:/data/arch.dgn/Point")
# Print some feature class properties
#
print("Feature Type: " + desc.featureType)
print("Shape Type : " + desc.shapeType)
print("Spatial Index: " + str(desc.hasSpatialIndex)) the shapeType will tell you what kind of geometry the shape is. Also, as a side note, if you are looking to get X and Y values from the coordinates for/from a shape then it is best to use the separate X and Y shape tokens. Here is some additional information on how to write geometries. Hope this helps.
... View more
08-10-2021
09:25 AM
|
0
|
0
|
1083
|
|
POST
|
So I figured out the issue to my conundrum and here is what I came up with: DistrictsLandLots = [[values[0], values[1], values[2]] for values in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if None not in values] So there was a value of None that was causing the issue. I couldn't figure out previously on how to isolate it until recently and wrote the script as such in order to overlook that value.
... View more
08-09-2021
08:50 AM
|
3
|
1
|
19105
|
|
POST
|
If you are looking to run a script in AGO, then yes, you would want to create a geoprocessing tool to run the script. I believe parameters are optional for gp tools to run in AGO, so it is up to you if you want to include certain parameters. I am currently unaware of other options outside of creating a custom web application to run just scripts, but perhaps someone else can answer this question to give more detail.
... View more
08-09-2021
05:13 AM
|
2
|
1
|
5961
|
|
POST
|
You can try accomplishing this in one of several ways. Using the group filter widget which will allow for you to filter two separate layers by a common attribute. Creating multiple filter widgets that meet the criteria and set the overall filter setting to match all filters. Using a combination of either the group, query, or filter widgets. Give these options a try and see if any of these help.
... View more
08-06-2021
06:37 AM
|
0
|
0
|
3229
|
|
POST
|
So I ran a few tests and tried a few modifications, but the issue for some reason is still persisting despite your suggestions. I have never encountered an issue like this before so troubleshooting it is dodgy at best.
... View more
08-05-2021
12:19 PM
|
0
|
0
|
19216
|
|
POST
|
Thanks @JoeBorgione for the advice. I will give this a try and let you know how this goes. I didn't show the entire code since I was concerned with file locations of the data but I didn't think to just post it and delete the file locations. In any case, here is the complete script. It has been changed since I discovered another solution that provided the same information without needing any additional layers. import arcpy
import time
import os
print ('Process Start Time '+ time.strftime('%I:%M:%S:%p'))
arcpy.env.OverwriteWorkspace = True
#Set District and LandLot Layer Input Parameter
#District_LandLot_fc = arcpy.GetParameterAsText(0)
District_LandLot_fc = polygonfc
DistrictLandLot_TempLayer = arcpy.MakeFeatureLayer_management(District_LandLot_fc, r"in_memory\DistrictLandLot_TempLayer")
#Loop Through Temporary District and LandLot Layer To Get Field Names
print ("Acquiring District and LandLot Values At " + time.strftime('%I:%M:%S:%p'))
arcpy.AddMessage("Acquiring District and LandLot Values At {}".format(time.strftime('%I:%M:%S:%p')))
DistrictLandLots_Fields = ['LAND_DIST', 'LAND_LOT']
DistrictLandLot_fields = []
allfields = arcpy.ListFields(DistrictLandLot_TempLayer)
for field in allfields:
if field.name in DistrictLandLots_Fields:
DistrictLandLot_fields.append(field.name)
DistrictsAndLandLots = []
with arcpy.da.SearchCursor(DistrictLandLot_TempLayer, DistrictLandLot_fields) as lcur:
for row in lcur:
DistrictsAndLandLots.append(row)
print ("Acquired District and LandLot Values At " + time.strftime('%I:%M:%S:%p'))
arcpy.AddMessage("Acquired District and LandLot Values At {}".format(time.strftime('%I:%M:%S:%p')))
#Make lists of the important fields that coincide both layers
mainfields = ['OBJECTID',
'ValveID',
'LAND_DIST',
'District',
'Land_Lot',
'LAND_LOT',
'LAND_LOT_1',
'Comments_Operational',
'ORIG_FID',
'Join_Count'
]
#Set Feature Class and Workspace Input Parameter
#FeatureClass = arcpy.GetParameterAsText(1)
FeatureClass = pointfc
workspace = os.path.split(FeatureClass)[0]
if workspace.split('.')[-1] != '.gdb' or workspace.split('.')[-1] != '.sde' or workspace.split('.')[-1] != '.shp' :
workspace = os.path.split(workspace)[0]
#Get Feature Class Geometry Type
##geometryType = arcpy.Describe(FeatureClass).shapeType
print ("Acquiring All Update Values From Temporary Polygon Layer At " + time.strftime('%I:%M:%S:%p'))
arcpy.AddMessage("Acquiring All Update Values From Temporary Polygon Layer At {}".format(time.strftime('%I:%M:%S:%p')))
#Create Temporary Point Layers
TempPointFeature = arcpy.FeatureToPoint_management(FeatureClass, r'in_memory\TempPointFeature')
TempPointFeatureLayer = arcpy.MakeFeatureLayer_management(TempPointFeature, r'in_memory\TempPointFeatureLayer')
#Create Temporary District and Landlot Layer For Collecting Values
CreatedTemp = arcpy.analysis.TabulateIntersection(DistrictLandLot_TempLayer, DistrictLandLot_fields, TempPointFeatureLayer, r'in_memory\OutTable', ['ValveID'])
#Get Fields From Temporary Polygon Layer
SelectedTempFields = []
allfields = arcpy.ListFields(CreatedTemp)
for field in allfields:
if field.name in mainfields:
#print (field.name)
SelectedTempFields.append(field.name)
#Create Dictionary Of Specific Values
CreatedTempList = {}
#Get Field Indexes
VIN = SelectedTempFields.index('ValveID')
DIN = SelectedTempFields.index('LAND_DIST')
LIN = SelectedTempFields.index('LAND_LOT')
#Gather Created Temporary Polygon Layer Values
for DLL in DistrictsAndLandLots:
District = DLL[0]
Landlot = DLL[1]
DistText = str(District).zfill(2)
LandText = str(Landlot).zfill(4)
DistLandText = DistText + LandText
values = [row[VIN][-3:] for row in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if row[DIN] == District and row[LIN] == Landlot and str(row[VIN][-1]).isnumeric()]
if len(values) > 0:
print (values)
for key, values in CreatedTempList.items():
print (key, ': ', values)
print ("Acquired All Update Values From Temporary Polygon Feature Layer " + time.strftime('%I:%M:%S:%p'))
arcpy.AddMessage("Acquired All Update Values From Temporary Polygon Feature Layer At {}".format(time.strftime('%I:%M:%S:%p')))
#Get Queried Values From Layer
NewTempPointFeatureLayer = arcpy.MakeFeatureLayer_management(TempPointFeature, r'in_memory\NewTempPointFeatureLayer', arcpy.GetParameterAsText(2))
#Get Fields For Spatial Join Temporary Layer
SpatialJoinfields = []
allfields = arcpy.ListFields(temp_SpatialJoinPoint)
for field in allfields:
if field.name in mainfields:
print (field.name)
SpatialJoinfields.append(field.name)
#Set Dictionaries
VIDChanges = {}
#Get Field Indexes
OID = SpatialJoinfields.index('ORIG_FID')
VIN = SpatialJoinfields.index('ValveID')
DIN = SpatialJoinfields.index('LAND_DIST')
LIN = SpatialJoinfields.index('LAND_LOT_1')
CO = SpatialJoinfields.index('Comments_Operational')
for value in CreatedTempList:
i = 0
value_list = []
with arcpy.da.SearchCursor(temp_SpatialJoinPoint, SpatialJoinfields) as cursor:
for row in cursor:
#print (row)
if row[VIN] not in CreatedTempList:
print (row)
#Loop Through Featureclasses in Local Database
print ("Updating Feature Class At " + time.strftime('%I:%M:%S:%p'))
arcpy.AddMessage("Updating Feature Class At {}".format(time.strftime('%I:%M:%S:%p')))
#Start editing operation
##edit = arcpy.da.Editor(workspace)
##edit.startEditing(False, True)
##edit.startOperation()
#Start Updating Feature Class
fields = []
allfields = arcpy.ListFields(FeatureClass)
for field in allfields:
if field.name in mainfields:
fields.append(field.name)
OID = fields.index('OBJECTID')
VIN = fields.index('ValveID')
DIN = fields.index('District')
LIN = fields.index('Land_Lot')
with arcpy.da.SearchCursor(FeatureClass, fields) as cursor:
#with arcpy.da.UpdateCursor(FeatureClass, fields) as cursor:
for row in cursor:
for key,values in VIDChanges.items():
if row[OID] == key:
row[DIN] = values[0]
row[LIN] = values[1]
row[VIN] = values[2]
#cursor.updateRow(row)
print ("Completed Updating Feature Class At " + time.strftime('%I:%M:%S:%p'))
arcpy.AddMessage("Completed Updating Feature Class At {}".format(time.strftime('%I:%M:%S:%p')))
#End Editing Session
##edit.stopOperation()
##edit.stopEditing(True)
#Delete all in memory files
arcpy.Delete_management(DistrictLandLot_TempLayer)
arcpy.Delete_management(temp_SpatialJoinPoint)
arcpy.Delete_management(TempPointFeature)
arcpy.Delete_management(TempPointFeatureLayer)
arcpy.Delete_management(CreatedTemp)
arcpy.Delete_management(NewTempPointFeatureLayer)
print ('Process End Time '+ time.strftime('%I:%M:%S:%p'))
... View more
08-05-2021
10:52 AM
|
1
|
0
|
19221
|
|
POST
|
Hi @JoeBorgione, So here are the things that I have tried: Isolating each variable to determine if the result returns a 'NoneType' value Checking to determine object type (type(values)) Checking if the list is a list by using bool(values) Checking if the len(values) is > 0 Try and\or Except statements to raise the error (had little to no success with this option) Checking other list for 'NoneType' values After all of these attempts to find the issue; I still couldn't determine where the issue is.
... View more
08-05-2021
08:55 AM
|
0
|
0
|
19224
|
|
POST
|
Hi, So I am having an issue where every time I try to create a list, either using a comprehension or other, that returns the error of either 'NoneType' is not subcriptable or iterable. I have tried multiple methods to bypass this error, but it seems that this error persists somewhere and I can't figure out where. #Get Field Indexes
OIN = SelectedTempFields.index('ORIG_FID')
VIN = SelectedTempFields.index('ValveID')
DIN = SelectedTempFields.index('LAND_DIST')
LIN = SelectedTempFields.index('LAND_LOT_1')
#Create Dictionary Of Specific Values
CreatedTempList = {}
#Gather Created Temporary Polygon Layer Values
for DLL in DistrictsAndLandLots:
District = DLL[0]
Landlot = DLL[1]
DistText = str(District).zfill(2)
LandText = str(Landlot).zfill(4)
DistLandText = DistText + LandText
values = [row[VIN][-3:] for row in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if row[DIN] == District and row[LIN] == Landlot and row[VIN][-1] is int()]
if values:
print (sorted(set(values)))
CreatedTempList[DistLandText] = max(values)
for key, values in CreatedTempList.items():
print (key, ': ', values) small snippet of the code I also seem to be getting two error codes simultaneously, which is a bit odd, and I am not sure exactly how this error is occurring. Traceback (most recent call last):
File "U:\Models_Tools\Scripts for Water and Sewer Database\Update Valve ID Field.py", line 101, in <module>
values = [row[VIN][-3:] for row in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if row[DIN] == District and row[LIN] == Landlot and row[VIN][-1] is int()]
File "U:\Models_Tools\Scripts for Water and Sewer Database\Update Valve ID Field.py", line 101, in <listcomp>
values = [row[VIN][-3:] for row in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if row[DIN] == District and row[LIN] == Landlot and row[VIN][-1] is int()]
TypeError: 'NoneType' object is not subscriptable Any help on this would be greatly appreciated.
... View more
08-05-2021
06:15 AM
|
0
|
9
|
19330
|
|
POST
|
So I don't think that there is a widget for workflow that you are looking for aside from using either a combination of widgets or publishing the data with the reclassifications and then using the Filter widget. You could try submitting your idea of the ideal widget for your workflow to the ideas page and see if it is something that Esri would be willing to implement.
... View more
08-05-2021
05:49 AM
|
0
|
0
|
1410
|
|
POST
|
Have you thought about using the Query Widget instead. It behaves very similarly to the Filter Widget, but has additional options including changing symbology.
... View more
08-04-2021
06:16 AM
|
0
|
0
|
1428
|
|
POST
|
Hi @KellyArmstrong It should not matter if the images/url's are in subfolders (I believe anyways).
... View more
08-02-2021
10:27 AM
|
0
|
0
|
1577
|
|
POST
|
Yes. So you can accomplish this by using a python script or running the add attachments tool.
... View more
07-30-2021
07:28 AM
|
0
|
2
|
1657
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-07-2026 01:36 PM | |
| 1 | 02-10-2026 06:09 AM | |
| 1 | 03-04-2026 01:08 PM | |
| 1 | 02-24-2026 12:59 PM | |
| 3 | 03-03-2026 10:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|