Opened 12 years ago

Closed 3 years ago

Last modified 3 years ago

#2175 closed defect (fixed)

Adding the same closed line to topology twice creates two nodes: ST_Scroll (or ST_Rebase) function

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.2.0
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 (14)

comment:1 by robe, 12 years ago

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

http://www.thefreedictionary.com/rebound

  1. in the act of springing back
  2. To reecho; resound.

comment:2 by robe, 12 years ago

most relevant definition:

return to a former condition

comment:3 by robe, 12 years ago

Milestone: PostGIS 2.0.3PostGIS 2.1.0
Summary: Adding the same closed line to topology twice creates two nodesAdding the same closed line to topology twice creates two nodes: ST_Rebound function
Version: 2.0.xtrunk

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

comment:4 by strk, 12 years ago

Summary: Adding the same closed line to topology twice creates two nodes: ST_Rebound functionAdding 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 by robe, 11 years ago

Milestone: PostGIS 2.1.0PostGIS 2.2.0

comment:6 by strk, 10 years ago

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

comment:7 by strk, 10 years ago

Milestone: PostGIS 2.2.0PostGIS Future

comment:8 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

comment:9 by strk, 4 years ago

Summary: Adding the same closed line to topology twice creates two nodes: ST_Rebase functionAdding the same closed line to topology twice creates two nodes: ST_Scroll (or ST_Rebase) function

comment:10 by strk, 3 years ago

I've started work on a scroll function: https://gitlab.com/postgis/postgis/-/merge_requests/27

comment:11 by strk, 3 years ago

Milestone: PostGIS Fund MePostGIS 3.2.0
Status: newassigned

comment:12 by Sandro Santilli <strk@…>, 3 years ago

In ec89011/git:

Implement ptarray_scroll_in_place

Includes unit tests
References #2175

comment:13 by Sandro Santilli <strk@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In f4a1ce5/git:

Avoid creating two nodes when adding same closed line to topology

Closes #2175

comment:14 by Sandro Santilli <strk@…>, 3 years ago

In 04aa7f6/git:

Fix scrolling of closed lines on topology population

Includes test for adding same closed line with first point slighly
off but within tolerance.

Use of tolerance moves the first point, which is later NOT
found by the scroll call, unless we recomputed as in this
commit, which recomputes start point after snap.

References #2175

Note: See TracTickets for help on using tickets.