|
IDEA
|
@JeffreyThompson2 well heck I appreciate your effort, and for coming back and trying to fill me/us in. I'm going to go back to shaking my fist at Esri's lack of foresight.
... View more
10-31-2023
09:43 AM
|
0
|
0
|
2839
|
|
POST
|
Did you ever find an answer for this? I was searching for the same thing and came across your post....it just doesn't have much in it.
... View more
10-23-2023
02:33 PM
|
0
|
0
|
1234
|
|
POST
|
@jcarlson Would you have any suggestions on how to adapt this to compare what would effectively be the null part of the geometry for the non-intersecting part of feature to the intersecting part? I'm attempting this same operation on a dataset that is not wall-to-wall. The logic to handle non-intersection works fine and returns the desired value. The problem is even if a tiny part of the feature intersects a zone it brings back the value for that zone. What I would like is, if the area of non-intersection is greater than the area intersected, return the 'null' value for non-intersection. My attempt is below, where I was thinking to define it as 'if there is no intersection or if the intersected area constitutes less than half of the total area of the feature': var overlap_amount = 0
var cdfPortal = Portal("*")
var fsFHSZ = FeatureSetByPortalItem(cdfPortal, "*", 0, ['FHSZ'])
var fsFHSZIntersect = Intersects(fsFHSZ, $feature)
var areaFeature = Area($feature)
var areaFHSZIntersect = Area(fsFHSZIntersect)
if (IsEmpty(fsFHSZIntersect) || areaFHSZIntersect < areaFeature/2) {
return 0
} else {
for(var z in fsFHSZIntersect) {
var zone = Intersection($feature, z)
var zoneOverlap = Area(zone)
if (zoneOverlap > overlap_amount) {
overlap_amount = zoneOverlap
var largest_overlap = z["FHSZ"]
return largest_overlap
}
}
} A direct adaptation of your code has the same problem, as does the function/dictionary technique that I've attempted in a few variations: var cdfPortal = Portal("*")
var fsFHSZ = FeatureSetByPortalItem(cdfPortal, "*", 0, ['FHSZ'])
var fsFHSZIntersect = Intersects(fsFHSZ, $feature)
var intersected_zones = []
for(var z in fsFHSZIntersect) {
var zone = {
Zone: z.FHSZ,
Overlap: Area(Intersection(z, $feature))
}
Push(intersected_zones, zone)
}
function sort_by_overlap(z1, z2) { return z1.Overlap < z2.Overlap }
var zone = First(Sort(intersected_zones, sort_by_overlap))
return zone.Zone
if (Zone == null) {
return 0
} else {
return zone.Zone
} In the below image the result should be 0, but instead it brings up 'Moderate' (the area in yellow which it intersects slightly).
... View more
10-20-2023
02:15 PM
|
0
|
0
|
2846
|
|
POST
|
@NickSchroeder I had the exact same problem with the exact same operation throwing errors in the exact same place of the exact same helper script. The slight differenced: mine was in a loop that ingested a list of jurisdictions and then creates a view for that jurisdiction. Mine worked fine in testing, and then one day it started failing but always the third time through the loop. It would create the first two just fine, run the rest of the script, and would fail at the top of iteration three. I did not find a solution; the only thing I did was change up my test list of jurisdictions in the csv that gets ingested and then suddenly it ran through them. I'll look forward to this thread staying perfectly quiet and neither of us ever getting an explanation.
... View more
10-20-2023
12:18 PM
|
0
|
0
|
1727
|
|
POST
|
What a bummer. I found this thread because when I published a layer grouped like this in Pro.. I end up with this in AGOL.... And these are all coded value domains, wo when used in attempts at combination in AGOL it only reads them as the integer fields they are and reverts to arithmetic forms of aggregation.
... View more
10-19-2023
02:10 PM
|
1
|
0
|
3252
|
|
IDEA
|
@JeffreyThompson2 That's actually a great idea and I hadn't considered it. Thank you for sharing.
... View more
10-19-2023
09:25 AM
|
0
|
0
|
2932
|
|
IDEA
|
@JeffreyThompson2 You're right, it's possible. But it's 'possible' in the sense that it's a workaround, and far from ideal. The user experience of filtering via a list is inferior to the filter functionality that you have in dashboards. If that experience exists in dashboards, why can't it exist in experience builder?
... View more
10-19-2023
08:41 AM
|
0
|
0
|
2530
|
|
POST
|
Disregard! I found my issue - when I add the queried layer to the newly replicated maps I had a spelling error so the calculation didn't recognize it when called to the map.
... View more
10-13-2023
07:37 AM
|
0
|
0
|
1007
|
|
POST
|
I am fairly new to python and need recommendations on how to handle internal/helper function failures. I have a script that that imports a list of jurisdictions, then iterates through that list and creates a view, map, and experience builder application tailored to that jurisdiction. It's working more or less flawlessly but is routinely failing on the third iteration. And the failure happens due to an error with the arcgis\features\managers.py helper. KeyError Traceback (most recent call last)
c:\Users\user\path_to_project\script.py in <cell line: 40>()
224 for j in jList: #changed 'jurisdiction' to 'j'
225 #*Create Views
---> 226 jView = masterLayer.manager.create_view(name = j + '_view', spatial_reference = sr, tags = tagsText, capabilities = "Create,Query,Update,Delete,Editing,ChangeTracking")
227 jView.move(folder = folder)
228 jViewFLC = arcgis.features.FeatureLayerCollection.fromitem(jView)
c:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\managers.py in create_view(self, name, spatial_reference, extent, allow_schema_changes, updateable, capabilities, view_layers, view_tables, description, tags, snippet, overwrite, set_item_id, preserve_layer_ids)
2006 params["description"] = description
2007 res = gis._con.post(path=url, postdata=params)
-> 2008 view = content.get(res["itemId"])
2009 fs_view = FeatureLayerCollection(url=view.url, gis=gis)
2010 add_def = {"layers": [], "tables": []}
KeyError: 'itemId' The loop runs all the way through the first two items in the list and then fails on the third. It was running all the way through two days ago and nothing has much changed (I made some tweaks to other areas of the script, but don't think it would affect it). How do I isolate the error?
... View more
10-12-2023
09:29 AM
|
0
|
1
|
791
|
|
POST
|
@jcarlson I find this answer a little flat. You say "the edit widget there is meant for editing existing features and for creating singlepart geometries" as if wanting to create multipart features is somehow out of scope and presumptuous. I ask 'why' facetiously. Of course that's a question for the developers. And I constantly wonder with Esri's products why relatively common operations, like creating multi-part features, isn't thought of when they roll things out. 'Hard to pull off' isn't really a good excuse, seeing as there's absolutely no limitation on multi part features in a feature service itself, just the widget that allows for it.
... View more
10-11-2023
09:39 AM
|
0
|
1
|
1415
|
|
POST
|
Is it possible to create multi part features in the edit widget in Experience Builder? Can't seem to find a way. If not, why?
... View more
10-11-2023
09:07 AM
|
1
|
3
|
1433
|
|
POST
|
I have a python script that creates several views of a layer, duplicates a template map and app, and then drops the new view into that map/app. Part of the equation is an Arcade expression in the template map. In the template map it works perfectly, taking the largest overlap of an underlying layer and applying it to a field. However, after the script creates a view, duplicates the map and app successfully and imports the form this expression returns [objectObject] instead of the appropriate overlap. The expression works appropriately when tested in Arcade editor, but not when actually editing the dataset. It should be noted that two other Arcade expressions are duplicated in this process and they both execute fine (calculating the 'County' and 'Acres' fields, see image below). It's only this 'largest overlap' calculation that fails upon duplication. The original Arcade the works in the template map: //California Wldland Fire Direct Protection Areas is the layer extracted from.
//The value of of the RESPOND_ID field is then applied to the DPA_AGENCY field in the target layer.
var fsDPAIntersect = FeatureSetByName($map, "California Wildland Fire Direct Protection Areas", ["RESPOND_ID"])
var fsDPAIntersect = Intersects(fsDPAIntersect, $feature)
var intersected_DPAS = []
for(var j in fsDPAIntersect) {
var respond_id = {
RESPOND_ID: j.RESPOND_ID,
Overlap: Area(Intersection(j, $feature))
}
Push(intersected_DPAS, respond_id)
}
function sort_by_overlap(j1, j2) { return j1.Overlap < j2.Overlap }
var respond_id = First(Sort(intersected_DPAS, sort_by_overlap))
if (respond_id == null) return {"errorMessage": "Not in a DPA"}
return respond_id.RESPOND_ID The result in the template map, where it calculates appropriately: The relevant parts of the script that deal with the form: templateMapID = '' #ID scrubbed
templateMap = arcgis.gis.Item(gis, templateMapID)
workingMap = arcgis.mapping.WebMap(templateMap)
templateLayer = workingMap.layers[0]
templateLayerForm = templateLayer.formInfo
#j is the list element that's iterated on to produce the many views
#finalMap is the map created as part of the duplication process
openMap = arcgis.mapping.WebMap(finalMap)
form = openMap.forms.get(title = j + ' Comments')
form.title = 'Comment Layer Form'
form.update()
for layer in openMap.layers:
layerName = j + ' Comments'
if layerName == layer.title:
layer.formInfo = templateLayerForm
openMap.update() The duplicated map's Arcade editor: Duplicated map's results: Note how the calculations for 'County' and 'Acres' still fires appropriately. Any help would be appreciated.
... View more
10-10-2023
01:20 PM
|
1
|
1
|
1050
|
|
POST
|
@EarlMedinaI'm saying the latter: that the calculations happen for all clients. What I like about keeping the map form-based calculations is that data editors get immediate feedback - they draw/drop a feature, and the second they start filling out attribute information they get to see a lot of information that's helpful for the attribution that they're responsible for. You lose that when you have a scripted solution. Since ~85% of the users for this service will access it through a web application I would like to keep the form calculations and use either a script or webhook solution to catch up with those submitted through Pro. What I was curious about was if there was a scripting solution that, rather than acting on the features in the feature service, could access whatever the hidden triggers are in the map that cause the already-written calculations to fire. Secondarily, since I have you here, it would be very helpful if either a) attribute rules could be enabled on feature services so that, when accessed in Pro, they still operate or b) if they can't live with the feature service then perhaps the forms that live in the map could carry into Pro, so the map could be opened there and the editing and QA experiences could be consistent across clients. The magic of feature services is how portable they are...they fact that they don't port across consistently is a short-sighted.
... View more
09-19-2023
08:30 AM
|
0
|
0
|
892
|
|
POST
|
I'm looking for ideas on how to 'tickle' a web map so the form calculations will fire. The kinds of calculations I have in mind include things like querying another layer in the map and importing data from a field in that layer when a new feature is created. Currently (as far as I know) there's no way to enforce attribute rules on a feature service. Calculations can be configured in a form, which are stored in a web map. But if, say, the feature service was to be accessed in Pro and in a web map, only the features made in the web map would have their attributes calculated as desired. If a feature is created in Pro, the field won't be calculated. But if that feature is opened in the web map for editing the calculations happen. Calculations could be made entirely in Python after the fact, but I am wondering if there's a technique to nudge the webmap to execute the calculations it already has stored.
... View more
09-18-2023
01:39 PM
|
0
|
2
|
965
|
|
IDEA
|
Absolutely asinine that that this doesn't already exist. The technology clearly exists in Dashboards, how can it be so difficult to get it into Experience Builder?
... View more
09-12-2023
12:15 PM
|
0
|
0
|
2658
|
| Title | Kudos | Posted |
|---|---|---|
| 7 | 10-31-2025 09:00 AM | |
| 1 | 08-21-2025 04:41 PM | |
| 1 | 08-14-2025 01:24 PM | |
| 1 | 07-27-2025 10:25 AM | |
| 1 | 07-23-2025 11:30 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-06-2025
12:24 PM
|