Do the lines already have a group id?
If so, I would try this:
- Aggregator (group by id) to create a collection of lines with the same group id.
- BoundingBoxReplacer (Replace with 2D Oriented Bounding Box) to create a rotated box.
- CenterLineReplacer to get the centerline of the boundingbox.
- LineExtender to stretch the centerline to the edges of the box.
- Clipper (group by id) to trim the line to the edge of the box.
Sample attached.
Do the lines already have a group id?
If so, I would try this:
- Aggregator (group by id) to create a collection of lines with the same group id.
- BoundingBoxReplacer (Replace with 2D Oriented Bounding Box) to create a rotated box.
- CenterLineReplacer to get the centerline of the boundingbox.
- LineExtender to stretch the centerline to the edges of the box.
- Clipper (group by id) to trim the line to the edge of the box.
Sample attached.
Hi nielsgerrits,
Yes, they have a group ID. The thing with this method is that the center line does not have the same angle as the other line, as you can see in this image.
Hi nielsgerrits,
Yes, they have a group ID. The thing with this method is that the center line does not have the same angle as the other line, as you can see in this image.
It should have, if you set the boundingboxreplacer to oriented bounding box? This will not work when the distance between the lines is bigger then the lines are long, because then the centerline will be rotated 90 degrees.
Hi nielsgerrits,
Yes, they have a group ID. The thing with this method is that the center line does not have the same angle as the other line, as you can see in this image.
Sorry, i forgot to set it to oriented bounding box. Thank you very much!
Hi nielsgerrits,
Yes, they have a group ID. The thing with this method is that the center line does not have the same angle as the other line, as you can see in this image.
Great, happy that it works for you :)
Even if the distance between the lines is bigger than the length of the lines, you can test this (set attributenames for length long and short sides), then you can get the centerpoint of the line and rotate it 90 degrees around it.