]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/details.php
Merge pull request #782 from lonvia/rework-postcodes
[nominatim.git] / website / details.php
index 7f0a951faa0e30f080fbff00aadffaa5e1ade0a0..4d7c1efb5df38375deedb802576c90cc794e3dca 100755 (executable)
@@ -73,6 +73,9 @@ if (CONST_Use_US_Tiger_Data) {
 $iParentPlaceID = chksql($oDB->getOne('SELECT parent_place_id FROM location_property_osmline WHERE place_id = '.$iPlaceID));
 if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
 
+// artificial postcodes
+$iParentPlaceID = chksql($oDB->getOne('SELECT parent_place_id FROM location_postcode WHERE place_id = '.$iPlaceID));
+if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
 
 if (CONST_Use_Aux_Location_data) {
     $iParentPlaceID = chksql($oDB->getOne('SELECT parent_place_id FROM location_property_aux WHERE place_id = '.$iPlaceID));
@@ -130,6 +133,13 @@ if (PEAR::isError($aPointDetails['aNames'])) { // possible timeout
     $aPointDetails['aNames'] = [];
 }
 
+// Address tags
+$sSQL = "SELECT (each(address)).key as key,(each(address)).value FROM placex WHERE place_id = $iPlaceID ORDER BY key";
+$aPointDetails['aAddressTags'] = $oDB->getAssoc($sSQL);
+if (PEAR::isError($aPointDetails['aAddressTags'])) { // possible timeout
+    $aPointDetails['aAddressTags'] = [];
+}
+
 // Extra tags
 $sSQL = "SELECT (each(extratags)).key,(each(extratags)).value FROM placex WHERE place_id = $iPlaceID ORDER BY (each(extratags)).key";
 $aPointDetails['aExtraTags'] = $oDB->getAssoc($sSQL);