Opened 7 years ago

Last modified 2 years ago

## #2175 new defect

# Adding the same closed line to topology twice creates two nodes: ST_Rebase function

Reported by: | strk | Owned by: | strk |
---|---|---|---|

Priority: | medium | Milestone: | PostGIS Fund Me |

Component: | topology | Version: | master |

Keywords: | Cc: |

### Description

As found in ticket #2172 adding a closed line to a topology using TopoGeo_AddLineString two times creates a second node being the leftmost (and lowermost) vertex in the closed line.

This is due to the way noding with existing edges is performed.

It is not necessarely a bug but can be annoying as it produces a more complex topology that needed.

In order to fix this there should be a primitive function for rotating a closed linestring so to start/end on a given point number. I don't think we have one, do we ?

### Change History (8)

### comment:1 Changed 7 years ago by

### comment:3 Changed 7 years ago by

Milestone: | PostGIS 2.0.3 → PostGIS 2.1.0 |
---|---|

Summary: | Adding the same closed line to topology twice creates two nodes → Adding the same closed line to topology twice creates two nodes: ST_Rebound function |

Version: | 2.0.x → trunk |

strk - push this back to 2.0 if you don't think it requires exposing a front facing function.

### comment:4 Changed 7 years ago by

Summary: | Adding the same closed line to topology twice creates two nodes: ST_Rebound function → Adding the same closed line to topology twice creates two nodes: ST_Rebase function |
---|

I like ST_Rebase more, in that the function needs not deal to any concept of "former condition". Given a closed linestring, "Rebase" would change its start/end point to any of the existing vertices. The new vertex may be expressed in terms of a vertex index from current start, in which case we'd need a function to extract a vertex index from a point (closest vertex). Or it could be expressed as a "location" so that ST_Locate_Point can do its thing.

### comment:5 Changed 6 years ago by

Milestone: | PostGIS 2.1.0 → PostGIS 2.2.0 |
---|

### comment:6 Changed 5 years ago by

Stumbled upon "scroll" in GEOS/JTS, so might be another candidate for a name... ST_Scroll(linestring geometry, first_point geometry)

### comment:7 Changed 5 years ago by

Milestone: | PostGIS 2.2.0 → PostGIS Future |
---|

**Note:**See TracTickets for help on using tickets.

I like ST_Rebound. Definitions that make me think why this term is appropriate:

http://www.thefreedictionary.com/rebound