Hi everyone!
I am trying to follow a tutorial using arcade to find a list of points near a polygon (https://learn.arcgis.com/en/projects/build-an-app-to-expand-food-access/ in the "Stores near markets" section), except with different data and in arcgis pro. For the FeatureSetById to work for my layer, I need a layer ID. How do I find it in ArcGIS pro?
I followed the steps to assign a layerID (https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/assign-layer-ids.htm) but I ended up with a layer ID of "2" and it didn't work.
If this layer ID doesn't exist/work in ArcGIS pro, how else would I be able to use arcade to find a list of points near/within a polygon?
code sample from the tutorial:
var retail_layer = FeatureSetById($map, /* SNAP Store Locations */ "178f065ba89-layer-82")
var radius = Buffer($feature,.75,"miles")
var nearby_stores = Intersects(retail_layer,radius)
var retail_list = ''
for (var k in nearby_stores){
retail_list += k.Store_Name + TextFormatting.NewLine
}
return retail_list
my polygon layer: https://naturalengland-defra.opendata.arcgis.com/datasets/national-parks-england/explore?location=55...
my points layer: gis_osm_transport_free_1.shp from the shapefile zipped folder here http://download.geofabrik.de/europe/great-britain/england.html
To find the layerID of a layer in ArcGIS Online that is being used in Pro, one way to do this is to look at the last part of the path when adding the layer, as in the screenshot here:
You might not need to use Arcade though, if you're working in Pro. Pro has select by location. You can select the points that fall within the polygon that way.