]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 7 Apr 2022 14:42:46 +0000 (16:42 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 7 Apr 2022 14:42:46 +0000 (16:42 +0200)
1  2 
CMakeLists.txt
lib-sql/functions/address_lookup.sql

diff --combined CMakeLists.txt
index 8adc0be04ee949c44cf6ade64d628c46ff337f84,1aa9c315a5e2ad2181ff2a3da5b996f06080aae4..5a5b1c08e424eb77d3e9b46ce24b4e0f7a9790d0
@@@ -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()
index 3e25c6fc0df6a622034c0525989df595e2616ffb,0eada6987e7db285f9418642ccc5280bd649811a..7fb11cfb11ec40ebbccf59eae989fda9203f2085
@@@ -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)