mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-23 13:44:36 +03:00
fixed getoutlinesfunction
This commit is contained in:
parent
d5e39260b3
commit
a5750a6ef6
@ -557,10 +557,10 @@ class PlaceLookup
|
|||||||
if ($this->bIncludePolygonAsText || $this->bIncludePolygonAsPoints) $sSQL .= ',ST_AsText(geometry) as astext';
|
if ($this->bIncludePolygonAsText || $this->bIncludePolygonAsPoints) $sSQL .= ',ST_AsText(geometry) as astext';
|
||||||
if ($fLonReverse != null && $fLatReverse != null) {
|
if ($fLonReverse != null && $fLatReverse != null) {
|
||||||
$sFrom = ' from (SELECT * , ST_ClosestPoint(geometry, ST_SetSRID(ST_Point('.$fLatReverse.','.$fLonReverse.'),4326)) AS closest_point';
|
$sFrom = ' from (SELECT * , ST_ClosestPoint(geometry, ST_SetSRID(ST_Point('.$fLatReverse.','.$fLonReverse.'),4326)) AS closest_point';
|
||||||
|
$sFrom .= ' from placex where place_id = '.$iPlaceID.') as plx';
|
||||||
} else {
|
} else {
|
||||||
$sFrom = ' from placex where place_id = '.$iPlaceID;
|
$sFrom = ' from placex where place_id = '.$iPlaceID;
|
||||||
}
|
}
|
||||||
$sFrom .= ' from placex where place_id = '.$iPlaceID.') as plx';
|
|
||||||
if ($this->fPolygonSimplificationThreshold > 0) {
|
if ($this->fPolygonSimplificationThreshold > 0) {
|
||||||
$sSQL .= ' from (select place_id,centroid,ST_SimplifyPreserveTopology(geometry,'.$this->fPolygonSimplificationThreshold.') as geometry'.$sFrom.') as plx';
|
$sSQL .= ' from (select place_id,centroid,ST_SimplifyPreserveTopology(geometry,'.$this->fPolygonSimplificationThreshold.') as geometry'.$sFrom.') as plx';
|
||||||
} else {
|
} else {
|
||||||
|
@ -127,10 +127,6 @@ class ReverseGeocode
|
|||||||
|
|
||||||
protected function lookupPolygon($sPointSQL, $iMaxRank)
|
protected function lookupPolygon($sPointSQL, $iMaxRank)
|
||||||
{
|
{
|
||||||
|
|
||||||
$oResult = null;
|
|
||||||
$aPlace = null;
|
|
||||||
|
|
||||||
$sSQL = 'SELECT * FROM';
|
$sSQL = 'SELECT * FROM';
|
||||||
$sSQL .= '(select place_id,parent_place_id,rank_address, rank_search, country_code, geometry';
|
$sSQL .= '(select place_id,parent_place_id,rank_address, rank_search, country_code, geometry';
|
||||||
$sSQL .= ' FROM placex';
|
$sSQL .= ' FROM placex';
|
||||||
@ -253,6 +249,9 @@ class ReverseGeocode
|
|||||||
$iParentPlaceID = $aPlace['parent_place_id'];
|
$iParentPlaceID = $aPlace['parent_place_id'];
|
||||||
|
|
||||||
if ($bDoInterpolation && $iMaxRank >= 30) {
|
if ($bDoInterpolation && $iMaxRank >= 30) {
|
||||||
|
if ($aPlace['rank_address'] <=27) {
|
||||||
|
$iDistance = 0.001;
|
||||||
|
}
|
||||||
$aHouse = $this->lookupInterpolation($sPointSQL, $iDistance);
|
$aHouse = $this->lookupInterpolation($sPointSQL, $iDistance);
|
||||||
|
|
||||||
if ($aHouse) {
|
if ($aHouse) {
|
||||||
@ -282,7 +281,7 @@ class ReverseGeocode
|
|||||||
'Could not determine closest place.'
|
'Could not determine closest place.'
|
||||||
);
|
);
|
||||||
if ($aStreet) {
|
if ($aStreet) {
|
||||||
$iDistance = $aPlace['distance'];
|
$iDistance = $aStreet['distance'];
|
||||||
$iPlaceID = $aStreet['place_id'];
|
$iPlaceID = $aStreet['place_id'];
|
||||||
$oResult = new Result($iPlaceID);
|
$oResult = new Result($iPlaceID);
|
||||||
$iParentPlaceID = $aStreet['parent_place_id'];
|
$iParentPlaceID = $aStreet['parent_place_id'];
|
||||||
|
Loading…
Reference in New Issue
Block a user