mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
decode_json() always create arrays instead of objects
This commit is contained in:
@@ -445,7 +445,7 @@ class PlaceLookup
|
|||||||
|
|
||||||
if ($this->bExtraTags) {
|
if ($this->bExtraTags) {
|
||||||
if ($aPlace['extra']) {
|
if ($aPlace['extra']) {
|
||||||
$aPlace['sExtraTags'] = json_decode($aPlace['extra']);
|
$aPlace['sExtraTags'] = json_decode($aPlace['extra'], true);
|
||||||
} else {
|
} else {
|
||||||
$aPlace['sExtraTags'] = (object) array();
|
$aPlace['sExtraTags'] = (object) array();
|
||||||
}
|
}
|
||||||
@@ -482,7 +482,7 @@ class PlaceLookup
|
|||||||
return (object) array();
|
return (object) array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$aFullNames = json_decode($sNames);
|
$aFullNames = json_decode($sNames, true);
|
||||||
$aNames = array();
|
$aNames = array();
|
||||||
|
|
||||||
foreach ($aFullNames as $sKey => $sValue) {
|
foreach ($aFullNames as $sKey => $sValue) {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if (empty($aPlace)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPlace['asgeojson'])) {
|
if (isset($aPlace['asgeojson'])) {
|
||||||
$aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson']);
|
$aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson'], true);
|
||||||
} else {
|
} else {
|
||||||
$aFilteredPlaces['geometry'] = array(
|
$aFilteredPlaces['geometry'] = array(
|
||||||
'type' => 'Point',
|
'type' => 'Point',
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ if (empty($aPlace)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPlace['asgeojson'])) {
|
if (isset($aPlace['asgeojson'])) {
|
||||||
$aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson']);
|
$aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson'], true);
|
||||||
} else {
|
} else {
|
||||||
$aFilteredPlaces['geometry'] = array(
|
$aFilteredPlaces['geometry'] = array(
|
||||||
'type' => 'Point',
|
'type' => 'Point',
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ if (empty($aPlace)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPlace['asgeojson'])) {
|
if (isset($aPlace['asgeojson'])) {
|
||||||
$aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
|
$aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPlace['assvg'])) {
|
if (isset($aPlace['assvg'])) {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ $aPlaceDetails['centroid'] = array(
|
|||||||
'coordinates' => array( (float) $aPointDetails['lon'], (float) $aPointDetails['lat'] )
|
'coordinates' => array( (float) $aPointDetails['lon'], (float) $aPointDetails['lat'] )
|
||||||
);
|
);
|
||||||
|
|
||||||
$aPlaceDetails['geometry'] = json_decode($aPointDetails['asgeojson']);
|
$aPlaceDetails['geometry'] = json_decode($aPointDetails['asgeojson'], true);
|
||||||
|
|
||||||
$funcMapAddressLine = function ($aFull) {
|
$funcMapAddressLine = function ($aFull) {
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ foreach ($aBatchResults as $aSearchResults) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPointDetails['asgeojson'])) {
|
if (isset($aPointDetails['asgeojson'])) {
|
||||||
$aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
|
$aPlace['geojson'] = json_decode($aPointDetails['asgeojson'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPointDetails['assvg'])) {
|
if (isset($aPointDetails['assvg'])) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPointDetails['asgeojson'])) {
|
if (isset($aPointDetails['asgeojson'])) {
|
||||||
$aPlace['geometry'] = json_decode($aPointDetails['asgeojson']);
|
$aPlace['geometry'] = json_decode($aPointDetails['asgeojson'], true);
|
||||||
} else {
|
} else {
|
||||||
$aPlace['geometry'] = array(
|
$aPlace['geometry'] = array(
|
||||||
'type' => 'Point',
|
'type' => 'Point',
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPointDetails['asgeojson'])) {
|
if (isset($aPointDetails['asgeojson'])) {
|
||||||
$aPlace['geometry'] = json_decode($aPointDetails['asgeojson']);
|
$aPlace['geometry'] = json_decode($aPointDetails['asgeojson'], true);
|
||||||
} else {
|
} else {
|
||||||
$aPlace['geometry'] = array(
|
$aPlace['geometry'] = array(
|
||||||
'type' => 'Point',
|
'type' => 'Point',
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPointDetails['asgeojson'])) {
|
if (isset($aPointDetails['asgeojson'])) {
|
||||||
$aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
|
$aPlace['geojson'] = json_decode($aPointDetails['asgeojson'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aPointDetails['assvg'])) {
|
if (isset($aPointDetails['assvg'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user