Question

How to Aggregate and Group By Non-Contiguous Features

  • 18 January 2018
  • 7 replies
  • 4 views

Badge +1
  • Participant
  • 126 replies

I have a dataset of bikeway segments that I want to aggregate and group by name and type. For example, I want all "Heather" and "Protected Bike Lanes" to be one group. However, the aggregator joins non contiguous lines when it groups. As shown, there is one feature for both segments that have this name and type.

What I would like is to have two segments here. In other words, group by name and type, but only join if segments are within some reasonable threshold, like 10 meters. Is it possible?


7 replies

Userlevel 4
Badge +13

Hi @jimo,

I think you might want to consider looking a the Snapper transformer here. You can snap by groups and also set a tolerance. This tolerance can be set to 10 m (or whatever you like) which will decide weather to Snap or not.

Userlevel 1
Badge +21

Have you looked at the neighbourhood aggregator?

Userlevel 2
Badge +17

Hi @jimo,

I think you might want to consider looking a the Snapper transformer here. You can snap by groups and also set a tolerance. This tolerance can be set to 10 m (or whatever you like) which will decide weather to Snap or not.

The Snapper may not preserve some lines by default if their length are shorter than specified tolerance. If there could be shorter lines in the source geometries, try setting 'Yes' to the Save Short Lines parameter.

 

 

Badge +3

@jimo

I am not aware that the aggregator would be joining lines at all.

I think it is hard to see when the objects are in aggregated mode.

It seems you want to group by those attributes and a distance threshold.

You can have all endpoints get the distance by using a neighbourfinder (endpoints as candidates and candidate only mode) and use both these distances (each end) attributes as added group by values for the aggregator.

(don't use lines in neighbor search for obvious reasons..)

Badge +1

Have you looked at the neighbourhood aggregator?

The neighbourhood aggregator works but it seems to stop aggregating at a certain distance. Both of the selected features are grouped but both are "Dumphries" and "Local Street". The neighbourhood aggregator made two groups here.

 

 

 

Badge +1

Hi @jimo,

I think you might want to consider looking a the Snapper transformer here. You can snap by groups and also set a tolerance. This tolerance can be set to 10 m (or whatever you like) which will decide weather to Snap or not.

The Save Short Lines parameter preserves the short lines but it still adds new lines, as shown:

 

Userlevel 2
Badge +17

Hi @jimo,

I think you might want to consider looking a the Snapper transformer here. You can snap by groups and also set a tolerance. This tolerance can be set to 10 m (or whatever you like) which will decide weather to Snap or not.

Possibly the Snapper Tolerance parameter value you've set is too large. Make sure that the parameter value is reasonable.

 

Reply