I am working on an Arcade script that will use a parcel layer to intersect with a zoning layer and return the zoning that intersects with the parcel. I have successfully gotten the two layers to intersect and return the zoning, the issue is that the data is not clean, so I need to return the value that intersects with the center of the parcel. My code looks like this:
Solved! Go to Solution.
Simple enough. I am guessing that the parcel intersects multiple zoning layers and rather than getting the zone with the greatest area of intersect it returns the first record of whichever zone intersects. Here is one option that will work for your given situation.
var other_layer = FeatureSetByName($map, "Zoning Layer", ["Zoning"])
var IntF = Intersects($Feature, other_layer)
var MI = Max( IntF, 'shapeareafield' )
var F = First(Filter(IntF,'shapeareafield = @M' ))
iif( TypeOf( F == 'Feature', F["Zoning"], $feature.Zoning )
/*
Option 2
var other_layer = FeatureSetByName($map, "Zoning Layer", ["Zoning"])
var F = First(Intersects(Centroid($Feature), other_layer))
iif( TypeOf( F == 'Feature', F["Zoning"], $feature.Zoning )
*/
Another would be to use the 'Centroid' function to turn your polygon to a point and get the intersecting value that way.
Simple enough. I am guessing that the parcel intersects multiple zoning layers and rather than getting the zone with the greatest area of intersect it returns the first record of whichever zone intersects. Here is one option that will work for your given situation.
var other_layer = FeatureSetByName($map, "Zoning Layer", ["Zoning"])
var IntF = Intersects($Feature, other_layer)
var MI = Max( IntF, 'shapeareafield' )
var F = First(Filter(IntF,'shapeareafield = @M' ))
iif( TypeOf( F == 'Feature', F["Zoning"], $feature.Zoning )
/*
Option 2
var other_layer = FeatureSetByName($map, "Zoning Layer", ["Zoning"])
var F = First(Intersects(Centroid($Feature), other_layer))
iif( TypeOf( F == 'Feature', F["Zoning"], $feature.Zoning )
*/
Another would be to use the 'Centroid' function to turn your polygon to a point and get the intersecting value that way.
Thank you! This works great!
You're welcome.