Hi,
the LineJoiner expects all your lines to be contiguous, which isnt't the case for the "anchor-shaped" object in the screenshot above. From the LineJoiner help:
Each connecting line must meet at the exact same start/end point, but otherwise they must not intersect.
I would normally sugges the Aggregator here, but I'm not sure why you don't feel it's suitable for your use case?
David
David,
Thank you for responding to me. I really appreciate it.
I may be doing it incorrectly since I am still learning, but when I used the Aggregator here it turned all my features (10,000+) into one single feature. It did of course connect the anchors, but instead of having roughly 5,000 features, I had only 1.
Do you think I used the Aggregator wrong or would I need to do something else after that? I can attach a picture to help if I need to.
Hi Kenny,
I suppose you are trying to merge lines for each group which will contain one or more lines touching or intersecting each other.
As David mentioned, I think the Aggregator is suitable to do that finally, but you will have to add group ID to the lines beforehand, so that the aggregation will be performed for each group.
One possible way is:
(1) Create buffers of the lines by a small amount (tolerance) with the Bufferer.
(2) Dissolve them with the Dissolver.
(3) Add group ID attribute (sequential number) to the dissolved areas with the Counter.
(4) Add a SpatialFilter to the workspace.
- send the dissolved areas to the Filter port.
- send the original lines to the Candidate port.
- set "Yes" to the Merge Attributes parameter so that the group ID will be merged to the original lines.
(5) Connect an Aggregator to the Passed port of the SpatialFilter; set the group ID attribute to its "Group By" parameter.
Takashi
Takashi,
Thank you for your response. I will try your suggestion now! You are very helpful.
Hello,
Takashi and David,
Thank you for helping me out! I did what was suggested, and it does work. For now though, I did not include the SpatialFilter transformer. I do not really need the original attributes, but I would like to learn on how to keep them. I attached a picture to help show you.
Could you give me any advice on what I should do with the SpatialFilter? I have played around with it for awhile, but I can't seem to get it to work correctly. I believe it is with what attributes I am choosing in the "Group By:" and "Tests to Perform".
It looks like I will get 4620 features total.
Thank you very much!
The "Group By" of the SpatialFilter should be left blank, so that the "_count" (group ID) wil be merged to the origianl lines; the "_count" will be used to make groups of the lines.
And set "INTERSECTS" (or "CONTAINS") to the "Tests to Perform".
Then, set the "_count" to the "Group By" of the following
Aggregator.
That worked great! Thank you very much. I really appreciate it!