Select to view content in your preferred language

Geometry functions not working.

148
1
07-17-2024 10:36 AM
ClintHewlett
New Contributor

I am trying to use Arcade to check if an address point falls within various types of zoning polygons and if so, display some info about said polygons in its popup. The issue I am having is that functions like Intersects(), Within(), and Contains() do not seem to recognize the spatial relationship between points that are obviously intersecting, within, or contained by the zoning polygons. Its not every layer either, which is confusing me. Below is a sample of the code I am using for to both check and display the desired information:

if(Intersects(First(FeatureSetByName($map, "Historic & Design Review Areas")), $feature)){
  return First(Intersects($feature, FeatureSetByName($map, "Historic & Design Review Areas")))["DISTRICT_NAME"]
} else {
  return 'None'
}
 
I have read around the board and has seen multiple reports of these types of functions not functioning since the last update.
 
My questions are:
 
1) Could this be a result of the update?
 
2) Are there certain configurations of layers that do not work well with geometry functions that would cause these functions to return false 100% of the time?
 
3) Is there a better way to approach checking the spatial relationship of a point and a polygon?
0 Kudos
1 Reply
AlixVezina
Esri Regular Contributor

Maybe try defining variables first? You'll find some code samples here, one of them being for Intersect: From the Smart Editor to Smart Forms (esri.com)

 

0 Kudos