Arcade Point Intersect Polygons to symbolize/filter

2015
5
07-02-2021 03:59 PM
rpeters17
New Contributor II

General Info

  • I have point rest service layer titled "dams" (National Dam Inventory). It contains the location of dams for every state in the U.S.
  • I have a hosted polygon layer titled "basin". It represents the Savannah River Basin.
  • My ultimate goal is to only show the dams that are within the river basin. I feel like I'm close using my current code but I might be wrong. Is what I'm attempting possible, is my code headed in the right direction, or is there a better way to do this?
  • Please let me know if there is any other information I can provide, kind regards and thanks

 

Current Attempt

1 var intersectLayer =Intersects(FeatureSetByName($map,"basin"), $feature)
2 for (var f in intersectLayer){
3 return f.FID
4 }

  • This expression is built on the point data and called "Filter"
  • The basin polygon only has one field (FID) and their is only one shape so the above arcade returns "1" for points inside the polygon and " " (blank) for points outside the polygon. I guess my question is how can I symbolize on this?

rpeters17_0-1625266832141.png

 

  • rpeters17_0-1625266162783.png

     

0 Kudos
5 Replies
DavidPike
MVP Frequent Contributor
Intersection(FeatureSetByName($map,"basin"), $feature)
0 Kudos
jcarlson
MVP Esteemed Contributor

Sorry to rain on your parade, but the Visualization Arcade Profile does not even support accessing other features in the same layer, let alone features in a separate layer in your map. You can only reference a feature's own attributes and the current $view.scale for visualization.

That's not to say that this isn't possible, however. Do you have ownership or editing rights over the National Dam Inventory layer? There are a couple of ways you might do this, but they rely on either being able to create a view layer or add a new field.

- Josh Carlson
Kendall County GIS
rpeters17
New Contributor II

 I'm relatively new to Arcade so I'm not sure what it's limitations are. I was able add the FID# from the basin layer (polygon) to the attribute table of the dams (points) that intersect it using the attribute expression (see image below). At this stage only the the dams that I want to show have the "1" in the "filter" field. I was hoping to use this to have different symbology between the points in and out of the polygon or to filter out the points outside of the polygon altogether. Are you saying this last step is not possible? Unfortunately I don't have ownership/editing rights for the layer. Thanks @jcarlson

rpeters17_0-1625527215184.png

 

0 Kudos
jcarlson
MVP Esteemed Contributor

Just to clarify: is that "Filter" field pictured just coming from a pop-up expression, or is it a real field that was created with Field Calculate or something? When you say that you were able to "add the FID" from the basins, are you referring to the Arcade expression in your original post, or have you actually performed a spatial join?

The symbology settings in a web map can only reference a real field in the table, or an expression. If it's an expression, the expression itself can only reference other attributes in the same row of the table.

- Josh Carlson
Kendall County GIS
rpeters17
New Contributor II

Thanks jcarlson. I see what you're saying now. The "FID" was added using the Arcade expression in the original post. No spatial join or field calculation was done. That's a bummer. I had really hoped that there was a way to spatially filter a web service down to an area of interest without breaking the link to the service.

0 Kudos