Skip to main content
Solved

Create group ID based on conditions?

  • April 3, 2025
  • 6 replies
  • 69 views

aron
Enthusiast
Forum|alt.badge.img+16

The two lines below share the same end nodes and I want to give them a common group id for later processing. This is to be the step after a TopologyBuilder.

I thought this would be pretty simple, but have run aground. So how do I achieve this?

The geometris are to be left unchanged. I just want them to have a common “id” if they intersect at both ends.

The conditions for the ‘join’ are:

_from_node = _from_node AND _to_node = _to_node

OR

_from_node = _to_node AND _to_node = _from_node

Because sometimes the lines orient in different directions.

 

 

Best answer by takashi

Hi ​@aron ,

My idea is to create group ID by concatenating “_from_node” and “_to_node” with ascending order. The concept is shown below.

  • _node1 = If _from_node < _to_node then _from_node, Else _to_node
  • _node2 = If _from_node < _to_node then _to_node, Else _from_node
  • _group_id = @Value(_node1)_@Value(_node2) 
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

takashi
Celebrity
  • Best Answer
  • April 4, 2025

Hi ​@aron ,

My idea is to create group ID by concatenating “_from_node” and “_to_node” with ascending order. The concept is shown below.

  • _node1 = If _from_node < _to_node then _from_node, Else _to_node
  • _node2 = If _from_node < _to_node then _to_node, Else _from_node
  • _group_id = @Value(_node1)_@Value(_node2) 

geomancer
Evangelist
Forum|alt.badge.img+59
  • Evangelist
  • April 4, 2025

My idea is to create group ID by concatenating “_from_node” and “_to_node” with ascending order. 

A very simple and elegant solution!

If you want to, you can skip creating _node1 and _node2 by using _group_id =  @min(@Value(_from_node),@Value(_to_node))_@max(@Value(_from_node),@Value(_to_node))

 


ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • April 4, 2025

Would the NetworkTopologyCalculator not do this for you? 


aron
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • April 4, 2025

Would the NetworkTopologyCalculator not do this for you? 

I believe that it would not get me where I want. There might be some trick with the NetworkTopologyCalculator that I dont know of, but when I have used it previously it gave me a ID for all the connected lines. I want to group only those that share the same start and end.


ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • April 4, 2025

Ah too early in the morning for me, you’re actually looking for rings?


aron
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • April 4, 2025

Ah too early in the morning for me, you’re actually looking for rings?

I haven't thought about it that way, but two part rings would be an accurate description. AreaBuilder does not work for my use case though, it gives far to many false positives.