Skip to main content
Solved

Cluster lines near each other into a single polygon

  • April 11, 2017
  • 1 reply
  • 56 views

jeroen
Contributor
Forum|alt.badge.img+15

I'm working on a dataset that contains piano like clusters of lines that i want to merge into a single polygon per cluster.

Example from the source in autocad:

The end result will look the same but than it should be a polygon containing 3 features in stead of lines. So the line width contains information for making the polygon. But how do i group them together after or before i change them? Is there an (easy) way to group them with a certain buffer or would the neighbor finder be easier?

Best answer by takashi

Hi @jdh009, how about this procedure?

  1. Bufferer: Create buffer area for each line so that the buffer areas belonging to the same group overlap each other.
  2. Dissolver: Dissolve the buffer areas.
  3. Counter: Add unique number (say group ID) to each dissolved area.
  4. SpatialFilter (or Clipper): Filter the original lines by the buffer areas to transfer group ID to the lines.
  5. HullAccumulator: Create hulls from the lines for each group, setting the group ID attribute to the Group By parameter.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • Best Answer
  • April 11, 2017

Hi @jdh009, how about this procedure?

  1. Bufferer: Create buffer area for each line so that the buffer areas belonging to the same group overlap each other.
  2. Dissolver: Dissolve the buffer areas.
  3. Counter: Add unique number (say group ID) to each dissolved area.
  4. SpatialFilter (or Clipper): Filter the original lines by the buffer areas to transfer group ID to the lines.
  5. HullAccumulator: Create hulls from the lines for each group, setting the group ID attribute to the Group By parameter.