mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-30 22:09:31 +03:00
11 lines
278 B
MySQL
11 lines
278 B
MySQL
|
-- 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(line, ST_ClosestPoint(line, point));
|
||
|
END;
|
||
|
$$
|
||
|
LANGUAGE plpgsql;
|