[postgis-tickets] [PostGIS] #2192: Add tolerance parameter to ST_Split for splitting lines by points
PostGIS
trac at osgeo.org
Tue Jun 8 14:46:42 PDT 2021
#2192: Add tolerance parameter to ST_Split for splitting lines by points
--------------------------+---------------------------------------
Reporter: michischolz | Owner: pramsey
Type: enhancement | Status: new
Priority: medium | Milestone: PostGIS Fund Me
Component: postgis | Version: 2.0.x
Resolution: | Keywords: st_split, tolerance, gsoc
--------------------------+---------------------------------------
Comment (by Mike Taves):
FYI, a simple implementation of this feature is:
{{{
CREATE OR REPLACE FUNCTION ST_Split(geom1 geometry, geom2 geometry, double
precision)
RETURNS geometry AS 'SELECT ST_Split(ST_Snap($1, $2, $3), $2)'
LANGUAGE sql IMMUTABLE STRICT COST 10;
}}}
However, it's not ideal:
{{{
SELECT ST_AsText(ST_Split('LINESTRING(0 0, 2 0)', 'MULTIPOINT(0 0, 1
0.0001)', 0.001));
-- Returns: GEOMETRYCOLLECTION(LINESTRING(1 0.0001,2 0),LINESTRING(0 0,1
0.0001))
-- Expected: GEOMETRYCOLLECTION(LINESTRING(1 0,2 0),LINESTRING(0 0,1 0))
}}}
Ideally the C-level logic would use `lwgeom_snap` and
`lwline_interpolate_points` to handle a third `tolerance` parameter.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/2192#comment:8>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list