Question

Remove duplicates with keeping the line near to center

  • 25 April 2019
  • 2 replies
  • 2 views

Badge +1

Hello FME community,

please forgive me if this is a trivial question. I am quite a beginner with FME.

I have a line shapefile containing streets. Each street presented with more than one line (Lines Group) and each lines group belong to the same KEY and NAME as shown in figure one.

The problem is that, for each street I need to keep the line near to center (center of group) and remove other lines as shown in figure two.

 

My initial idea was to create a Bounding Box for each lines group (each street) then creates a Center Point for each Bounding Box. Later on to match each group lines with their center point, and then remove the duplicates with keeping the line near to center.

I am stuck on exactly how I would remove the duplicate with keeping the line near to center? And how I match each group lines with their center point?

For creation of Bounding Box I used (Aggregator Transformer - Group By: key and name >> BoundingBoxReplacer – 2D Oriented) .

For creation of Center Point I used (CenterPointReplacer – mode: center point).

Does anyone have any ideas or other potential solutions?

Regards,

Afia.

@takashi @david_r @jlutherthomas


2 replies

Userlevel 1
Badge +21

Have you looked at the neighbourfinder? This would allow you to identify the line that is closest to the centre point

Badge +1

Thank you @egomm , Neighbourfinder Transformer is good solution.

Reply