$this->oPlaceLookup->setIncludeAddressDetails(false);
$this->oPlaceLookup->setIncludePolygonAsPoints($oParams->getBool('polygon'));
- if ($oParams->getString('format', '') == 'geocodejson') {
- $this->oPlaceLookup->setAddressDetails(true);
+ if ($this->bIncludeAddressDetails
+ && $oParams->getString('format', '') == 'geocodejson'
+ ) {
$this->oPlaceLookup->setAddressAdminLevels(true);
}
+
}
public function setQueryFromParams($oParams)
$this->bIncludePolygonAsPoints = $b;
}
- public function setAddressDetails($b = true)
- {
- $this->bAddressDetails = $b;
- }
-
public function setAddressAdminLevels($b = true)
{
$this->bAddressAdminLevels = $b;
);
foreach ($aFieldMappings as $sFrom => $sTo) {
- if (isset($aPointDetails['aAddress'][$sFrom])) {
- $aPlace['properties']['geocoding'][$sTo] = $aPointDetails['aAddress'][$sFrom];
+ if (isset($aPointDetails['address'][$sFrom])) {
+ $aPlace['properties']['geocoding'][$sTo] = $aPointDetails['address'][$sFrom];
}
}
$oPlaceLookup = new Nominatim\PlaceLookup($oDB);
$oPlaceLookup->loadParamArray($oParams);
if ($sOutputFormat == 'geocodejson') {
- $oPlaceLookup->setAddressDetails(true);
+ $oPlaceLookup->setIncludeAddressDetails(true);
$oPlaceLookup->setAddressAdminLevels(true);
}