|
POST
|
This is driving me crazy. I used a different Python script developed in Arcmap as a framework for this new script for use in ArcGIS Pro. The script is pretty basic- the user specifies two polygon layers and the script loops through all features in the first layer (theUnits in the script) and then does an overlap select against features in the second layer (theParcels). It then builts a unique list for values for a specific field and then populates a field in the first layer with that list of values. The script runs through to completion but the attribute field it's supposed to populate remains empty. What am I overlooking? I've been running the script through a Toolbox Script tool and choosing the two layers which are present in my map. FWIW, here's the tail end of the output pushed to the details window: ...Parcel FID List: 1502; 12075 2 parcels intersected and Trusts Encountered were: 2,42 Current ObjectID: 17482 Parcel FID List: 4656 1 parcels intersected and Trusts Encountered were: 1 Current ObjectID: 17483 Parcel FID List: 12100 1 parcels intersected and Trusts Encountered were: 1 Current ObjectID: 17484 Parcel FID List: 10375 1 parcels intersected and Trusts Encountered were: 1 Current ObjectID: 17485 Parcel FID List: 3101; 5204; 7300 3 parcels intersected and Trusts Encountered were: 1 Current ObjectID: 17490 Parcel FID List: 6957; 16736 2 parcels intersected and Trusts Encountered were: 3 Current ObjectID: 17491 Parcel FID List: 745; 3102; 4127; 5613 4 parcels intersected and Trusts Encountered were: 1 Current ObjectID: 17494 Parcel FID List: 97 1 parcels intersected and Trusts Encountered were: 3 Current ObjectID: 17495 Parcel FID List: 358 1 parcels intersected and Trusts Encountered were: 3 Current ObjectID: 17496 Parcel FID List: 97 1 parcels intersected and Trusts Encountered were: 3 Current ObjectID: 17500 Parcel FID List: 1011 1 parcels intersected and Trusts Encountered were: 3 SCRIPT SUCCESSFULLY PROCESSED 3948 SALE UNITS IN 0:19:04.009152 Here's the actual script: #==============================================================================
# Import python modules
#==============================================================================
import arcpy, os, time
from datetime import timedelta
startTime = time.time()
#==============================================================================
# Link to and establish the required layers specified in the Toolbox dialog
#==============================================================================
theUnits = arcpy.GetParameterAsText(0)
theParcels = arcpy.GetParameterAsText(1)
arcpy.AddMessage('Timber Sale Units: ' + theUnits)
arcpy.AddMessage('Parcels: ' + theParcels)
workspace = 'G:/gis/PlannedSales\/20230907/20230907_pdr_7971.gdb'
# Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(workspace)
edit.startEditing(with_undo=False, multiuser_mode=True)
# Start an edit operation
edit.startOperation()
#==============================================================================
# Now let's loop through all of the Timber Sale Units.....
#==============================================================================
theCounter = 0
totalRecordCount = arcpy.GetCount_management(theUnits)
fields = ['OBJECTID', 'tTrusts', 'SHAPE@']
with arcpy.da.UpdateCursor(theUnits,fields) as theCursor:
for row in theCursor:
#--------------------------------------------------------------------------
# Step 1: Unselect all applicable overlay themes & reset any variables ----
#--------------------------------------------------------------------------
arcpy.SelectLayerByAttribute_management(theUnits, "CLEAR_SELECTION")
curTrustList = []
theCounter = theCounter + 1
#--------------------------------------------------------------------------
# STEP 2: Get the current sale unit shape ---------------------------------
#--------------------------------------------------------------------------
if (theCounter % 100 == 0):
curTime = time.time()
totalTime = curTime - startTime
totalTimeFormatted = "{:0>8}".format(str(timedelta(seconds=totalTime)))
arcpy.AddMessage("{0} of {1} records processed (elapsed time: {2})..".format(theCounter,totalRecordCount,totalTimeFormatted) )
curObjectID = row[0] #OBJECTID
arcpy.AddMessage('Current ObjectID: ' + str(curObjectID))
#--------------------------------------------------------------------------
# STEP 4: Perform an overlap select against the Stands Polygons -----------
#--------------------------------------------------------------------------
SelPoly = arcpy.SelectLayerByAttribute_management(theUnits, "NEW_SELECTION", "\"OBJECTID\" =" + str(curObjectID))
SelectedFeatures = arcpy.SelectLayerByLocation_management(theParcels, "INTERSECT", SelPoly)
matchcount = int(arcpy.GetCount_management(SelectedFeatures)[0])
desc = arcpy.Describe(SelectedFeatures)
arcpy.AddMessage('Parcel FID List: ' + desc.FIDSet)
trustFields = ['TIMBER_TRUST_CD', 'SHAPE@']
with arcpy.da.SearchCursor(SelectedFeatures,trustFields) as parcelCursor:
parcelCounter = 0
curList = []
for parcelRow in parcelCursor:
parcelCounter = parcelCounter + 1
curList.append(parcelRow[0])
curUniqueList = list(set(curList))
theTrustList = ",".join(str(element) for element in curUniqueList)
arcpy.AddMessage(str(matchcount) + ' parcels intersected and Trusts Encountered were: ' + theTrustList)
row[1] = theTrustList
theCursor.updateRow(row)
# Stop the edit operation.
#edit.stopOperation()
# Stop the edit session and save the changes
#edit.stopEditing(save_changes=True) # <== Throws error if uncommented: 'Cannot acquire a lock'
endTime = time.time()
totalTime = endTime - startTime
totalTimeFormatted = "{:0>8}".format(str(timedelta(seconds=totalTime)))
arcpy.AddMessage("\n\nSCRIPT SUCCESSFULLY PROCESSED {0} SALE UNITS IN {1}\n\n".format(totalRecordCount, totalTimeFormatted) )
... View more
03-14-2024
07:07 PM
|
1
|
7
|
2853
|
|
POST
|
Oh, hey, it's nearly 3 years later and this issue *STILL* exists. And Daniel is spot on- garbage like this is precisely why I'm still avoiding Pro as much as I can. Long live Arcmap. 😞
... View more
03-14-2024
03:16 PM
|
3
|
0
|
1474
|
|
POST
|
You can also bypass the Living Atlas and go here and download the data for whatever years you're interested in.
... View more
03-08-2024
08:57 AM
|
0
|
3
|
1898
|
|
POST
|
ESRI has claimed that AGO EB will achieve WAB parity by the ESRI UC this year so it remains to be seen how this will all shake out. The Dev team is maintaining this post which lists the WAB/EB widget list overview. As with all things ESRI, I'm pessimistic that they'll reach parity without removing *some* functionality under the pretense of progess. Oh, and add 6 months to the specified timeline if you're using Portal EB as it is the last product the chain to receive updates.
... View more
03-01-2024
08:45 AM
|
3
|
2
|
5615
|
|
POST
|
In the properties of the Data Frame, on the General Tab, play with specifying a reference scale. This is what impacts symbology size when printing or exporting.
... View more
02-29-2024
11:27 AM
|
1
|
1
|
2192
|
|
POST
|
You need to look at your dataset and verify that your "date" field is actually defined as a date field. Based on what you're describing, the date field may actually just be a text field with dates stored in it. That won't work for date orientated widgets. In Portal / AGOL, you can go to your hosted feature layer and look at the Data section and field information. You should see the word Date as the field type: portalDateFieldExample.jpg Alternatively, you can go to the REST endpoint of the service and confirm it the same way: restDateFieldExample.jpg
... View more
02-16-2024
02:59 PM
|
1
|
0
|
2713
|
|
POST
|
Yeah, I'm afraid this is outside my area of expertise as well. I thought I'd give the url a try just to see if it would work for me but nope. Interesting thing, though- I tried the link via my work computer and it bonked. I tried the link through my personal phone browser and I was able to get to the REST url. I have no idea how to remedy this but perhaps it's related to network security in the workplace.
... View more
02-08-2024
02:00 PM
|
0
|
0
|
2961
|
|
POST
|
I get the same error you mentioned when I tried adding it to a blank map so it appears to me that the service has restrictions (or the USDA server has restrictions on whom can access it).
... View more
02-08-2024
01:36 PM
|
0
|
3
|
2998
|
|
IDEA
|
Currently if you publish a web layer to be hosted within Portal, it just goes into one gigantic trash can of published layers. It would be great if there was some ability to create structure and organization with the Hosted layers folder. Our organization has taken all of our official layers and published them as hosted layers using the same naming convention that we use within SDE. This is great as it provides a similar browsing experience in the REST directory but if I publish additional layers, they get inserted and break up the order due to alphabetization. It would be far cleaner and easier to find a specific hosted layer if there were subfolders (Planning, Public Works, etc). Anyways, structure from chaos.
... View more
02-05-2024
08:16 AM
|
12
|
2
|
1313
|
|
IDEA
|
If you haven't seen this, the Solutions team looks like they will be releasing a sidewalk management solution later this year (blog link). This topic is really outside my normal duties but about 3 years ago, I was wrangled into building a public facing app that would show the public our ADA inventory information. I just rebuilt it with Experience Builder because of forced migration (thanks ESRI) and you can poke around in it here: https://gis.snoco.org/portal/apps/experiencebuilder/experience/?id=f1d7bd5e44ae466c953994a37c074128 The data in this application is old and kind of severed from the current workflow. We need to reconcile this and incorporate the new information but there's only so much I can do as I have to force migrate several apps before my IT shuts down our original Portal instance at the end of this month. Anyways. as I attempt to recall how this worked, the staff that were doing the inventory may still have been doing clipboard attribute collection and using a consumer level GPS for some field data collection. All the data was actively maintained in a file geoDatabase and I had a cut pulled out and published publicly in order to build the original WAB application. Since that time, my organization has adopted an asset management system (Cartegraph) and now the ADA inventory information is being captured in there so field staff are using tablets to capture location & attribute information and it's all stored in there. Because of the drastic change, the current workflow has been "date forward" and doesn't contain that historical stuff yet. I've been told there are some issues about duplicate features with respect to merging old and new data but I'm not really clear on that part. Not super helpful but I'll help get the ball rolling with discussion.. 🙃 Steve
... View more
02-01-2024
01:38 PM
|
0
|
0
|
4004
|
|
POST
|
Yes and no..Within the default Map Viewer interface, there isn't a way. The most direct way I can think of is if you have access to the REST endpoint of the map service. You can query against the service with a WHERE clause (OBJECTID=77 or TYPE='Active' etc) and have the REST query return the results in JSON format. Then you can copy/paste the JSON into a text file and then import it back into desktop GIS using the geoprocessing tool for JSON to Feature.
... View more
02-01-2024
11:04 AM
|
0
|
0
|
1912
|
|
POST
|
I don't have a specific workflow to share but, in 3.X API based apps (classic web map, WebApp Builder apps, etc), once the ESRI map is loaded it was possible to convert the map layer of interest to JSON. Feature layers had a method called toJson and I have successfully used this to extract a layer from a map where the REST endpoint was not directly accessible. You would open the web developer tools of your browser, and then access the map object using the console line input and have the JSON dump out to the console. Once you had that, copy/paste that into a new text document with a JSON file suffix and then you could proceed like you described. I'm not sure if the 4.x API has an equivalent method to call.
... View more
01-31-2024
02:54 PM
|
0
|
0
|
2672
|
|
POST
|
That was the issue. Our admin tweaked the setting and the symbol finally shows up. Thanks!
... View more
01-30-2024
01:14 PM
|
0
|
0
|
2084
|
|
POST
|
I'll need to check on that. Which is the desired setting?
... View more
01-30-2024
12:31 PM
|
0
|
1
|
2105
|
|
POST
|
Working in Portal 11.1 and I want to access a custom symbol in my web map so I have followed the process as outlined here in the help doc: https://pro.arcgis.com/en/pro-app/3.1/help/sharing/overview/share-a-web-style.htm On the Admin side, I have asked my admin to enable the 2D symbol group as discussed here: https://enterprise.arcgis.com/en/portal/11.1/administer/windows/configure-map.htm The symbol group my admin enabled shows up under the organization group section and I am a member of it. I have shared my style to the organization but the symbol group does not show up under the group sharing section. Where is the disconnect? How do I get the symbol group to show up in the group sharing section?
... View more
01-30-2024
11:58 AM
|
1
|
4
|
2171
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | 4 weeks ago |