Exemple #1
0
$iPlaceID = (int) $_GET['place_id'];
$sAuxHouseNumber = false;
$iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_tiger where place_id = ' . $iPlaceID);
if ($iParentPlaceID) {
    $iPlaceID = $iParentPlaceID;
} else {
    $iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_aux where place_id = ' . $iPlaceID);
    if ($iParentPlaceID) {
        $iPlaceID = $iParentPlaceID;
    }
}
$oPlaceLookup = new PlaceLookup($oDB);
$oPlaceLookup->setLanguagePreference($aLangPrefOrder);
$oPlaceLookup->setIncludeAddressDetails(true);
$oPlaceLookup->setPlaceId($iPlaceID);
$aPlaceAddress = array_reverse($oPlaceLookup->getAddressDetails());
if (!sizeof($aPlaceAddress)) {
    echo "Unknown place id.";
    exit;
}
$aBreadcrums = array();
foreach ($aPlaceAddress as $i => $aPlace) {
    if (!$aPlace['place_id']) {
        continue;
    }
    $aBreadcrums[] = array('placeId' => $aPlace['place_id'], 'osmType' => $aPlace['osm_type'], 'osmId' => $aPlace['osm_id'], 'localName' => $aPlace['localname']);
    $sPlaceUrl = 'hierarchy.php?place_id=' . $aPlace['place_id'];
    $sOSMType = $aPlace['osm_type'] == 'N' ? 'node' : ($aPlace['osm_type'] == 'W' ? 'way' : ($aPlace['osm_type'] == 'R' ? 'relation' : ''));
    $sOSMUrl = 'http://www.openstreetmap.org/browse/' . $sOSMType . '/' . $aPlace['osm_id'];
    if ($sOutputFormat == 'html') {
        if ($i) {