mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-27 19:07:55 +03:00
2d6f00945a
This allows address interpolations to work correctly when flatnode storage is used for node coordinates. To fix interpolations in an existing database, follow these steps: * invalidate all interpolations (in psql): `UPDATE placex SET indexed_status=2 WHERE rank_search = 28` * disable updates: ./utils/setup.php --create-functions --create-partition-functions * reindex the whole lot: ./utils/update.php --index --index-instances <number of your cpus> * enable updates again: ./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
15 lines
387 B
PL/PgSQL
15 lines
387 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 $$
|
|
DECLARE
|
|
frac FLOAT;
|
|
BEGIN
|
|
frac := ST_Line_Locate_Point(line, point);
|
|
RETURN ST_Collect(ST_Line_Substring(line, 0, frac),
|
|
ST_Line_Substring(line, frac, 1));
|
|
END
|
|
$$
|
|
LANGUAGE plpgsql;
|