There is a hosted feature layer that ESRI produces of Live Stream Gauges (https://www.arcgis.com/home/item.html?id=81c5a9f2a2704d54a49042a44eefa5d3 ) with just under 30,000 gauges from around the world which is updated hourly. I've set up a Dashboard to help show what areas are flooding in my specific Area of Interest (My AOI has 515 gauges). The extent of my AOI is not a regular square/rectangle, so no basic extent filtering. To give you a sense of my AOI it covers several portions of some states but not entire states. I'm not an Admin of that data so cannot create Hosted Feature Views.
I created a local copy of the data that I can match as Layer Actions in my Dashboard for lists of Gauges in my AOI (so folks can select which hydrograph they want to see). Though I can't figure out a way to filter the Live Stream Gauges to only show the 515 gauges my work cares about. Also, without this filtering the Indicators for Major Flooding or Minor Flooding include gauges in the same states as my AOI but outside my AOI itself
I've tried many workarounds and the best one seems to be moving it all to AGOL and using Data Expressions or Arcade to limit either the features shown in the map or in each individual indicator. I'm coming across an issue with my Arcade in an Indicator (I've removed several of the coordinates for brevity) :
var outerGeom = Polygon({
"rings": [ [[-73.95324012956144,40.122201568981296],
[-71.82532762791266,40.98483831123638],
[-71.92829333485861,41.2400142610767],
[-73.61331393113787,40.94986225060882],
[-74.533824004194,40.99513394964706],
[-75.01685781914264,40.66418261919473],
[-74.78762813590278,40.31578492218021],
[-73.95324012956144,40.122201568981296]] ],
"spatialReference": { "wkid": 4617 }
});
Count( Within(outerGeom, $layer));
return {
//textColor:'',
//backgroundColor:'',
//topText: '',
//topTextColor: '',
//topTextOutlineColor: '',
//topTextMaxSize: 'medium',
middleText: $datapoint["count"],
middleTextColor: '',
middleTextOutlineColor: '',
middleTextMaxSize: 'large',
//bottomText: '',
//bottomTextColor: '',
//bottomTextOutlineColor: '',
//bottomTextMaxSize: 'medium',
//iconName:'',
//iconAlign:'left',
//iconColor:'',
//iconOutlineColor:'',
//noValue:false,
//attributes: {
// attribute1: '',
// attribute2: ''
// }
}
I keep getting the error "Parse Error:polygon is not available" when I click on Test. Any ideas?
(Alternately any other ideas on how to filter/clip/mask the gauge points to my AOI in the map itself which would solve this issue.)