From: Sarah Hoffmann Date: Sat, 10 Feb 2018 14:50:42 +0000 (+0100) Subject: Merge pull request #905 from mtmail/illinois-li-case-insensitive X-Git-Tag: v3.2.0~129 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/3505417e3f4f027ae554a2f1ffdb7a8796d58f91?hp=315713ff9a00cf1c942d2c73ecae54571f29acd5 Merge pull request #905 from mtmail/illinois-li-case-insensitive make sure Illinois,Alabama,Louisiana state code special handling is case insensitive --- diff --git a/lib/Geocode.php b/lib/Geocode.php index b2eee7ba..d5647c76 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -225,14 +225,14 @@ class Geocode $aViewbox = $oParams->getStringList('viewboxlbrt'); if ($aViewbox) { if (count($aViewbox) != 4) { - userError("Bad parmater 'viewboxlbrt'. Expected 4 coordinates."); + userError("Bad parameter 'viewboxlbrt'. Expected 4 coordinates."); } $this->setViewbox($aViewbox); } else { $aViewbox = $oParams->getStringList('viewbox'); if ($aViewbox) { if (count($aViewbox) != 4) { - userError("Bad parmater 'viewbox'. Expected 4 coordinates."); + userError("Bad parameter 'viewbox'. Expected 4 coordinates."); } $this->setViewBox($aViewbox); } else { diff --git a/lib/lib.php b/lib/lib.php index b5c4df13..e283e836 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -530,11 +530,12 @@ function parseLatLon($sQuery) $sFound = $aData[0]; $fQueryLat = ($aData[1]=='N'?1:-1) * ($aData[2] + $aData[3]/60 + $aData[4]/3600); $fQueryLon = ($aData[5]=='E'?1:-1) * ($aData[6] + $aData[7]/60 + $aData[8]/3600); - } elseif (preg_match('/\\s*([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+)[″" ]+([NS])[, ]+([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+)[″" ]+([EW])\\s*/', $sQuery, $aData)) { - /* 1 2 3 4 5 6 7 8 + } elseif (preg_match('/\\s*([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+[0-9.]*)[″" ]+([NS])[, ]+([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+[0-9.]*)[″" ]+([EW])\\s*/', $sQuery, $aData)) { + /* 1 2 3 4 5 6 7 8 * degrees decimal seconds * 40 26 46 N 79 58 56 W * 40° 26′ 46″ N, 79° 58′ 56″ W + * 40° 26′ 46.78″ N, 79° 58′ 56.89″ W */ $sFound = $aData[0]; $fQueryLat = ($aData[4]=='N'?1:-1) * ($aData[1] + $aData[2]/60 + $aData[3]/3600); diff --git a/test/php/Nominatim/NominatimTest.php b/test/php/Nominatim/NominatimTest.php index 60770208..ed738c37 100644 --- a/test/php/Nominatim/NominatimTest.php +++ b/test/php/Nominatim/NominatimTest.php @@ -171,6 +171,8 @@ class NominatimTest extends \PHPUnit_Framework_TestCase '40 26 46 N 79 58 56 W', '40° 26′ 46″ N 79° 58′ 56″ W', + '40° 26′ 46.00″ N 79° 58′ 56.00″ W', + '40°26′46″N 79°58′56″W', 'N 40 26 46 W 79 58 56', 'N 40° 26′ 46″, W 79° 58′ 56″', 'N 40° 26\' 46", W 79° 58\' 56"', diff --git a/utils/update.php b/utils/update.php index d34010c7..d643e4bc 100755 --- a/utils/update.php +++ b/utils/update.php @@ -263,7 +263,8 @@ 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://nominatim.org/release-docs/latest/Import-and-Update#setting-up-the-update-process)\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';