Is there a way to filter in AGO to show just point features in one layer that overlap a different polygon layer?

1424
1
11-21-2020 06:01 PM
Labels (1)
Bob_Spaulding
New Contributor III

Hi -

Based on my knowledge and searching, I believe the answer to this question is no, but if someone can show otherwise, that'd be much appreciated.

I'm wondering if there's any way currently within ArcGIS Online to dynamically filter records (or query, or whatever language you wish to use) within one point layer based on whether or not those points fall within another polygon layer, also on the same map?

Seems like Arcade gets close, but we can't quite get there: the standard filter function in a webmap doesn't allow me to draw on the Attribute Expressions I define in the Attribute Expressions I created within the Configure Pop-Up window.

If the answer is indeed this cannot be done now in AGO, what is the next best way to approach this?  To have a model that runs at routine intervals (ie daily) on an in-house server, and then draw on those layers in my webmap?

0 Kudos
1 Reply
jcarlson
MVP Esteemed Contributor

The short answer is "no", there's no off-the-shelf means of doing this. However, I could see the following method working:

  1. Create a field on your points layer called "intersected polygon". If your polygons have a globalid, you could make this a GUID field.
  2. Create an attribute-based join between the two layers. Per the Join Features docs, an attribute-based join can be saved as a "view" in which the resulting layer updates along with the input layers.
  3. Create a python script which runs a field calculation on the "intersected polygon" field, grabbing the globalid of the first intersecting polygon shape.

Scheduling the script to run at regular intervals would keep the field up-to-date, and then the view layer can be filtered to keep out non-intersected points, i.e., those with null values in the new field.

It's not the best or most direct method, but it would work. I should say that this is specific to hosted layers. Are either of the layers on an enterprise geodatabase by chance? There are more effective means of doing this if so.

- Josh Carlson
Kendall County GIS
0 Kudos