]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 12 Feb 2021 14:55:27 +0000 (15:55 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 12 Feb 2021 14:55:27 +0000 (15:55 +0100)
1  2 
CMakeLists.txt
lib-php/admin/update.php
lib-php/website/403.html
lib-php/website/509.html
lib-php/website/crossdomain.xml
lib-php/website/favicon.ico
lib-php/website/nominatim.xml
lib-php/website/robots.txt
lib-php/website/taginfo.json
lib-sql/functions/address_lookup.sql

diff --combined CMakeLists.txt
index 45b205fdffdb9a936ff24be645b66a6758a6cd2d,691c9adcaafad309533699558a0d7dc33af85b25..7794a50b6305b16c1bf3f9ef8c3db0b7a7a311aa
@@@ -97,6 -97,17 +97,17 @@@ endif(
  #-----------------------------------------------------------------------------
  
  if (BUILD_IMPORTER)
+    find_file(COUNTRY_GRID_FILE country_osm_grid.sql.gz
+              PATHS ${PROJECT_SOURCE_DIR}/data
+              NO_DEFAULT_PATH
+              DOC "Location of the country grid file."
+             )
+    if (NOT COUNTRY_GRID_FILE)
+        message(FATAL_ERROR "\nYou need to download the country_osm_grid first:\n"
+                            "    wget -O ${PROJECT_SOURCE_DIR}/data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz")
+    endif()
     set(CUSTOMSCRIPTS
         check_import_finished.php
         country_languages.php
                    ${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
  #-----------------------------------------------------------------------------
@@@ -218,3 -208,54 +229,54 @@@ endif(
  if (BUILD_DOCS)
     add_subdirectory(docs)
  endif()
+ #-----------------------------------------------------------------------------
+ # Installation
+ #-----------------------------------------------------------------------------
+ include(GNUInstallDirs)
+ set(NOMINATIM_DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME})
+ set(NOMINATIM_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
+ set(NOMINATIM_CONFIGDIR ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${PROJECT_NAME})
+ if (BUILD_IMPORTER)
+     configure_file(${PROJECT_SOURCE_DIR}/cmake/tool-installed.tmpl installed.bin)
+     install(PROGRAMS ${PROJECT_BINARY_DIR}/installed.bin
+             DESTINATION ${CMAKE_INSTALL_BINDIR}
+             RENAME nominatim)
+     install(DIRECTORY nominatim
+             DESTINATION ${NOMINATIM_LIBDIR}/lib-python
+             FILES_MATCHING PATTERN "*.py"
+             PATTERN __pycache__ EXCLUDE)
+     install(DIRECTORY lib-sql DESTINATION ${NOMINATIM_LIBDIR})
+     install(FILES data/country_name.sql
+                   ${COUNTRY_GRID_FILE}
+                   data/words.sql
+             DESTINATION ${NOMINATIM_DATADIR})
+ endif()
+ if (BUILD_OSM2PGSQL)
+     install(TARGETS osm2pgsql RUNTIME DESTINATION ${NOMINATIM_LIBDIR})
+ endif()
+ if (BUILD_MODULE)
+     install(PROGRAMS ${PROJECT_BINARY_DIR}/module/nominatim.so
+             DESTINATION ${NOMINATIM_LIBDIR}/module)
+ endif()
+ if (BUILD_API)
+     install(DIRECTORY lib-php DESTINATION ${NOMINATIM_LIBDIR})
+ endif()
+ install(FILES settings/env.defaults
+               settings/address-levels.json
+               settings/phrase_settings.php
+               settings/import-admin.style
+               settings/import-street.style
+               settings/import-address.style
+               settings/import-full.style
+               settings/import-extratags.style
+         DESTINATION ${NOMINATIM_CONFIGDIR})
diff --combined lib-php/admin/update.php
index e8d873cdb6bfeddd5159951b2b7774ecee99b166,fba5300b07ee4ec0d5791d01895bfe16eb1310e3..e8d873cdb6bfeddd5159951b2b7774ecee99b166
@@@ -52,7 -52,6 +52,7 @@@ loadSettings($aCMDResult['project-dir'
  setupHTTPProxy();
  
  if (!isset($aResult['index-instances'])) $aResult['index-instances'] = 1;
 +
  if (!isset($aResult['index-rank'])) $aResult['index-rank'] = 0;
  
  date_default_timezone_set('Etc/UTC');
diff --combined lib-php/website/403.html
index 8d8e3233b53bda92e9f3ba20058e5c6c23f2faeb,0000000000000000000000000000000000000000..8d8e3233b53bda92e9f3ba20058e5c6c23f2faeb
mode 100644,000000..100644
--- /dev/null
@@@ -1,23 -1,0 +1,23 @@@
 +<html>
 +<head>
 +<title>Access blocked</title>
 +</head>
 +<body>
 +<h1>Access blocked</h1>
 +
 +<p>You have been blocked because you have violated the
 +<a href="https://operations.osmfoundation.org/policies/nominatim/">usage policy</a>
 +of OSM's Nominatim geocoding service. Please be aware that OSM's resources are
 +limited and shared between many users. The usage policy is there to ensure that
 +the service remains usable for everybody.</p>
 +
 +<p>Please review the terms and make sure that your
 +software adheres to the terms. You should in particular verify that you have set a
 +<b>custom HTTP referrer or HTTP user agent</b> that identifies your application, and
 +that you are not overusing the service with massive bulk requests.</p>
 +
 +<p>If you feel that this block is unjustified or remains after you have adopted
 +your usage, you may contact the Nominatim system administrator at
 +nominatim@openstreetmap.org to have this block lifted.</p>
 +</body>
 +</head>
diff --combined lib-php/website/509.html
index 628c53bdfe8532ea595ff2f254b0e4f8873399ba,0000000000000000000000000000000000000000..628c53bdfe8532ea595ff2f254b0e4f8873399ba
mode 100644,000000..100644
--- /dev/null
@@@ -1,12 -1,0 +1,12 @@@
 +<html>
 +<head>
 +<title>Bandwidth limit exceeded</title>
 +</head>
 +<body>
 +<h1>Bandwidth limit exceeded</h1>
 +
 +<p>You have been temporarily blocked because you have been overusing OSM's geocoding service or because you have not provided sufficient identification of your application. This block will be automatically lifted after a while. Please take the time and adapt your scripts to reduce the number of requests and make sure that you send a valid UserAgent or Referer.</p>
 +
 +<p>For more information, consult the <a href="https://operations.osmfoundation.org/policies/nominatim/">usage policy</a> for the OSM Nominatim server.</p>
 +</body>
 +</html>
index 963a682b6d32202a183c39f9e58cbf412b3b3f0c,0000000000000000000000000000000000000000..963a682b6d32202a183c39f9e58cbf412b3b3f0c
mode 100644,000000..100644
--- /dev/null
@@@ -1,5 -1,0 +1,5 @@@
 +<?xml version="1.0"?>
 +          <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
 +          <cross-domain-policy>
 +          <allow-access-from domain="*" />
 +          </cross-domain-policy> 
index 0157ea008fd941f507323a72a108baaa3b72d06f,0000000000000000000000000000000000000000..0157ea008fd941f507323a72a108baaa3b72d06f
mode 100644,000000..100644
Binary files differ
index 28684b169970cea1d78bb4d2f07b9caf5df27337,0000000000000000000000000000000000000000..28684b169970cea1d78bb4d2f07b9caf5df27337
mode 100644,000000..100644
--- /dev/null
@@@ -1,15 -1,0 +1,15 @@@
 +<?xml version="1.0" encoding="UTF-8"?>
 +<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
 +                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
 +      <ShortName>Nominatim</ShortName>
 +      <LongName>Nominatim OSM Search</LongName>
 +      <Description>Search for a place in OpenStreetMap Nominatim</Description>
 +      <InputEncoding>UTF-8</InputEncoding>
 +      <OutputEncoding>UTF-8</OutputEncoding>
 +      <Url type="text/html" method="get" template="http://nominatim.openstreetmap.org/search/?q={searchTerms}" />
 +      <Query role="example" searchTerms="Reigate" />
 +      <Developer>Brian Quinion</Developer>
 +      <AdultContent>false</AdultContent>
 +      <Attribution>Data &amp;copy; OpenStreetMap contributors, Some Rights Reserved. ODbL, http://www.osm.org/copyright.</Attribution>
 +</OpenSearchDescription>
 +
index 9624d97ce0424891c17a5457738ea778c10ce4ab,0000000000000000000000000000000000000000..9624d97ce0424891c17a5457738ea778c10ce4ab
mode 100644,000000..100644
--- /dev/null
@@@ -1,14 -1,0 +1,14 @@@
 +User-agent: ia_archiver
 +Allow: /
 +
 +User-agent: *
 +Disallow: /search.php
 +Disallow: /search
 +Disallow: /details.php
 +Disallow: /details
 +Disallow: /reverse.php
 +Disallow: /reverse
 +Disallow: /hierarchy
 +Disallow: /hierarchy.php
 +Disallow: /lookup
 +Disallow: /lookup.php
index 98f8b978a7031672e5745247ef3c49a72ee5110b,0000000000000000000000000000000000000000..98f8b978a7031672e5745247ef3c49a72ee5110b
mode 100644,000000..100644
--- /dev/null
@@@ -1,112 -1,0 +1,112 @@@
 +{
 +    "data_format": 1,
 +    "data_url": "http://nominatim.openstreetmap.org/taginfo.json",
 +    "project": {
 +        "name": "Nominatim",
 +        "description": "OSM search engine.",
 +        "project_url": "http://nominatim.openstreetmap.org",
 +        "doc_url": "http://wiki.osm.org/wiki/Nominatim",
 +        "contact_name": "Sarah Hoffmann",
 +        "contact_email": "lonvia@denofr.de"
 +    },
 +    "tags": [
 +      { "key" : "ref", "description": "Searchable name of the place."},
 +      { "key" : "int_ref", "description": "Searchable name of the place."},
 +      { "key" : "nat_ref", "description": "Searchable name of the place."},
 +      { "key" : "reg_ref", "description": "Searchable name of the place."},
 +      { "key" : "loc_ref", "description": "Searchable name of the place."},
 +      { "key" : "old_ref", "description": "Searchable name of the place."},
 +      { "key" : "iata", "description": "Searchable name of the place."},
 +      { "key" : "icao", "description": "Searchable name of the place."},
 +      { "key" : "pcode", "description": "Searchable name of the place."},
 +      { "key" : "name", "description": "Searchable name of the place."},
 +      { "key" : "int_name", "description": "Searchable name of the place."},
 +      { "key" : "nat_name", "description": "Searchable name of the place."},
 +      { "key" : "reg_name", "description": "Searchable name of the place."},
 +      { "key" : "loc_name", "description": "Searchable name of the place."},
 +      { "key" : "old_name", "description": "Searchable name of the place."},
 +      { "key" : "alt_name", "description": "Searchable name of the place."},
 +      { "key" : "official_name", "description": "Searchable name of the place."},
 +      { "key" : "place_name", "description": "Searchable name of the place."},
 +      { "key" : "short_name", "description": "Searchable name of the place."},
 +      { "key" : "addr:housename", "description": "Searchable name of the place."},
 +      { "key" : "operator", "description": "Searchable name for amenities and shops." },
 +      { "key" : "brand", "description": "Searchable name of POI places."},
 +      { "key" : "bridge:name", "description" : "Searchable name for bridges."},
 +      { "key" : "tunnel:name", "description" : "Searchable name for tunnels."},
 +      { "key" : "emergency", "description": "POI in the search database." },
 +      { "key" : "tourism", "description": "POI in the search database." },
 +      { "key" : "historic", "description": "POI in the search database." },
 +      { "key" : "military", "description": "POI in the search database." },
 +      { "key" : "natural", "description": "POI in the search database." },
 +      { "key" : "man_made", "description": "POI in the search database." },
 +      { "key" : "mountain_pass", "description": "POI in the search database." },
 +      { "key" : "highway", "description": "POI or street in the search database (not added are: 'no', 'turning_circle', 'traffic_signals', 'mini_roundabout', 'crossing' and traffic signs)." },
 +      { "key" : "aerialway", "description": "POI in the search database (unless value is 'no', 'pylon')." },
 +      { "key" : "aeroway", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "amenity", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "boundary", "description": "Area in the search database (used to compute addresses of other places)." },
 +      { "key" : "bridge", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "craft", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "leisure", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "office", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "railway", "description": "Geographic feature in the search database (unless value is 'no')." },
 +      { "key" : "landuse", "description": "Geographic feature in the search database (unless value is 'no')." },
 +      { "key" : "shop", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "tunnel", "description": "POI in the search database (unless value is 'no')." },
 +      { "key" : "waterway", "description": "Geographic feature in the search database (unless value is 'riverbank')."},
 +      { "key" : "place", "description": "Settlement on the search database (used to compute addresses of other places)." },
 +      { "key" : "postal_code", "description": "Postcode in search database (used to compute postcodes of places around)." },
 +      { "key" : "postcode", "description": "Postcode in search database (used to compute postcodes of places around)." },
 +      { "key" : "addr:postcode", "description": "Postcode in search database (used to compute postcodes of places around)." },
 +      { "key" : "tiger:zip_left", "description": "Postcode in search database (used to compute postcodes of places around)." },
 +      { "key" : "tiger:zip_right", "description": "Postcode in search database (used to compute postcodes of places around)." },
 +      { "key" : "addr:street", "description": "Used to determine the street of a house or POI. Note that a street with the same name must exist for the tag to be effective."},
 +      { "key" : "addr:place", "description": "Used to determine the settlement of a house or POI with a street-less address."},
 +      { "key" : "country_code", "description": "Used to determine the country a place is in."},
 +      { "key" : "ISO3166-1", "description": "Used to determine the country a place is in."},
 +      { "key" : "is_in:country_code", "description": "Used to determine the country a place is in."},
 +      { "key" : "is_in:country", "description": "Used to determine the country a place is in."},
 +      { "key" : "addr:country", "description": "Used to determine the country a place is in."},
 +      { "key" : "addr:country_code", "description": "Used to determine the country a place is in."},
 +      { "key" : "addr:housenumber", "description": "House number of the place (no ranges)."},
 +      { "key" : "addr:conscriptionnumber", "description": "House number of the place (Eastern European system)."},
 +      { "key" : "addr:streetnumber", "description": "House number of the place (Eastern European system)."},
 +      { "key" : "addr:interpolation", "description": "Way along which house numbers are interpolated."} ,
 +      { "key" : "tiger:county", "description": "Used to determine the address in the US (needs a place with the same name and a county suffix)."},
 +      { "key" : "addr:suburb", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:city", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:state_code", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:state", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:province", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:district", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:region", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:county", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:municipality", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:hamlet", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:village", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:subdistrict", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:town", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:neighbourhood", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:quarter", "description": "Used to determine the address of a place."},
 +      { "key" : "addr:parish", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:suburb", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:city", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:state_code", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:state", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:province", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:district", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:region", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:county", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:municipality", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:hamlet", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:village", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:subdistrict", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:town", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:neighbourhood", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:quarter", "description": "Used to determine the address of a place."},
 +      { "key" : "is_in:parish", "description": "Used to determine the address of a place."},
 +      { "key" : "admin_level", "description": "Determines the hierarchy for administrative boundaries."},
 +      { "key" : "wikipedia", "description": "Linking to the right wikipedia article helps to guess the importance of a place, which determines how far up in the search results it appears."}
 +   ]
 +}
index b832aed83e1250621e7fe0ca110888dab36fd128,4d7cc789e9a59acffc9b65246ce405cf56620377..b832aed83e1250621e7fe0ca110888dab36fd128
@@@ -223,7 -223,7 +223,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)