Solved

removing unnecessary vertices from lines and polys

  • 11 July 2018
  • 6 replies
  • 136 views

Badge

Hello. Looking for some suggestions on how to fix geometries. These unnecessary vertices are the result of import from MicroStation cadastral based DGN files. The unwanted vertices are on a cadastral grid line.

First case, lines with extra vertex that should be removed:

Second case:2 line segments that should be merged, assuming they are colinear. Would need a test for that, right? In the screenshot below, the short segment south of the green highlighted segment should be merged with the green highlighted segment and defined by 2 points (again, assuming they are colinear).

Third case: polygons with extra vertices like in the line segments. Pt 4 (and others at cadastral grid lines) should be remove (assuming colinear segments):

There are ~25000 lines affected and and similar number of various polygon features.

Thank you for any direction!!

icon

Best answer by takashi 12 July 2018, 05:33

View original

6 replies

Badge +22

For the first case a Generalizer should work.

 

For the second case LineCombiner (LineJoiner)

 

I'm not understanding the difference between the third case and the first case.
Badge

Thanks for the ideas, @jdh

The generalizer has a tolerance setting, but in my case the tolerance will vary greatly. The extraneous point may be close to one end or the other or in the middle-ish. How would you set a tolerance for 'all' cases?

I guess there's really no difference between first and third cases. However, I would want to be able to compare the before and after polys to make sure they are equivalent. Is that best tested by comparing the areas?

Badge +22

Thanks for the ideas, @jdh

The generalizer has a tolerance setting, but in my case the tolerance will vary greatly. The extraneous point may be close to one end or the other or in the middle-ish. How would you set a tolerance for 'all' cases?

I guess there's really no difference between first and third cases. However, I would want to be able to compare the before and after polys to make sure they are equivalent. Is that best tested by comparing the areas?

The tolerances settings, are not usually related to how far from the end of the line, bur rather if you took the vertex out, by how much would the line be displaced.

 

 

In you really only want to remove exactly co-linear vertices, you could set the tolerance to 0.

 

 

Userlevel 2
Badge +17

Hi @brucearmstrong, if you need to remove all vertices on the grid lines, a possible approach is:

  1. Counter: Add sequential number as temporary ID to the lines.
  2. Chopper (Mode: By Vertex, Maximum Vertices: 1): Chop the lines into individual vertex points.
  3. Spatial Filter: Filter out the points that are on the grid line.
  4. LineBuilder (Group By: ID): Restore lines from remained points.

Depending on the condition, you might consider some tolerance when filtering points by the grid lines.

Badge +3

@brucearmstrong

I would

1. Chop the line by 2.

2. calculate angle (using for instance azimuth calculator).

3. Line Combiner Grouped by angle.

4. Get begin and end vertex of each resulting line and recreate them.

Badge

Hi @brucearmstrong, if you need to remove all vertices on the grid lines, a possible approach is:

  1. Counter: Add sequential number as temporary ID to the lines.
  2. Chopper (Mode: By Vertex, Maximum Vertices: 1): Chop the lines into individual vertex points.
  3. Spatial Filter: Filter out the points that are on the grid line.
  4. LineBuilder (Group By: ID): Restore lines from remained points.

Depending on the condition, you might consider some tolerance when filtering points by the grid lines.

 

This worked very well. Thanks takashi!!

 

Reply