]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/NearPoint.php
fix to NearPoint::extractFromQuery handling first minus sign
[nominatim.git] / lib / NearPoint.php
index e8d595cc47ee5cf6603f2b7e6a4c51185c0e2613..4f0531d91510fbe4c2146c8a17259287c29eade6 100644 (file)
@@ -133,8 +133,8 @@ class NearPoint
             $sFound    = $aData[0];
             $fQueryLat = ($aData[2]=='N'?1:-1) * ($aData[1]);
             $fQueryLon = ($aData[4]=='E'?1:-1) * ($aData[3]);
             $sFound    = $aData[0];
             $fQueryLat = ($aData[2]=='N'?1:-1) * ($aData[1]);
             $fQueryLon = ($aData[4]=='E'?1:-1) * ($aData[3]);
-        } elseif (preg_match('/(\\[|^|\\b)(-?[0-9]+[0-9]*\\.[0-9]+)[, ]+(-?[0-9]+[0-9]*\\.[0-9]+)(\\]|$|\\b)/', $sQuery, $aData)) {
-            /*                 1          2                             3                        4
+        } elseif (preg_match('/(\\[|^|\\b)?(-?[0-9]+[0-9]*\\.[0-9]+)[, ]+(-?[0-9]+[0-9]*\\.[0-9]+)(\\]|$|\\b)/', $sQuery, $aData)) {
+            /*                 1           2                             3                        4
              * degrees decimal
              * 12.34, 56.78
              * [12.456,-78.90]
              * degrees decimal
              * 12.34, 56.78
              * [12.456,-78.90]