X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/deefdde24b63ad4e446c67cff255cad6ba0feb1f..3d1caa5a6ce8b5f4886f2941d25df6fc796de662:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index c79dcf1e..38f76142 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1605,7 +1605,7 @@ if (isset($aClassType[$aResult['class'].':'.$aResult['type'].':'.$aResult['admin_level']]['defdiameter']) && $aClassType[$aResult['class'].':'.$aResult['type'].':'.$aResult['admin_level']]['defdiameter']) { - $fDiameter = $aClassType[$aResult['class'].':'.$aResult['type'].':'.$aResult['admin_level']]['defzoom']; + $fDiameter = $aClassType[$aResult['class'].':'.$aResult['type'].':'.$aResult['admin_level']]['defdiameter']; } elseif (isset($aClassType[$aResult['class'].':'.$aResult['type']]['defdiameter']) && $aClassType[$aResult['class'].':'.$aResult['type']]['defdiameter']) @@ -1669,7 +1669,7 @@ */ elseif (preg_match('#POINT\\((-?[0-9.]+) (-?[0-9.]+)\\)#',$aPointPolygon['astext'],$aMatch)) { - $iSteps = ($fRadius * 40000)^2; + $iSteps = max(8, min(100, ($fRadius * 40000)^2)); $fStepSize = (2*pi())/$iSteps; $aPolyPoints = array(); for($f = 0; $f < 2*pi(); $f += $fStepSize) @@ -1699,7 +1699,7 @@ $aPointPolygon['minlon'] = $aPointPolygon['minlon'] - $fRadius; $aPointPolygon['maxlon'] = $aPointPolygon['maxlon'] + $fRadius; } - $aResult['aBoundingBox'] = array($aPointPolygon['minlat'],$aPointPolygon['maxlat'],$aPointPolygon['minlon'],$aPointPolygon['maxlon']); + $aResult['aBoundingBox'] = array((string)$aPointPolygon['minlat'],(string)$aPointPolygon['maxlat'],(string)$aPointPolygon['minlon'],(string)$aPointPolygon['maxlon']); } }