X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8e2b5d7ce3163bf3029be4d519fb978b68ca3b52..aa9fff919900caafb276630b8ca4f1c1c598ab1c:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index f760dc09..fd1f5c27 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -1,7 +1,8 @@ CONST_PolygonOutput_MaximumTypes) + { + if (CONST_PolygonOutput_MaximumTypes) + { + userError("Select only ".CONST_PolygonOutput_MaximumTypes." polgyon output option"); + } + else + { + userError("Polygon output is disabled"); + } + exit; + } + + + // Polygon simplification threshold (optional) + $fThreshold = 0.0; + if (isset($_GET['polygon_threshold'])) $fThreshold = (float)$_GET['polygon_threshold']; + + $oDB =& getDB(); ini_set('memory_limit', '200M'); @@ -63,6 +94,21 @@ $oPlaceLookup->setIncludeNameDetails(getParamBool('namedetails', false)); $aPlace = $oPlaceLookup->lookupPlace($aLookup); + + $oPlaceLookup->setIncludePolygonAsPoints($bAsPoints); + $oPlaceLookup->setIncludePolygonAsText($bAsText); + $oPlaceLookup->setIncludePolygonAsGeoJSON($bAsGeoJSON); + $oPlaceLookup->setIncludePolygonAsKML($bAsKML); + $oPlaceLookup->setIncludePolygonAsSVG($bAsSVG); + $oPlaceLookup->setPolygonSimplificationThreshold($fThreshold); + + $fRadius = $fDiameter = getResultDiameter($aPlace); + $aOutlineResult = $oPlaceLookup->getOutlines($aPlace['place_id'], $aPlace['lon'], $aPlace['lat'], $fRadius); + + if ($aOutlineResult) + { + $aPlace = array_merge($aPlace, $aOutlineResult); + } } else {