Opened 3 years ago

Closed 2 years ago

#4939 closed enhancement (duplicate)

Add possibility to merge lines without changing order of points.

Reported by: evgen Owned by: komzpa
Priority: medium Milestone: PostGIS 3.3.0
Component: postgis Version: 2.5.x -- EOL
Keywords: Cc:


There is a great function ST_LineMerge. But it could reverse lines in multiline to connect them. E.g.

` SELECT ST_AsText(ST_LineMerge( ST_GeomFromText('MULTILINESTRING((-29 -27,1 2),(-29 -27,-45 -33),(-45 -33,-46 -32))')) ); ` returns LINESTRING(1 2,-29 -27,-45 -33,-46 -32) but it could be MULTILINESTRING((-29 -27,1 2),(-29 -27,-45 -33,-46 -32))'.

I process one way roads. When I merge them I'd like to keep point order to know original direction of that segments.

Change History (9)

comment:1 by pramsey, 3 years ago

Milestone: PostGIS 3.1.3PostGIS 3.1.4

comment:2 by pramsey, 3 years ago

Resolution: wontfix
Status: newclosed

This seems unlikely to happen (when directions of merged lines disagree then…?) It's also something that can be reported upstream in the JTS repository. If there's interest there, or it's easy, it will eventually flow downstream to here.

comment:3 by komzpa, 3 years ago

Resolution: wontfix
Status: closedreopened

This is actual and needed in generating maps with one-way roads. If directions disagree don't merge.

comment:4 by komzpa, 3 years ago

Owner: changed from pramsey to komzpa
Status: reopenednew

comment:5 by robe, 3 years ago

Milestone: PostGIS 3.1.4PostGIS 3.2.0

Slating for 3.2.0 as it sounds like a behavior change rather than a bug. Might even need to go to 3.3.0 if we need to introduce a new arg.

comment:6 by mdavis, 3 years ago

Logged as JTS-773.

This is a worthwhile enhancement to JTS and GEOS. It could be exposed in PostGIS as an option to ST_LineMerge.

comment:7 by robe, 3 years ago

Milestone: PostGIS 3.2.0PostGIS 3.3.0

comment:8 by robe, 2 years ago

git hub related pull request -

comment:9 by robe, 2 years ago

Resolution: duplicate
Status: newclosed

duplicates #5161

Note: See TracTickets for help on using tickets.