|
POST
|
That is exactly the purpose of GlobalID. I would recommend against using ObjectID as a primary key field because those can get recalculated. Using GlobalID is a "set it and forget it" kind of thing. Just enable GlobalIDs in your feature class and the geodatabase takes care of the rest. You don't need to create the value yourself.
... View more
07-03-2023
08:08 AM
|
0
|
0
|
1059
|
|
POST
|
The GlobalID field is read-only and managed by the geodatabase. How exactly are you trying to "use" it?
... View more
06-30-2023
11:04 AM
|
0
|
2
|
1080
|
|
POST
|
I think you have to query the feature layer with the provided GlobalID or ObjectID if you want the new values.
... View more
06-30-2023
10:21 AM
|
0
|
3
|
1498
|
|
POST
|
From the documentation: Available only to users with an organizational subscription. Invokable only by the service item owner or an administrator. I think because it creates an item. If you are only downloading, then you can do that without logging in.
... View more
06-23-2023
10:22 AM
|
0
|
2
|
2263
|
|
POST
|
Haha, nope! I still don't see it. Maybe try contacting the community team.
... View more
06-13-2023
12:57 PM
|
0
|
1
|
3317
|
|
POST
|
I think the problem is that you're doing two different iterations together, possibly causing everything to get overwritten with whatever comes last. Instead of iterating the cursor rows inside of iterating the dictionary, just look up the values in the dictionary for each row. field_list = [
'LandUse',
'APD_Points',
'AFR_Points',
'CED_Points',
'TotalPoints',
'Program'
]
prop_dict = {
'Undeveloped': {'llimit': 10, 'ulimit': 20},
'Residential': {'llimit': 15, 'ulimit': 30},
'Multifamily': {'llimit': 80, 'ulimit': 160},
'Non Residential': {'llimit': 40, 'ulimit': 80},
# 'Education Facility': {'llimit': ?, 'ulimit': ?},
# 'Exclude': {'llimit': ?, 'ulimit': ?},
}
with arcpy.da.UpdateCursor(fc, field_list) as cursor:
for row in cursor:
limits = prop_dict.get(row[0])
if limits:
llimit, ulimit = limits.values()
if row[1] >= llimit and row[2] + row[3] > 0:
row[5] = 'PGM1 Qualifying'
elif row[1] >= ulimit:
row[5] = 'PGM2 Qualifying'
elif row[1] < ulimit:
row[5] = 'Non-Qualifying'
else:
row[5] = 'Public'
else:
print(f"'{row[0]}' is not defined in prop_dict")
row[5] = 'Public'
cursor.updateRow(row)
... View more
06-07-2023
04:19 PM
|
2
|
1
|
3552
|
|
POST
|
I think the contains method is what you would use. While looping over the features in the feature layer, test contains and then look at the attributes of the current feature and grab the id when you get a true.
... View more
06-07-2023
12:38 PM
|
0
|
0
|
2758
|
|
POST
|
Getting started with widget development | ArcGIS Experience Builder | ArcGIS Developers
... View more
06-05-2023
08:26 AM
|
0
|
0
|
980
|
|
POST
|
They should have the same fields if you're creating the output using the subs as a template. It was hard to follow your code because there seemed to be some unused lines, redundancies, and too many different names. I did my best to refactor it. If there's a GlobalID field in Subs, it should create a GlobalID field in the Subs_Ordered output too. import arcpy
import os
project = arcpy.mp.ArcGISProject("CURRENT")
arcpy.env.workspace = os.path.dirname(project.filePath)
arcpy.env.overwriteOutput = True
outPath = r'C:\Temp\Scratchworkspace.gdb'
source_fc = "SUBS"
sortedTableName = "SUBS_ordered"
# Select subs by location to subject property.
arcpy.management.MakeFeatureLayer(source_fc, "SubsLyr")
arcpy.management.SelectLayerByLocation(
in_layer="SubsLyr",
overlap_type="WITHIN_A_DISTANCE",
select_features="SUBJECT_PROPERTY",
search_distance="1 Mile",
selection_type="NEW_SELECTION"
)
# Make new feature class for ordered rows.
out_fc = arcpy.management.CreateFeatureclass(
out_path=outPath,
out_name=sortedTableName,
template="SubsLyr"
)
# Read through the sorted selection of subs and insert them into the output feature class.
with arcpy.da.SearchCursor("SubsLyr", "*", sql_clause=(None, "ORDER BY SUB_NAME")) as s_cursor:
with arcpy.da.InsertCursor(sortedTableName, "*") as i_cursor:
for row in s_cursor:
i_cursor.insertRow(row)
... View more
05-25-2023
11:46 AM
|
0
|
0
|
1243
|
|
POST
|
Web apps aren't good for working with local files. Have you considered a Python toolbox? You could share it as a geoprocessing service.
... View more
05-24-2023
07:12 AM
|
0
|
0
|
1283
|
|
POST
|
Maybe try something like this then. import arcpy
import os
source_fc = r"C:\Temp\some_gdb\SUBS"
sort_field_name = "SUB_NAME"
# Make new feature class for ordered rows.
out_fc = arcpy.management.CreateFeatureclass(
out_path=os.path.dirname(source_fc),
out_name="SUBS_ordered",
template=source_fc
)
# Insert the rows ordered by sub_name
source_fc_fields = [f.name for f in arcpy.ListFields(source_fc)]
with arcpy.da.SearchCursor(source_fc, "*", sql_clause=(None, f"ORDER BY {sort_field_name}")) as s_cursor:
with arcpy.da.InsertCursor(out_fc, "*") as i_cursor:
for row in s_cursor:
i_cursor.insertRow(row)
... View more
05-19-2023
02:27 PM
|
0
|
2
|
1265
|
|
POST
|
No, I'm asking about the source data. How do you create the SUBS.shp?
... View more
05-19-2023
12:27 PM
|
0
|
4
|
1272
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM | |
| 1 | 12-01-2025 06:19 AM |