mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-25 05:52:32 +03:00
6f98fa0fb3
Avoids the occasional rounding problem which might occur when splitting a line anywhere but on a support point, see postgis doc for ST_Split. Fixes #253
11 lines
279 B
PL/PgSQL
11 lines
279 B
PL/PgSQL
-- Splits the line at the given point and returns the two parts
|
|
-- in a multilinestring.
|
|
CREATE OR REPLACE FUNCTION split_line_on_node(line GEOMETRY, point GEOMETRY)
|
|
RETURNS GEOMETRY
|
|
AS $$
|
|
BEGIN
|
|
RETURN ST_Split(ST_Snap(line, point, 0.0005), point);
|
|
END;
|
|
$$
|
|
LANGUAGE plpgsql;
|