interpolations: snap lines to points, not vice versa

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
This commit is contained in:
Sarah Hoffmann
2015-03-08 18:25:51 +01:00
parent 555362eabe
commit 6f98fa0fb3
2 changed files with 66 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ CREATE OR REPLACE FUNCTION split_line_on_node(line GEOMETRY, point GEOMETRY)
RETURNS GEOMETRY
AS $$
BEGIN
RETURN ST_Split(line, ST_ClosestPoint(line, point));
RETURN ST_Split(ST_Snap(line, point, 0.0005), point);
END;
$$
LANGUAGE plpgsql;