Question

Merging Attributes from Multiple sources


Badge +9

I have a CAD file that has bearings of a line on one layer, distances on another and then the lines themselves on another. I have created a workbench that brings in all three layers, plus others, and then writes the lines out with attributes of the bearing and distance. I am using the NeighborFinder to get the bearing and distance closest to the line but when I write them to the output I am getting double the features that I was hoping for. As shown in the second image I am getting a line feature for each bearing and a separate one for each distance. Is there a way to just get a single line feature with both attributes on it?

 


4 replies

Userlevel 6
Badge +33

If I understand correctly, you need to connect the Bearing_Label Matched outputport to the DistanceLabel Base inputport.

This fixes both the issues of the double features and the not merged attributes.

I have to add that I think renaming Transformers is a bad habit. It makes reviewing workbenches more difficult because it is not always obvious what Transformers are used. Better use Annotations or Bookmarks.

Badge +9

If I understand correctly, you need to connect the Bearing_Label Matched outputport to the DistanceLabel Base inputport.

This fixes both the issues of the double features and the not merged attributes.

I have to add that I think renaming Transformers is a bad habit. It makes reviewing workbenches more difficult because it is not always obvious what Transformers are used. Better use Annotations or Bookmarks.

Thanks Niels, I appreciate the advice in both the connecting the transformers and also regarding the renaming as that makes a lot of sense. I will let the forum know how it goes.

Badge +9

If I understand correctly, you need to connect the Bearing_Label Matched outputport to the DistanceLabel Base inputport.

This fixes both the issues of the double features and the not merged attributes.

I have to add that I think renaming Transformers is a bad habit. It makes reviewing workbenches more difficult because it is not always obvious what Transformers are used. Better use Annotations or Bookmarks.

You are a champion. Thanks for your help, it worked perfectly.

Userlevel 6
Badge +33

Thanks Niels, I appreciate the advice in both the connecting the transformers and also regarding the renaming as that makes a lot of sense. I will let the forum know how it goes.

Please be aware: The NeighborFinder matches the closest candidate to each base. When a Candidate is matched to a base, it is not excluded from the set of Candidates. So a point candidate between two base lines will be matched to both base lines. When you want to connect labels with geometries, ensure this accidental double matching is not happening.

You can check if this is happening by generating id's on the suppliers (Counter or UUIDGenerator) and check for duplicate id's on the matched features (Matcher, Attributes, id.)

NeighborFinder 2019.fmwt

Reply