Opened 9 years ago

Last modified 4 years ago

#2086 new enhancement


Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS Fund Me
Component: topology Version: 2.0.x
Keywords: Cc:


While cleaning up the topology of a dataset for topologically correct simplification I found myself in need of dropping nodes of degree 2 from edge rings.

This ticket is to provide a mean to do that with a function.

Attachments (1)

overnodes.png (9.3 KB) - added by strk 9 years ago.

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by strk

Attachment: overnodes.png added

comment:1 Changed 9 years ago by strk

This is the kind of situation that I'm willing to cleanup:

comment:2 Changed 9 years ago by strk

The implementation could be similar to that of GetEdgeRing?, which is walking around a link and sewing until a node of degree != 2 is found. A signed edge id would give the direction to follow. Positive to walk forward, negative to walk backward.

comment:3 Changed 9 years ago by strk

Now that I have this implemented, I wonder why if the code should really stop on first node of degree > 2 or if it should instead take a left turn and keep going... The latter would turn it into a whole-ring merging

comment:4 Changed 9 years ago by pramsey

Owner: changed from pramsey to strk

comment:5 Changed 9 years ago by strk

Component: postgistopology

In order to maximize cleaning of a whole topology we'd want to always start with nodes of degree > 2 and then get to those of degree = 1, a primitive function could be one that stops at a node with degree != 1, then another function would iteratively call the primitive for each incident edge on each left-over node. Each iteration would drop nodes from the list of nodes to start from.

comment:6 Changed 9 years ago by robe

Milestone: PostGIS 2.1.0PostGIS 2.2.0

comment:7 Changed 7 years ago by strk

Milestone: PostGIS 2.2.0PostGIS Future

comment:8 Changed 4 years ago by robe

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.