X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/890d415e1ffd997d11ed35dee04cb01b94ca133f..8c444378bcc542413eaa5789e21995e33c96a751:/lib/PlaceLookup.php diff --git a/lib/PlaceLookup.php b/lib/PlaceLookup.php index cf3e4f7b..1a76389a 100644 --- a/lib/PlaceLookup.php +++ b/lib/PlaceLookup.php @@ -215,7 +215,7 @@ class PlaceLookup 'ST_Collect(centroid)', 'min(CASE WHEN placex.rank_search < 28 THEN placex.place_id ELSE placex.parent_place_id END)' ); - $sSQL .= " (extratags->'place') AS extra_place "; + $sSQL .= " COALESCE(extratags->'place', extratags->'linked_place') AS extra_place "; $sSQL .= ' FROM placex'; $sSQL .= " WHERE place_id in ($sPlaceIDs) "; $sSQL .= ' AND ('; @@ -248,7 +248,7 @@ class PlaceLookup $sSQL .= ' ref, '; if ($this->bExtraTags) $sSQL .= 'extratags, '; if ($this->bNameDetails) $sSQL .= 'name, '; - $sSQL .= " extratags->'place' "; + $sSQL .= " extra_place "; $aSubSelects[] = $sSQL; } @@ -428,6 +428,7 @@ class PlaceLookup $aPlaces = $this->oDB->getAll($sSQL, null, 'Could not lookup place'); foreach ($aPlaces as &$aPlace) { + $aPlace['importance'] = (float) $aPlace['importance']; if ($this->bAddressDetails) { // to get addressdetails for tiger data, the housenumber is needed $aPlace['address'] = new AddressDetails(