Hello,
I have a road line feature class and a city township unit polygon feature class. One of the requirements of the line feature class is that I need to correctly identify which polygon is on either side of the line. The closest solution I found thus far makes the assumption that the line is strait. However, it is very possible that the line could be curved as well.
There are a couple ways that I could perform this, but I don't know how to implement these solutions.
This should be very similar to the calculate adjacent fields, except it should identify values to the right or left of a line.
Thanks for any help!
Solved! Go to Solution.
I just figured this out the other day. You can use the Offset function in Arcade. Here's the code that I use to calculate the neighborhood on the left-side of a road segment.
//Set the neighborhood dataset, selecting only the neighborhood name field.
var fsNbrhd = FeatureSetByName($datastore, "GIS.DBO.Neighborhood", ["nbrhdname"])
//Specifies the left-side of the road. If the offset is greater than 0, it will be the right-side.
var RoadLeft = offset($feature, -1, 'feet', 'square')
//Selects the neighborhood polygon on the left-side of the road.
var fsNbrhdLeft = Intersects(fsNbrhd, RoadLeft)
//Returns only the first intersecting polygon, in case there are overlaps.
var NbrhdLeft = First(fsNbrhdLeft)
if(NbrhdLeft == null) return null
//Returns the name of the first intersecting neighborhood polygon on the left-side of the road segment.
return NbrhdLeft.nbrhdname
Suggest you look at this thread.
Anyone find a solution/calculation for this? I located a rule attribute in the Address Data Management Solution, but it is not working.
I just figured this out the other day. You can use the Offset function in Arcade. Here's the code that I use to calculate the neighborhood on the left-side of a road segment.
//Set the neighborhood dataset, selecting only the neighborhood name field.
var fsNbrhd = FeatureSetByName($datastore, "GIS.DBO.Neighborhood", ["nbrhdname"])
//Specifies the left-side of the road. If the offset is greater than 0, it will be the right-side.
var RoadLeft = offset($feature, -1, 'feet', 'square')
//Selects the neighborhood polygon on the left-side of the road.
var fsNbrhdLeft = Intersects(fsNbrhd, RoadLeft)
//Returns only the first intersecting polygon, in case there are overlaps.
var NbrhdLeft = First(fsNbrhdLeft)
if(NbrhdLeft == null) return null
//Returns the name of the first intersecting neighborhood polygon on the left-side of the road segment.
return NbrhdLeft.nbrhdname
Thanks for posting that! That's a clever way of doing it. This is going to be so helpful.