]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix a number of corner cases with interpolation splitting
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 6 Apr 2023 14:54:00 +0000 (16:54 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 11 Apr 2023 13:29:42 +0000 (15:29 +0200)
Snapping a line to a point before splitting was meant to ensure
that the split point is really on the line. However, ST_Snap() does
not always behave well for this case. It may shorten the interpolation
line in some cases with the result that two points housenumbers
suddenly fall on the same point. It might also shorten the line down
to a single point which then makes ST_Split() crash.

Switch to a combination of ST_LineLocatePoint and ST_LineSubString
instead, which guarantees to keep the original geometry. Explicitly
handle the corner cases, where the split point falls on the beginning
or end of the line.


No differences found