From: Sarah Hoffmann Date: Fri, 16 Jan 2015 20:36:35 +0000 (+0100) Subject: remove unused functions X-Git-Tag: v2.4.0~56 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/138b8a2ada477d878cfca1036d8ec3c7fd37e1db?hp=-c remove unused functions --- 138b8a2ada477d878cfca1036d8ec3c7fd37e1db diff --git a/sql/functions.sql b/sql/functions.sql index a4a7f116..fc83f9a1 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -474,31 +474,6 @@ END; $$ LANGUAGE plpgsql IMMUTABLE; -CREATE OR REPLACE FUNCTION get_word_score(wordscores wordscore[], words text[]) RETURNS integer - AS $$ -DECLARE - idxword integer; - idxscores integer; - result integer; -BEGIN - IF (wordscores is null OR words is null) THEN - RETURN 0; - END IF; - - result := 0; - FOR idxword in 1 .. array_upper(words, 1) LOOP - FOR idxscores in 1 .. array_upper(wordscores, 1) LOOP - IF wordscores[idxscores].word = words[idxword] THEN - result := result + wordscores[idxscores].score; - END IF; - END LOOP; - END LOOP; - - RETURN result; -END; -$$ -LANGUAGE plpgsql IMMUTABLE; - CREATE OR REPLACE FUNCTION get_country_code(place geometry) RETURNS TEXT AS $$ DECLARE @@ -1248,8 +1223,6 @@ DECLARE search_maxdistance FLOAT[]; search_mindistance FLOAT[]; address_havelevel BOOLEAN[]; --- search_scores wordscore[]; --- search_scores_pos INTEGER; i INTEGER; iMax FLOAT; @@ -2321,29 +2294,6 @@ END; $$ LANGUAGE plpgsql IMMUTABLE; ---CREATE OR REPLACE FUNCTION get_connected_ways(way_ids INTEGER[]) RETURNS SETOF planet_osm_ways --- AS $$ ---DECLARE --- searchnodes INTEGER[]; --- location RECORD; --- j INTEGER; ---BEGIN --- --- searchnodes := '{}'; --- FOR j IN 1..array_upper(way_ids, 1) LOOP --- FOR location IN --- select nodes from planet_osm_ways where id = way_ids[j] LIMIT 1 --- LOOP --- IF not (ARRAY[location.nodes] <@ searchnodes) THEN --- searchnodes := searchnodes || location.nodes; --- END IF; --- END LOOP; --- END LOOP; --- --- RETURN QUERY select * from planet_osm_ways where nodes && searchnodes and NOT ARRAY[id] <@ way_ids; ---END; ---$$ ---LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION get_address_postcode(for_place_id BIGINT) RETURNS TEXT AS $$