|
POST
|
By its nature it references another MD so it wouldn't make sense. You could simply set a SQL query on your referenced MD to exclude/include specific rasters, or by attributes in the MD raster attribute table.
... View more
01-22-2024
11:44 AM
|
2
|
1
|
2010
|
|
POST
|
Not sure, but worth a try (python API is always trial and error for me): # variables for layers
streets = gis.content.get("63e410a1a67044e79642f5a4c13a1873")
vehicles = gis.content.get("310e43debfb74081904820174814a58b")
#access layers
# assuming it's the first layer
streets_layer = streets.layers[0]
vehicles_layer = vehicles.layers[0]
# select by location / intersect on plow routes
print("Selecting snow routes...")
int_layer = arcpy.management.SelectLayerByLocation(streets_layer, "INTERSECT", vehicles_layer, selection_type="NEW_SELECTION")
theCount = arcpy.management.GetCount(int_layer)
print(f"{theCount} features selected")
... View more
01-18-2024
12:19 PM
|
0
|
0
|
1279
|
|
POST
|
have not looked that the rest of your code or code logic is correct, but at a glance possibly: for fc in fcsLi:
inField = "NRHP_Type"
expression = "getNRHPType(os.path.basename(fc))"
arcpy.CalculateField_management(fc, inField, "'"+expression+"'", "PYTHON", codeblock)
print(fc+" completed")
... View more
01-17-2024
12:51 PM
|
0
|
1
|
2794
|
|
POST
|
If you check the REST POST operation (sometheing like editFeatures/applyEdits) from your internet browser dev console (network traffic tab) - the response might have a more descriptive error for you to troubleshoot with.
... View more
01-16-2024
12:16 PM
|
0
|
0
|
1491
|
|
POST
|
A simple way which would only take a few minutes would be to use an excel formula to take your strings into a format such as below (slide the syntax bar to 'SQL' rather than clause mode) Field_name IN (
'X100',
'Y200',
'Z200'
) You can generate the string format using a simple excel formula such as below (replace A1 with your cell then drag the formula down for the other cells. "'"&A1&"'," Copy the cells from the excel and paste them into the SQL IN statement (don't forget to remove the last value's comma for syntax) Edit - have realised this is an inadvertent copy of @Bud 's solution above.
... View more
01-15-2024
03:34 PM
|
2
|
1
|
3909
|
|
POST
|
I'm not really following what you need from your explanation. Linda's answer seems to be the best option, but after re-reading your question there may be more to your data format. It might help to share some sample screenshots, as the question is not the clearest (to me at-least).
... View more
01-15-2024
12:13 PM
|
1
|
0
|
3925
|
|
POST
|
Your data is in a format called JSON which can be unpacked easily. import arcpy
import json
your_string = 'your JSON coordinate string'
data = json.loads(your_string)
x = data["AddressCandidates"][0]["location"]["x"]
y = data["AddressCandidates"][0]["location"]["y"]
... View more
01-12-2024
11:54 AM
|
2
|
0
|
1003
|
|
POST
|
I'm really struggling with subqueries in these FGDB views. They seems temperamental with warnings about 'cannot be edited in clause mode' when I'm not in clause mode, or working then not working on a whim. I thought I understood the limitation was only scalar results could be returned by the subquery, but then I see otherwise.
... View more
01-12-2024
09:20 AM
|
1
|
4
|
9441
|
|
POST
|
Maybe a different drive mapping for your portable drive on your PC and your uni PC.
... View more
01-11-2024
10:48 AM
|
0
|
0
|
1600
|
|
POST
|
If you go to the item page of the view -> Settings tab -> Update View can you not see the configuration?
... View more
01-11-2024
09:45 AM
|
0
|
0
|
952
|
|
POST
|
arcpy.CalculateGeometryAttributes_management(out_data_py,
[["ACRE", "AREA"]],
'',
"ACRES",
'PROJCS["NAD_1983_StatePlane_Kansas_North_FIPS_1501_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1312333.333333333],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]',
"SAME_AS_INPUT")
print("Acreage Calculated") yes your syntax looks different from the format shown in the help. I've adjusted the 2nd argument for the tool. I'd also try without specifying the input coordinate system as the last argument and see if that's causing the issue.
... View more
01-10-2024
11:36 AM
|
0
|
3
|
5250
|
|
POST
|
How are you importing the modules? Just import arcpy or are you doing anything different? Are you running from the same Python environment as Pro? e.g. having an old ArcMap install. I'd recommend trying the below syntax to access it via the arcpy.management submodule rather than _management. arcpy.management.CalculateGeometryAttributes(in_features, geometry_property, {length_unit}, {area_unit}, {coordinate_system}, {coordinate_format})
... View more
01-10-2024
10:58 AM
|
1
|
5
|
5256
|
|
POST
|
Thanks Joshua, much neater (and optimised). I wonder about the (date, oid) tuple and whether something like having 'date' and 'oid' as keys in their own dictionary (these keys being values of date_dict..) and if that would be faster or slower. My only other thoughts are another idea of turning the feature class into some data format that could work with the SQL subquery with max(date) and groupBy species, but the juice might not be worth the squeeze on that one.
... View more
01-10-2024
10:43 AM
|
1
|
0
|
4844
|
|
POST
|
This is likely not the fastest, best or most logical way to do it, but it should do the job. import arcpy
#input feature class
in_fc = r'C:\path to your FC'
#dictionary to store objectid of newest sighting date for each species
date_dict = {}
#cursor to iterate through each row in fc
#if date is more recent than current species value for key
#update to the matching oid of that date in dictionary
with arcpy.da.SearchCursor(in_fc, ['OBJECTID', 'your species field', 'your date field']) as cursor:
for row in cursor:
#unpack row
oid, species, date = row
#if no dictionary value yet, add 1st entry
if species not in date_dict:
date_dict[species]=[date, oid]
#check existing date is older, if so - replace it
elif date > date_dict[species][0]:
date_dict[species]=[date, oid]
#create string of object ids for selection query input
oid_list = [value[1] for value in date_dict.values()]
selection_string = '(' + ','.join(map(str,oid_list)) +')'
#turn into feature layer for selection
feature_layer = arcpy.MakeFeatureLayer_management(in_fc, "feature_layer")
#select by attributes using oid list/string
selection = arcpy.management.SelectLayerByAttribute(feature_layer, "NEW_SELECTION", f'OBJECTID IN {selection_string}')
#save your new fc
out_fc = r'C:\path to new fc output'
arcpy.CopyFeatures_management(selection, out_fc)
... View more
01-09-2024
11:50 AM
|
0
|
2
|
4770
|
|
POST
|
Yeh I had a look at this and you'll need to go with Richard's suggestion of a submodel as you can't have 2 iterators. The collect values wont work so you need to have an iterator to go over the feature classes in that workspace (output from split by attributes). The iterator would run that select by attributes query for each feature class (which Richard supplied earlier) -> Export to new feature classes -> Collect values -> Merge. This kinda stuff is where you'd really want Python instead.
... View more
01-09-2024
10:29 AM
|
1
|
0
|
4773
|
| 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 |
2 weeks ago
|