]> git.openstreetmap.org Git - nominatim.git/commit
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)
commitffe32af5313d483ac1b27b682dcaf04a3196009d
tree923d7878dd23b4fde2af28e308735ae3ea9afdb2
parent5baa827b8ad286ab03015d610597aeb121a7ed7a
fix a number of corner cases with interpolation splitting

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.
lib-sql/functions/interpolation.sql
test/bdd/db/import/interpolation.feature