Hello,
I am working in Portal and I have three layers that I want to function together to provide more information in a popup. The layers include:
Project Boundary (polygon)
Parcel Boundary (polygon)
Wind Turbines (points)
First I want to filter the parcel boundary layer down to only those that are signed leases ("PRCL_STAT_CD = 'LSE'"). Then, when I click on a project boundary, I want the popup to display how many wind turbines fall on signed lease parcels within that project.
Theoretically, I envision this working with the expression:
Count(Intersects(Turbines, Intersection(Parcel Boundary, $feature)))
with some additional variables defined, but depending on how I write it I receive the error either "Illegal Argument" or "Spatial Relation cannot accept this parameter type"
There is also a common project name field between the Parcel Boundary and the Project Boundary which I thought maybe I could use to filter the parcels rather than perform an intersection but I can't figure that out either.
Here is my expression currently. If someone could please tell me where I am going wrong I would appreciate it!
var turbines = FeatureSetByName($map, "Preferred Array")
var parcels = FeatureSetById($datastore, /* Prospecting - Status */ "53")
var projname = $feature["PROJECT_NAME"]
var projparcels = Filter(parcels,"PROJ_NM = @projname")
var LSEparcels = Filter(projparcels,"PRCL_STAT_CD = 'LSE'")
Count(Intersects(turbines,LSEparcels))