Question

Remove vertex from Polyline

  • 7 April 2014
  • 4 replies
  • 8 views

Hi All,

 

 

Is there any way to remove from Straight Polyline unwanted vertices.

 

 

I have so many Polylines like this

 

 

Please guide me and suggest.

 

 

for ex:

 

 

cyan Color marks are nodes

 

Red Color mark Vertex are need to remove

 

Green Color Vertex is important need to keep.

 

 

If possible need to set tolerance

 

 

Thanks in Advance

 

 

Venu

 

 


4 replies

Userlevel 4
Hi,

 

 

take a look at the Generalizer. Notice that there are several different algorithms to choose from, each with their own specialties. Check the help for details.

 

 

David
Badge +3
Hi,

 

 

With such very specific rules to keep or not to keep, u nee to differentiate, using some ID.

 

U can ID the count the vertices, and then test wether a vertex matches some rule.

 

 

 

For instance u could test wether the vertex is on a location where angle does not change from section to section and is not on a node with another line(piece).

 

Topology builder and angle calculator might come in handy.

 

 

Basicaly some topology is needed, rules depend on what u need or want.

 

 

 

 

Based on your image u ssem to want to keep vertex 1st and last, and vertex where angle changes.

 

In that case generalizer would indeed suffice, you just need to choose correct angle (180 is line extending to other line).

 

 

 

Gio
Badge
Hi Venu,

 

 

You could:

 

 

- Use the Chopper and set it to 1 to get the vertices only

 

 

- Buffer the newly created points by the length of the line you want to assess angularity

 

 

- Feed this into a Clipper as "Clipper" and connect the original unchopped line as the "Clippee"

 

 

- Get the start of end coordinates of these newly created short lines using the CoordinateExtractor

 

 

- do a bit of trigonometry (or ask someone!) to work out the angle between the start and ends as an attribute which you can then test on

 

 

You will need to convert the mini-lines left over back to points by using a CoordinateExtractor then a VertexCreator.  Finally, use a LineJoiner to reconnect.  If you want to guarantee the order of the points (I don't think you'll need to), put in a Counter before the Chopper, then a Sorter before the Linejoiner on the count.

 

 

Amit
Badge +3

using python program you can achieve this.

iterate each points thru python , and check for x and y values. if any one value( x or y) matches with the last xy in loop then delete, otherwise keep and loop thru

Reply