Merging linear overlay results?
Daniel Baston
dbaston at gmail.com
Wed Jun 24 14:37:36 PDT 2026
I'd like to get this behavior in 3.15. Is the consensus that it needs to be
opt-in, via "WithParams" variants of all the GEOS overlay functions? Or
should we explore turning it on in all cases, since many expected overlay
results will change in 3.15 anyway? (
https://github.com/libgeos/geos/pull/1412)
As an example, the proposed behavior is
geosop intersection -a "POLYGON ((8 2, 10 0, 0 0, 0 10, 2 10, 3.67 8, 4 6,
5.5 3, 8 2))" -b "POLYGON ((2 10, 3.67 8, 4 6, 5.5 3, 8 2, 10 0, 10 10, 2
10))"
LINESTRING (2 10, 3.67 8, 4 6, 5.5 3, 8 2, 10 0, 8 2)
in place of the current result:
MULTILINESTRING ((8 2, 10 0), (2 10, 3.67 8), (3.67 8, 4 6), (4 6, 5.5 3),
(5.5 3, 8 2))
Dan
On Thu, May 21, 2026 at 7:05 AM Sandro Santilli <strk at kbt.io> wrote:
> Just to add that PostGIS Topology also does the post-overlay linemerge:
>
>
> https://gitea.osgeo.org/postgis/postgis/src/branch/master/liblwgeom/topo/lwgeom_topo.c#L7520-L7534
>
> Allowing to request such behavior earlier would help performances there
> too,
> I'm in favour of such addition
>
> --strk;
>
>
> On Wed, May 20, 2026 at 09:22:45AM -0400, Daniel Baston wrote:
> > Hi,
> >
> > I've noticed that the GEOS overlay code has the capability to merge
> linear
> > output geometries, using LineBuilder::addResultLinesMerged. However, this
> > capability has never been enabled. GEOS clients ([1], [2]) sometimes end
> up
> > calling GEOSLineMerge as a follow-up step to overlay, but this is
> > inefficient and cumbersome. (Among other things, GEOSLineMerge silently
> > drops any non-linear inputs.)
> >
> > Does it make sense to consider enabling this behavior? It would be
> helpful
> > for reconstructing CompoundCurves, which have no way to retain their
> > complex parentage information through the noding journey. I guess we
> would
> > need a GEOSUnionWithParams, GEOSIntersectionWithParams, etc...
> >
> > Dan
> >
> > [1]
> >
> https://github.com/qgis/QGIS/blob/b298119a5b09ae3903596ec2ffaf8aaff7ba78a3/src/core/geometry/qgsgeos.cpp#L1985
> > [2]
> >
> https://github.com/OSGeo/gdal/blob/ad495515b681bfb5f660f5de17e9ef1c2c8f153f/apps/gdalalg_vector_dissolve.cpp#L134
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20260624/21c8ef95/attachment.htm>
More information about the geos-devel
mailing list