|
POST
|
I have a district lookup widget for school attendance zones. These show up as menus that display custom popups based on conditional Arcade expressions from the district layer. Is it possible to have information from a related but separate layer show up below these district boundary menus on the widget? This would be utility information for the address. Is this something I could accomplish with an Arcade expression? For example:
... View more
04-08-2019
09:21 AM
|
1
|
2
|
920
|
|
POST
|
I have a district lookup widget for school attendance zones. These show up as menus that display custom popups from the district layer. Is it possible to have information from a related but separate layer show up below these district boundary menus on the widget? This would be utility information for the address. Is this something I could accomplish with an Arcade expression? For example:
... View more
04-05-2019
04:21 PM
|
1
|
0
|
463
|
|
POST
|
OK. I finally found them under view definition. I shouldn't have to dig down into the depths to find attribute fields. Way too convoluted. Perhaps AGOL could prompt you when the webmap is opened "New fields have been added to some of your hosted layers, would you like to include them in the map?"
... View more
04-04-2019
02:02 PM
|
0
|
0
|
504
|
|
POST
|
This is driving me crazy. I'm adding fields to my Portal/AGOL hosted layers. These changes do not reflect in the public layers in my web map. I have editing enabled, I've save the project in Pro, I've refreshed the Portal, nothing. I've also tried joining fields between the hosted and public layers and it failed.
... View more
04-04-2019
12:04 PM
|
0
|
2
|
608
|
|
POST
|
OK, but how can I simplify my script to avoid this? I see you're not selecting a layer by attribute before your copy and project steps.
... View more
04-02-2019
01:31 PM
|
0
|
1
|
1205
|
|
POST
|
That's not what is happening at all. The exclude list is buildings (sites) from within the single feature class (Rooms_w_Space_ID_AllSites_Proj), which is nearly 100 buildings. All this list does is specify which buildings to skip over, it has nothing to do with the room copies. I just used generic names in the example, but there are over a dozen buildings excluded. Nowhere in the script do I specify a copy of the main feature class. This is happening inside Pro in the TOC when this script is run from the Python window. I'll explain again: each room from each building is selected from the main feature class (Rooms_w_Space_ID_AllSites_Proj). This selection is copied as a feature, projected, analyzed and then all these steps are deleted. Next room, repeat. What's building up in the TOC are numbered copies of the main feature class (which shouldn't be happening at all). It's happening every single time that a room from the feature class is copied and projected to the central meridian of the room. There is something going on with the project tool in Pro. The photo above just shows the results of one iteration of this. There are thousands of these copies building up in the TOC as the script runs (see photo from my initial post).
... View more
04-02-2019
12:27 PM
|
0
|
3
|
1205
|
|
POST
|
Yes, I was executing it in the Python window because it was faster, for a while. I just went back to running it in IDLE. Here is a truncated version of the script: import arcpy
import os, sys
import time
from datetime import date, timedelta
output_gdb = r'M:\\PROJECTS\\Projects_2018-19\\Map Requests\\Room Capacity Analysis\\room_capacity.gdb\\'
scratch_gdb = r'M:\\PROJECTS\\Projects_2018-19\\Map Requests\\Room Capacity Analysis\\scratch.gdb\\'
memory_hole = r'in_memory\\'
arcpy.env.workspace = scratch_gdb
arcpy.env.overwriteOutput = True
arcpy.env.outputZFlag = "Disabled"
#arcpy.env.addOutputsToMap = False
fc = output_gdb + r'Rooms_w_SpaceID_AllSites_Proj'
site = ""
room = ""
area_per = ""
exclude_list = ["BUILDING_A","BUILDING_B"]
sql_string = "WHERE UsableSF > 300 "
print("Starting at " + str(datetime.datetime.now()))
with arcpy.da.SearchCursor(fc, '*' ,sql_clause=(None, sql_string)) as cursor:
for row in cursor:
OID_field = arcpy.Describe(fc).OIDFieldName
site = row[8]
room_number = row[9]
usable_square_footage = row[7]
space_class = row[11]
spatial_ref = row[21]
if site in exclude_list:
continue
else:
start_time = time.time()
site_no_space = site.replace(' ','_')
room_no_space = room_number.replace(' ','_')
site_no_dash = site_no_space.replace('-','_')
site_no_dot = site_no_dash.replace('.','_')
room_no_dash = room_no_space.replace('-','')
room_no_dot = room_no_dash.replace('.','')
room_feature = memory_hole + site_no_dot.lower() + '_room_' + room_no_dot
room_feature_proj = site_no_dot.lower() + "_room_" + room_no_dot + "_proj"
where = '{0} = {1}'.format(arcpy.AddFieldDelimiters(fc,OID_field),row[0])
selection = arcpy.SelectLayerByAttribute_management(fc,"NEW_SELECTION",where) # select the current room feature
arcpy.CopyFeatures_management(selection,room_feature) # output room to new feature class
arcpy.Project_management(room_feature, scratch_gdb + room_feature_proj, spatial_ref)
## get room extent for grid
description = arcpy.Describe(room_feature_proj)
extent = description.extent
thex_grid = memory_hole + room_feature_proj + "_thex_grid"
area_per = "30 SquareFeet"
footage = int(area_per[:3])
## generate transverse hexagon grid polygon
arcpy.management.GenerateTessellation(thex_grid, extent, "TRANSVERSE_HEXAGON", area_per, spatial_ref)
## Search for grid squares that fall completely within the room
new_selection = arcpy.management.SelectLayerByLocation(thex_grid, "COMPLETELY_WITHIN", room_feature_proj, None, "NEW_SELECTION", "NOT_INVERT")
count = arcpy.GetCount_management(new_selection)
arcpy.AddField_management(room_feature_proj, "SQFT", "SHORT", 3, "", "", "SQFTPerStudent", "NULLABLE", "REQUIRED")
arcpy.CalculateField_management(room_feature_proj, "SQFT", footage, "PYTHON_9.3")
arcpy.AddField_management(room_feature_proj, "Count", "SHORT", 3, "", "", "OperationalCapacity", "NULLABLE", "REQUIRED")
arcpy.CalculateField_management(room_feature_proj, "Count", count, "PYTHON_9.3")
elapsed_time_secs = time.time() - start_time
msg = "Execution time: %s" % timedelta(seconds=round(elapsed_time_secs))
print(msg)
arcpy.Append_management(room_feature_proj, output_gdb + "\\rooms_with_operational_capacity","", "","","")
del cursor
... View more
04-02-2019
10:12 AM
|
0
|
8
|
1205
|
|
POST
|
OK, but I still think there there is a bug here. There should not be extra copies of the original feature class clogging up the TOC.
... View more
04-01-2019
10:12 AM
|
0
|
1
|
1640
|
|
POST
|
The solution was to delete the district lookup app and start over.
... View more
03-29-2019
04:24 PM
|
0
|
0
|
664
|
|
POST
|
I'm working with the School Locator ArcGIS Solutions deployment WAB. I'm trying to edit the District Lookup Widget and I'm banging my head against the wall. First, I have the "School District" layer set up with attendance boundaries for elementary, middle and high schools. When I geolocate an address, three menus pop up in the widget that zooms to and displays these three different boundaries. Great. The problem is, these menus are blank. How do I label them?? They are useless if people don't know to click on them. Second, I cannot figure out how to edit the popup in the district locator widget. I have a popup defined in my schools points layer. I disabled the popup for the school district layer, yet the boilerplate popup expression from that layer remains. No matter how I configure the popups in either layer, this is what I see: I want this to display the school name, address and website as it does in the point layer popup. (I've blurred out the particulars) I see this on the district lookup widget ESRI page: Note: The widget uses the pop-up defined in the map on the Information tab. You can enable one or both layers to have pop-ups. Whatever is defined will be displayed on the Information tab. Where is the information tab? On the web map feeding the WAB? I cannot find it.
... View more
03-29-2019
01:21 PM
|
0
|
1
|
815
|
|
POST
|
It's not removing them from the TOC, but the scratch.gdb. Pro is adding these copied layers to the TOC during the analysis, and then they are removed once they're deleted from the geodatabase. I'd rather they aren't added to the map at all, but due to that bug, I can't control it. To reiterate: I have one feature class with nearly 100 buildings that's been converted from CAD. The script goes through each building, copies out each room, runs analysis, and moves on to the next room. What's building up in the TOC is unexplained copies of the original feature class (see photo above) that are happening in tandem with the room feature copy. That is a feature class with 12400+ rows copied over and over again in the TOC. I believe it's clogging up the memory and slowing the Python script way down. Update: I believe this is a problem with the Project tool. I just tried to write the interim steps to memory and got this ERROR 000944: Output feature class cannot be in the in_memory workspace. Failed to execute (Project). Here is a better illustration of what's happening. The bottom feature is the original, the top feature is a single room that's been copied (based on an attribute selection from the main feature) and projected to the coordinate system based on the central meridian of the room. The middle feature is the copy of the original that remains in the TOC. Its source is identical to the main feature class, so I believe it's just being copied in memory by Pro.
... View more
03-28-2019
01:29 PM
|
0
|
13
|
1640
|
|
POST
|
No, MakeFeatureLayer is not part of the script. It's peeling off and copying individual rooms from buildings, generating a tessellation for the room, select by location to count the hexagons and then moving on to the next room. All of those interim steps are deleted each time. The problem is, every time there's a copy of a room, another copy of the main feature class (all the buildings) is created in the TOC with a number at the end. That's filling up the TOC, and as far as I can tell, slowing the script down. When it starts, it's taking 40-45 seconds per room. After several hours it's up to around 3 minutes. Has anyone seen that happen before? It's very strange. Would creating the copies in memory solve this issue?
... View more
03-28-2019
12:31 PM
|
0
|
0
|
1640
|
|
POST
|
I have a script that copies thousands of features, performs analysis and then deletes the copies. When I run this script in the Python window in ArcGIS Pro 2.3.1, each feature is copied and displayed in the TOC (ex. feature_new), and then is deleted. However, each time this happens, another copy with the original feature name and a number (ex. feature_old26) is created in the TOC, and remains after the script moves on to the next feature. So I have thousands of these in the TOC (see photo). If I use arcpy.env.addOutputsToMap = False in the script, the script immediately fails on copy features. ERROR 000732: Input Features: Dataset feature_old26 does not exist or is not supported. I know that this particular bug was logged almost a year ago (BUG-000116163), but I can't find any information about it. The issue I have with this is that it's dramatically slowing down the Python script execution over time as hundreds or thousands of features build up in the TOC. I would run it in standalone IDLE, but for some reason it's faster in the Python window at first.
... View more
03-28-2019
08:46 AM
|
0
|
18
|
3239
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-08-2019 09:21 AM | |
| 1 | 04-05-2019 04:21 PM | |
| 2 | 04-01-2019 10:11 AM | |
| 1 | 03-22-2019 09:30 AM | |
| 1 | 05-16-2019 08:42 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|