Symbolize Polyline Feature based on Point Feature Values Logic If Statements

357
5
05-12-2021 07:21 AM
Labels (2)
GentryEwing1
New Contributor II

I have GeoEvent grabbing real-time status for point layer features. I am trying to develop a workflow that will give a related Polyline Feature a status based on the point layer features. I want this to be displayed in a WebMap or Dashboard I already have created.

Example:

Point A - Status = 0

Point B - Status = 1

Point C  Status = 0

Polyline A - Status = 1

Polyline B - Status = 0

I believe I can use IF statements to write code that has rules assigned to it that will change the status of the Polyline features based on those rules.

If Point A = 0, and Point B = 1 and Point C = 0, then Polyline A = 1

If Point A = 1, and Point B = 1 and Point C = 0, then Polyline A = 0

If Point A = 0, and Point B = 1 and Point C = 1, then Polyline A = 0

To my knowledge, ESRI does not support symbolizing layers based on ARCADE in the popups.  Any direction/help would be much appreciated. 

0 Kudos
5 Replies
EdJuarbe
New Contributor III

If you're not editing, you might consider creating a Query Layer to mash up the Parent and Child features.  You will have added benefit of being able to choose which shape to show on the map (Point or Line), then symbolize based on intended attribute updates.

0 Kudos
GentryEwing1
New Contributor II

I am somewhat following what you are saying, but can you explain it with a few more details please?

0 Kudos
EdJuarbe
New Contributor III

The following assumes you are using an Enterprise Database (SQL, Oracle, or other). I generally work in SQL Server Management Studio to build/test any of my queries, since the OOTB Make Query Layer tool doesn't really have a way to test the query.  Also, I'm more familiar with Desktop, but Query Layers will work in Pro as well.

But, I'll try to explain:

You want start with the relationship class (but can work with any 2 tables really):

Line Feature: SewerMains point feature class, fields 'size', 'type', 'shape', objectid
Related Point Feature: MainInspections, fields, 'date', 'status', 'shape', rel_objectid

Related fields are SewerMains.ObjectID:MainInspections.REL_ObjectID

Here's a psuedo query I'd make to mash these up:

select mi.date, sm.size, sm.type, mi.status, sm.Shape
from SewerMains as sm
join MainInspections as mi
on sm.ObjectID = mi.REL_ObjectID

When you add the above Query Layer to the map, symbolize on the status field, and publish.
Also, you can also use the inspection point shape to display the actual 'inspection point' on the map by changing sm.shape to mi.Shape (again symbolize based on the mi.status field in ArcGIS Desktop/ArcGIS Pro.

You don't need SMSS to create the query, but it allow you to see if there are any errors in the query before sliding into the map as a QueryLayer.  Once you have your query created, just copy/paste into the Make Query Layer tool, and it will show as a single layer in the map where you can symbolize, publish, add to web map, and such.

0 Kudos
VictorTey
Esri Contributor

Hi, you can build/use a view to achieve what you want.  View can be created from pro or from sql. 

select case
    when Point A = 0, and Point B = 1 and Point C = 0 THEN Polyline A = 1
    WHEN Point A = 1, and Point B = 1 and Point C = 0 THEN Polyline A = 0
    ELSE Polyline A = 1

END as status,

attribute1,

   attribute2,

from table a inner join table b on a.id = b.id

 

 

0 Kudos
EdJuarbe
New Contributor III

My previous example did not include the filters you requested.  Try this format, should get you closer to your goal:

select mi.date, sm.size, sm.type
, case when (mi.pointtype = 'A' AND mi.status = 0) AND (mi.pointtype = 'B' AND mi.Status = 1) AND (mi.pointtype = 'C' AND mi.status = 0) Then 1
when (mi.pointtype = 'A' AND mi.status = 1) AND (mi.pointtype = 'B' AND mi.Status = 1) AND (mi.pointtype = 'C' AND mi.status = 0) Then 0
when (mi.pointtype = 'A' AND mi.status = 0) AND (mi.pointtype = 'B' AND mi.Status = 1) AND (mi.pointtype = 'C' AND mi.status = 1) Then 0
else NULL
END
, sm.Shape
from ParentTable as sm
join ChildTable as mi
on sm.PK = mi.REL_FK

0 Kudos