]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 31 Aug 2017 19:46:55 +0000 (21:46 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 31 Aug 2017 19:46:55 +0000 (21:46 +0200)
1  2 
sql/functions.sql
utils/update.php

diff --combined sql/functions.sql
index db382116a8cb9af7e9916231db10d58a7f5b3038,930fa56130d2deddb7f744db58f5decf2207ca95..e00c97a2e985764223b1e3ce7da314de649dd7bc
@@@ -844,6 -844,9 +844,9 @@@ BEGI
        ELSE
          NEW.rank_address := 0;
        END IF;
+     ELSEIF NEW.class = 'leisure' and NEW.type in ('park') THEN
+       NEW.rank_search := 24;
+       NEW.rank_address := 0;
      ELSEIF NEW.class = 'natural' and NEW.type in ('peak','volcano','mountain_range') THEN
        NEW.rank_search := 18;
        NEW.rank_address := 0;
@@@ -2433,7 -2436,7 +2436,7 @@@ BEGI
        CASE WHEN class = 'place' and type = 'postcode' THEN hstore('name', postcode) ELSE name END as name,
        CASE WHEN extratags ? 'place' THEN 'place' ELSE class END as class,
        CASE WHEN extratags ? 'place' THEN extratags->'place' ELSE type END as type,
 -      admin_level, fromarea, isaddress,
 +      admin_level, fromarea, isaddress and linked_place_id is NULL as isaddress,
        CASE WHEN address_place_id = for_place_id AND rank_address = 0 THEN 100 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) 
@@@ -2892,7 -2895,7 +2895,7 @@@ BEGI
      IF ST_GeometryType(placegeom) in ('ST_Polygon','ST_MultiPolygon') THEN
        FOR geom IN select split_geometry(placegeom) FROM placex WHERE place_id = placeid LOOP
          update placex set indexed_status = 2 where (st_covers(geom, placex.geometry) OR ST_Intersects(geom, placex.geometry)) 
-         AND rank_search > rank and indexed_status = 0 and ST_geometrytype(placex.geometry) = 'ST_Point' and (rank_search < 28 or name is not null or (rank >= 16 and address > 'place'));
+         AND rank_search > rank and indexed_status = 0 and ST_geometrytype(placex.geometry) = 'ST_Point' and (rank_search < 28 or name is not null or (rank >= 16 and address ? 'place'));
          update placex set indexed_status = 2 where (st_covers(geom, placex.geometry) OR ST_Intersects(geom, placex.geometry)) 
          AND rank_search > rank and indexed_status = 0 and ST_geometrytype(placex.geometry) != 'ST_Point' and (rank_search < 28 or name is not null or (rank >= 16 and address ? 'place'));
        END LOOP;
diff --combined utils/update.php
index 1f036ff000bda0b8a2537c729358655eed12111b,3cc9cdd69ab786eddf7570a4afa923bee7d8622d..d4dc60c5278622713df2439643142197afc966f1
@@@ -38,7 -38,6 +38,7 @@@ $aCMDOption
  getCmdOpt($_SERVER['argv'], $aCMDOptions, $aResult, true, true);
  
  if (!isset($aResult['index-instances'])) $aResult['index-instances'] = 1;
 +
  if (!isset($aResult['index-rank'])) $aResult['index-rank'] = 0;
  
  date_default_timezone_set('Etc/UTC');
@@@ -60,6 -59,13 +60,13 @@@ if (!is_null(CONST_Osm2pgsql_Flatnode_F
  }
  
  if ($aResult['init-updates']) {
+     // sanity check that the replication URL is correct
+     $sBaseState = file_get_contents(CONST_Replication_Url.'/state.txt');
+     if ($sBaseState === false) {
+         echo "\nCannot find state.txt file at the configured replication URL.\n";
+         echo "Does the URL point to a directory containing OSM update data?\n\n";
+         fail("replication URL not reachable.");
+     }
      $sSetup = CONST_InstallPath.'/utils/setup.php';
      $iRet = -1;
      passthru($sSetup.' --create-functions --enable-diff-updates', $iRet);
@@@ -76,9 -82,9 +83,9 @@@
  
      // get the appropriate state id
      $aOutput = 0;
-     exec(CONST_Pyosmium_Binary.' -D '.$sWindBack.' --server '.CONST_Replication_Url,
-         $aOutput, $iRet);
-     if ($iRet != 0) {
+     $sCmd = CONST_Pyosmium_Binary.' -D '.$sWindBack.' --server '.CONST_Replication_Url;
+     exec($sCmd, $aOutput, $iRet);
+     if ($iRet != 0 || $aOutput[0] == 'None') {
          fail('Error running pyosmium tools');
      }