Update Attribute of Intersecting from Point of Various Feature Classes Within the Same Geodatabase

892
5
04-07-2021 12:02 PM
MelissaSalich
Occasional Contributor

I'm looking for help with Arcade to get the fsPoint from a variety of feature classes.

I have storm pipes that would be snapped to catch basins, manholes, or outfall points.

What expression should I be using to pull from my Stormwater Feature Dataset within my geodatabase?

Pro 2.6, geodatabase environment.

 

var g = Geometry($feature);

var fromPointGeometry = g.paths[0][0];

var fsPoint = FeatureSetByName($datastore, "swCatchBasin", ["FACILITYID"], false);

var fromPoint = First(Intersects(fsPoint, fromPointGeometry ) )

if (fromPoint == null) return -1;

return fromPoint.FACILITYID;

 

 

Tags (2)
0 Kudos
5 Replies
JoeBorgione
MVP Emeritus

In this post I provide an arcade attribute rule: is that what you are asking for?

That should just about do it....
0 Kudos
GISUSER6
New Contributor III

I am actually looking to make a rule for the same exact reason. I need a FromStructure and ToStructure Rule that intersects three different layers (catchbasins, inlets, and manholes). My thought was to set up the "fromPoint" variable to include the intersection of all three but I have been unsuccessful so far. @MelissaSalich were you ever able to create a rule to accomplish this? My code looks almost identical to what you have above to get started with just one intersection. 

 

@JoeBorgione I do not think that rule helps this situation. We need a rule that will allow for the intersection of all three since the storm main connects to storm manholes, inlets, and catchbasins. Any more insight would be very helpful!

0 Kudos
GISUSER6
New Contributor III

Hi @MelissaSalich , 

 

Not sure if this is helpful or not but I was able to come up with a workaround solution with multiple attribute rules until a single attribute rule is figured out. See Here 

0 Kudos
Melissa_Salich
New Contributor II

I worked with ROK Technologies to get this worked out. 
This example is for a stormwater feature dataset.

var fsPoint4 = FeatureSetByName($datastore, "swCleanOut", ["FACILITYID"], false);

var fsPoint5 = FeatureSetByName($datastore, "swFitting", ["FACILITYID"], false);

var fsPoint6 = FeatureSetByName($datastore, "swNetworkStructure", ["FACILITYID"], false);

var fromPoint = First(Intersects(fsPoint, fromPointGeometry ) )

var fromPoint2 = First(Intersects(fsPoint2, fromPointGeometry ) )

var fromPoint3 = First(Intersects(fsPoint3, fromPointGeometry ) )

var fromPoint4 = First(Intersects(fsPoint4, fromPointGeometry ) )

var fromPoint5 = First(Intersects(fsPoint5, fromPointGeometry ) )

var fromPoint6 = First(Intersects(fsPoint6, fromPointGeometry ) )

if (fromPoint != null) 
  return fromPoint.FACILITYID;
else if (fromPoint2 != null) 
  return fromPoint2.FACILITYID;
else if (fromPoint3 != null) 
  return fromPoint3.FACILITYID;
else if (fromPoint4 != null) 
  return fromPoint4.FACILITYID;
else if (fromPoint5 != null) 
  return fromPoint5.FACILITYID;
else if (fromPoint6 != null) 
  return fromPoint6.FACILITYID;
else
  return -1;

 Hope this helps!

GISUSER6
New Contributor III

Wonderful! Thanks for sharing!

0 Kudos