X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/3b6c2c9155ada3706c9095efc51fcd4213141b4f..f8694da3c910259b8da93f1831aab46a4c8a3276:/sql/tiger_import_start.sql diff --git a/sql/tiger_import_start.sql b/sql/tiger_import_start.sql index c5246854..4b9c33fc 100644 --- a/sql/tiger_import_start.sql +++ b/sql/tiger_import_start.sql @@ -58,20 +58,18 @@ BEGIN address_street_word_ids := word_ids_from_name(in_street); IF address_street_word_ids IS NOT NULL THEN - out_parent_place_id := getNearestNamedRoadFeature(out_partition, place_centroid, + out_parent_place_id := getNearestNamedRoadPlaceId(out_partition, place_centroid, address_street_word_ids); END IF; IF out_parent_place_id IS NULL THEN - FOR location IN SELECT place_id FROM getNearestParellelRoadFeature(out_partition, linegeo) LOOP - out_parent_place_id := location.place_id; - END LOOP; + SELECT getNearestParallelRoadFeature(out_partition, linegeo) + INTO out_parent_place_id; END IF; IF out_parent_place_id IS NULL THEN - FOR location IN SELECT place_id FROM getNearestRoadFeature(out_partition, place_centroid) LOOP - out_parent_place_id := location.place_id; - END LOOP; + SELECT getNearestRoadPlaceId(out_partition, place_centroid) + INTO out_parent_place_id; END IF; --insert street(line) into import table