From: Sarah Hoffmann Date: Thu, 7 Apr 2022 14:42:46 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~118 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/6eb1113dcb569f07367a801e6ac2dcb9565ec7b8?hp=-c Merge remote-tracking branch 'upstream/master' --- 6eb1113dcb569f07367a801e6ac2dcb9565ec7b8 diff --combined CMakeLists.txt index 8adc0be0,1aa9c315..5a5b1c08 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -114,27 -114,6 +114,27 @@@ if (BUILD_IMPORTER ${PROJECT_BINARY_DIR}/nominatim) endif() +#----------------------------------------------------------------------------- +# Targets for running a development webserver from the build directory. +#----------------------------------------------------------------------------- + +if (BUILD_API) + set(WEBSITEFILES + 403.html + 509.html + crossdomain.xml + favicon.ico + nominatim.xml + robots.txt + taginfo.json + ) + + foreach (webfile ${WEBSITEFILES}) + configure_file(${PROJECT_SOURCE_DIR}/website/${webfile} + ${PROJECT_BINARY_DIR}/website/${webfile}) + endforeach() +endif() + #----------------------------------------------------------------------------- # Tests #----------------------------------------------------------------------------- @@@ -247,8 -226,7 +247,7 @@@ if (BUILD_IMPORTER PATTERN __pycache__ EXCLUDE) install(DIRECTORY lib-sql DESTINATION ${NOMINATIM_LIBDIR}) - install(FILES data/country_name.sql - ${COUNTRY_GRID_FILE} + install(FILES ${COUNTRY_GRID_FILE} data/words.sql DESTINATION ${NOMINATIM_DATADIR}) endif() diff --combined lib-sql/functions/address_lookup.sql index 3e25c6fc,0eada698..7fb11cfb --- a/lib-sql/functions/address_lookup.sql +++ b/lib-sql/functions/address_lookup.sql @@@ -43,8 -43,8 +43,8 @@@ BEGI END IF; END LOOP; - -- anything will do as a fallback - just take the first name type thing there is - RETURN trim((avals(name))[1]); + -- as a fallback - take the last element since it is the default name + RETURN trim((avals(name))[array_length(avals(name), 1)]); END; $$ LANGUAGE plpgsql IMMUTABLE; @@@ -231,7 -231,7 +231,7 @@@ BEGI FOR location IN SELECT placex.place_id, osm_type, osm_id, name, class, type, coalesce(extratags->'linked_place', extratags->'place') as place_type, - admin_level, fromarea, isaddress, + admin_level, fromarea, isaddress and linked_place_id is NULL as isaddress, CASE WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address, distance, country_code, postcode FROM place_addressline join placex on (address_place_id = placex.place_id)