]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 5 Jan 2018 21:47:37 +0000 (22:47 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 5 Jan 2018 21:47:37 +0000 (22:47 +0100)
README.md
VAGRANT.md
nominatim/export.c
settings/defaults.php
utils/country_languages.php
utils/setup.php
utils/specialphrases.php
utils/update.php
website/js/nominatim-ui.js
website/polygons.php

index 42c4d72c72b0ea9eba5da446b3577498c5371243..30fb75555a9186d9f0e7bbf8e1ec025ce5720fc3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Nominatim
 Nominatim (from the Latin, 'by name') is a tool to search OpenStreetMap data
 by name and address (geocoding) and to generate synthetic addresses of
 OSM points (reverse geocoding). An instance with up-to-date data can be found
-at http://nominatim.openstreetmap.org. Nominatim is also used as one of the
+at https://nominatim.openstreetmap.org. Nominatim is also used as one of the
 sources for the Search box on the OpenStreetMap home page and powers the search
 on the MapQuest Open Initiative websites.
 
@@ -16,7 +16,7 @@ Documentation
 More information about Nominatim, including usage and installation instructions,
 can be found in the docs/ subdirectory and in the OSM wiki at:
 
-http://wiki.openstreetmap.org/wiki/Nominatim
+http://nominatim.org
 
 Installation
 ============
@@ -52,7 +52,7 @@ Contact and Bug reports
 ======================
 
 For questions you can join the geocoding mailinglist, see
-http://lists.openstreetmap.org/listinfo/geocoding
+https://lists.openstreetmap.org/listinfo/geocoding
 
 Bugs may be reported on the github project site:
 https://github.com/openstreetmap/Nominatim
index 41d3024efe5749abf2e9841bc5ebb8cbcd348299..de36bc576ec62a97cd792858e62dba21be36011b 100644 (file)
@@ -128,7 +128,7 @@ No. Long running Nominatim installations will differ once new import features (o
 bug fixes) get added since those usually only get applied to new/changed data.
 
 Also this document skips the optional Wikipedia data import which affects ranking
-of search results. See [Nominatim installation](http://wiki.openstreetmap.org/wiki/Nominatim/Installation) for details.
+of search results. See [Nominatim installation](http://nominatim.org/release-docs/latest/Installation) for details.
 
 ##### Why Ubuntu and CentOS, can I test CentOS/CoreOS/FreeBSD?
 
index 467b3c8cb0f51489d98fd8df74714f2480aadafa..b9628e14daf9c7d14710e37feafac83044def064 100644 (file)
@@ -152,7 +152,7 @@ void nominatim_exportCreatePreparedQueries(PGconn * conn)
 
     pg_prepare_params[0] = PG_OID_INT8;
     res = PQprepare(conn, "placex_details",
-                    "select placex.osm_type, placex.osm_id, placex.class, placex.type, placex.name, placex.housenumber, placex.country_code, ST_AsText(placex.geometry), placex.admin_level, placex.rank_address, placex.rank_search, placex.parent_place_id, parent.osm_type, parent.osm_id, placex.indexed_status from placex left outer join placex as parent on (placex.parent_place_id = parent.place_id) where placex.place_id = $1",
+                    "select placex.osm_type, placex.osm_id, placex.class, placex.type, placex.name, placex.housenumber, placex.country_code, ST_AsText(placex.geometry), placex.admin_level, placex.rank_address, placex.rank_search, placex.parent_place_id, parent.osm_type, parent.osm_id, placex.indexed_status, placex.linked_place_id from placex left outer join placex as parent on (placex.parent_place_id = parent.place_id) where placex.place_id = $1",
                     1, pg_prepare_params);
     if (PQresultStatus(res) != PGRES_COMMAND_OK)
     {
@@ -355,7 +355,7 @@ void nominatim_exportFreeQueries(struct export_data * querySet)
 /*
  * Requirements: the prepared queries must exist
  */
-void nominatim_exportPlace(uint64_t place_id, PGconn * conn, 
+void nominatim_exportPlace(uint64_t place_id, PGconn * conn,
   xmlTextWriterPtr writer, pthread_mutex_t * writer_mutex, struct export_data * prevQuerySet)
 {
     struct export_data         querySet;
@@ -387,7 +387,7 @@ void nominatim_exportPlace(uint64_t place_id, PGconn * conn,
         {
             // Add
             if (writer_mutex) pthread_mutex_lock( writer_mutex );
-            nominatim_exportStartMode(writer, 1);  
+            nominatim_exportStartMode(writer, 1);
         }
         else
         {
@@ -396,14 +396,14 @@ void nominatim_exportPlace(uint64_t place_id, PGconn * conn,
             // TODO: detect changes
 
             if (writer_mutex) pthread_mutex_lock( writer_mutex );
-            nominatim_exportStartMode(writer, 2);  
+            nominatim_exportStartMode(writer, 2);
         }
     }
     else
     {
        // Add
        if (writer_mutex) pthread_mutex_lock( writer_mutex );
-       nominatim_exportStartMode(writer, 1);  
+       nominatim_exportStartMode(writer, 1);
     }
 
     xmlTextWriterStartElement(writer, BAD_CAST "feature");
@@ -417,6 +417,7 @@ void nominatim_exportPlace(uint64_t place_id, PGconn * conn,
     xmlTextWriterWriteAttribute(writer, BAD_CAST "parent_place_id", BAD_CAST PQgetvalue(querySet.res, 0, 11));
     xmlTextWriterWriteAttribute(writer, BAD_CAST "parent_type", BAD_CAST PQgetvalue(querySet.res, 0, 12));
     xmlTextWriterWriteAttribute(writer, BAD_CAST "parent_id", BAD_CAST PQgetvalue(querySet.res, 0, 13));
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "linked_place_id", BAD_CAST PQgetvalue(querySet.res, 0, 15));
 
     if (PQntuples(querySet.resNames))
     {
index 9c0859bad19e5b7c5ca5958d6f828c95769c7821..81c19c74307491aeb9b502bb5d6d0c652e98f5b3 100644 (file)
@@ -72,7 +72,7 @@ if (isset($_GET['debug']) && $_GET['debug']) @define('CONST_Debug', true);
 //// Replication settings
 
 // Base URL of replication service
-@define('CONST_Replication_Url', 'http://planet.openstreetmap.org/replication/minute');
+@define('CONST_Replication_Url', 'https://planet.openstreetmap.org/replication/minute');
 
 // Maximum size in MB of data to download per batch
 @define('CONST_Replication_Max_Diff_size', '30');
index 5ca61184abb14d489c3b40abf6e8604837b66918..19ad25b82570833816540f7b257614f201482267 100755 (executable)
@@ -19,7 +19,7 @@ getCmdOpt($_SERVER['argv'], $aCMDOptions, $aCMDResult, true, true);
 include(CONST_InstallPath.'/settings/phrase_settings.php');
 
 if (true) {
-    $sURL = 'http://wiki.openstreetmap.org/wiki/Special:Export/Nominatim/Country_Codes';
+    $sURL = 'https://wiki.openstreetmap.org/wiki/Special:Export/Nominatim/Country_Codes';
     $sWikiPageXML = file_get_contents($sURL);
     if (preg_match_all('#\\| ([a-z]{2}) \\|\\| [^|]+\\|\\| ([a-z,]+)#', $sWikiPageXML, $aMatches, PREG_SET_ORDER)) {
         foreach ($aMatches as $aMatch) {
index c6cc7773dfdef7f119db162f94570fea80681fce..b93e4f827988c37060570f47e57c310c3575f483 100755 (executable)
@@ -540,10 +540,8 @@ if ($aCMDResult['calculate-postcodes'] || $aCMDResult['all']) {
         $sSQL .= '  FROM us_postcode WHERE postcode NOT IN';
         $sSQL .= '        (SELECT postcode FROM location_postcode';
         $sSQL .= "          WHERE country_code = 'us')";
-    } else {
-        $sSQL .= 'TRUNCATE TABLE us_postcode';
+        if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection));
     }
-    if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection));
 
     // add missing postcodes for GB (if available)
     $sSQL  = 'INSERT INTO location_postcode';
@@ -657,6 +655,7 @@ if ($aCMDResult['drop']) {
                     'import_polygon_*',
                     'import_status',
                     'place_addressline',
+                    'location_postcode',
                     'location_property*',
                     'placex',
                     'search_name',
@@ -664,7 +663,6 @@ if ($aCMDResult['drop']) {
                     'word',
                     'query_log',
                     'new_query_log',
-                    'gb_postcode',
                     'spatial_ref_sys',
                     'country_name',
                     'place_classtype_*'
index ec00cb629d3a8767715223af846453e532044701..8378b37339a1b1f64c7594d5b513a1888ce27d73 100755 (executable)
@@ -27,7 +27,7 @@ if ($aCMDResult['wiki-import']) {
          'ia,is,it,ja,mk,nl,no,pl,ps,pt,ru,sk,sl,sv,uk,vi');
 
     foreach (explode(',', $sLanguageIn) as $sLanguage) {
-        $sURL = 'http://wiki.openstreetmap.org/wiki/Special:Export/Nominatim/Special_Phrases/'.strtoupper($sLanguage);
+        $sURL = 'https://wiki.openstreetmap.org/wiki/Special:Export/Nominatim/Special_Phrases/'.strtoupper($sLanguage);
         $sWikiPageXML = file_get_contents($sURL);
         if (preg_match_all('#\\| ([^|]+) \\|\\| ([^|]+) \\|\\| ([^|]+) \\|\\| ([^|]+) \\|\\| ([\\-YN])#', $sWikiPageXML, $aMatches, PREG_SET_ORDER)) {
             foreach ($aMatches as $aMatch) {
index bb77e430d860a0cbb028d791945d23f5c2860ad6..e35554888d4de0519571a6feca4afc1edddbaf8e 100755 (executable)
@@ -131,25 +131,25 @@ $bUseOSMApi = isset($aResult['import-from-main-api']) && $aResult['import-from-m
 $sContentURL = '';
 if (isset($aResult['import-node']) && $aResult['import-node']) {
     if ($bUseOSMApi) {
-        $sContentURL = 'http://www.openstreetmap.org/api/0.6/node/'.$aResult['import-node'];
+        $sContentURL = 'https://www.openstreetmap.org/api/0.6/node/'.$aResult['import-node'];
     } else {
-        $sContentURL = 'http://overpass-api.de/api/interpreter?data=node('.$aResult['import-node'].');out%20meta;';
+        $sContentURL = 'https://overpass-api.de/api/interpreter?data=node('.$aResult['import-node'].');out%20meta;';
     }
 }
 
 if (isset($aResult['import-way']) && $aResult['import-way']) {
     if ($bUseOSMApi) {
-        $sContentURL = 'http://www.openstreetmap.org/api/0.6/way/'.$aResult['import-way'].'/full';
+        $sContentURL = 'https://www.openstreetmap.org/api/0.6/way/'.$aResult['import-way'].'/full';
     } else {
-        $sContentURL = 'http://overpass-api.de/api/interpreter?data=(way('.$aResult['import-way'].');node(w););out%20meta;';
+        $sContentURL = 'https://overpass-api.de/api/interpreter?data=(way('.$aResult['import-way'].');node(w););out%20meta;';
     }
 }
 
 if (isset($aResult['import-relation']) && $aResult['import-relation']) {
     if ($bUseOSMApi) {
-        $sContentURLsModifyXMLstr = 'http://www.openstreetmap.org/api/0.6/relation/'.$aResult['import-relation'].'/full';
+        $sContentURLsModifyXMLstr = 'https://www.openstreetmap.org/api/0.6/relation/'.$aResult['import-relation'].'/full';
     } else {
-        $sContentURL = 'http://overpass-api.de/api/interpreter?data=((rel('.$aResult['import-relation'].');way(r);node(w));node(r));out%20meta;';
+        $sContentURL = 'https://overpass-api.de/api/interpreter?data=((rel('.$aResult['import-relation'].');way(r);node(w));node(r));out%20meta;';
     }
 }
 
@@ -252,7 +252,7 @@ if ($aResult['index']) {
 if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) {
     //
     if (strpos(CONST_Replication_Url, 'download.geofabrik.de') !== false && CONST_Replication_Update_Interval < 86400) {
-        fail("Error: Update interval too low for download.geofabrik.de.  Please check install documentation (http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Updates)\n");
+        fail("Error: Update interval too low for download.geofabrik.de.  Please check install documentation (http://nominatim.org/release-docs/latest/Import-and-Update#setting-up-the-update-process)\n");
     }
 
     $sImportFile = CONST_InstallPath.'/osmosischange.osc';
index ccd403fa7160b35cde5f8cb10aa5ac55cf1c7d1b..64160c84bcc0d317c9ed72d362c8d87bd0425090 100644 (file)
@@ -143,7 +143,7 @@ jQuery(document).ready(function(){
         ].join(',');
     }
     function map_link_to_osm(){
-        return "http://openstreetmap.org/#map=" + map.getZoom() + "/" + map.getCenter().lat + "/" + map.getCenter().lng;
+        return "https://openstreetmap.org/#map=" + map.getZoom() + "/" + map.getCenter().lat + "/" + map.getCenter().lng;
     }
 
     function get_result_element(position){
index b249ae03382fa476d5583938a8b7d0705b453395..4c1401efdfbe5f3a366d35f36fba4840ffd8b540 100755 (executable)
@@ -102,7 +102,6 @@ foreach ($aPolygons[0] as $sCol => $sVal) {
     echo '<th>'.$sCol.'</th>';
 }
 echo '<th>&nbsp;</th>';
-echo '<th>&nbsp;</th>';
 echo '</tr>';
 $aSeen = array();
 foreach ($aPolygons as $aRow) {
@@ -115,7 +114,7 @@ foreach ($aPolygons as $aRow) {
                 if (preg_match('/Self-intersection\\[([0-9.\\-]+) ([0-9.\\-]+)\\]/', $sVal, $aMatch)) {
                     $aRow['lat'] = $aMatch[2];
                     $aRow['lon'] = $aMatch[1];
-                    echo '<td><a href="http://www.openstreetmap.org/?lat='.$aMatch[2].'&lon='.$aMatch[1].'&zoom=18&layers=M&'.$sOSMType.'='.$aRow['id'].'">'.($sVal?$sVal:'&nbsp;').'</a></td>';
+                    echo '<td><a href="https://www.openstreetmap.org/?lat='.$aMatch[2].'&lon='.$aMatch[1].'&zoom=18&layers=M&'.$sOSMType.'='.$aRow['id'].'">'.($sVal?$sVal:'&nbsp;').'</a></td>';
                 } else {
                     echo '<td>'.($sVal?$sVal:'&nbsp;').'</td>';
                 }
@@ -128,12 +127,7 @@ foreach ($aPolygons as $aRow) {
                 break;
         }
     }
-    echo '<td><a href="http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/'.$sOSMType.'/'.$aRow['id'].'/full" target="josm">josm</a></td>';
-    if (isset($aRow['lat'])) {
-        echo '<td><a href="http://open.mapquestapi.com/dataedit/index_flash.html?lat='.$aRow['lat'].'&lon='.$aRow['lon'].'&zoom=18" target="potlatch2">P2</a></td>';
-    } else {
-        echo '<td>&nbsp;</td>';
-    }
+    echo '<td><a href="http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/'.$sOSMType.'/'.$aRow['id'].'/full" target="josm">josm</a></td>';
     echo '</tr>';
 }
 echo '</table>';