X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/133dd2e974b861e790031c8eadbcd44fcf2cfc97..cf4a44aaf7f8dd9ac7396deb0fe597980e22df96:/website/hierarchy.php?place_id=%27.%24aAddressLine%5B%27place_id%27%5D.%27 diff --git a/website/hierarchy.php b/website/hierarchy.php index d99040a2..6a281aa8 100755 --- a/website/hierarchy.php +++ b/website/hierarchy.php @@ -1,7 +1,8 @@ getOne('select parent_place_id from location_property_tiger where place_id = '.$iPlaceID); - if ($iParentPlaceID) + if (CONST_Use_US_Tiger_Data) { - $iPlaceID = $iParentPlaceID; + $iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_tiger where place_id = '.$iPlaceID); + if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; } - else + + if (CONST_Use_Aux_Location_data) { $iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_aux where place_id = '.$iPlaceID); if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; @@ -78,7 +79,7 @@ $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']; + $sOSMUrl = 'http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aPlace['osm_id']; if ($sOutputFormat == 'html') if ($i) echo " > "; if ($sOutputFormat == 'html') echo ''.$aPlace['localname'].' (osm)'; } @@ -102,52 +103,52 @@ $sSQL .= " order by rank_address asc,rank_search asc,localname,class, type,housenumber"; $aParentOfLines = $oDB->getAll($sSQL); - if (sizeof($aParentOfLines)) - { - echo '

Parent Of:

'; + if (sizeof($aParentOfLines)) + { + echo '

Parent Of:

'; $aClassType = getClassTypesWithImportance(); - $aGroupedAddressLines = array(); - foreach($aParentOfLines as $aAddressLine) - { + $aGroupedAddressLines = array(); + foreach($aParentOfLines as $aAddressLine) + { if (isset($aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label']) - && $aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label']) - { - $aAddressLine['label'] = $aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label']; - } + && $aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label']) + { + $aAddressLine['label'] = $aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label']; + } elseif (isset($aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label']) - && $aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label']) - { - $aAddressLine['label'] = $aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label']; - } + && $aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label']) + { + $aAddressLine['label'] = $aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label']; + } else $aAddressLine['label'] = ucwords($aAddressLine['type']); - if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array(); - $aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine; - } - foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines) - { - echo "

$sGroupHeading

"; - foreach($aParentOfLines as $aAddressLine) - { - $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber']; - $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':''))); - - echo '
'; - echo ''.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name').''; - echo ' ('; - echo ''.($aAddressLine['isarea']=='t'?'Polygon':'Point').''; - if ($sOSMType) echo ', '.$sOSMType.' '.$aAddressLine['osm_id'].''; - echo ', GOTO'; - echo ', '.$aAddressLine['area']; - echo ')'; - echo '
'; - } - } - if (sizeof($aParentOfLines) >= 500) { - echo '

There are more child objects which are not shown.

'; - } - echo ''; - } + if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array(); + $aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine; + } + foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines) + { + echo "

$sGroupHeading

"; + foreach($aParentOfLines as $aAddressLine) + { + $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber']; + $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':''))); + + echo '
'; + echo ''.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name').''; + echo ' ('; + echo ''.($aAddressLine['isarea']=='t'?'Polygon':'Point').''; + if ($sOSMType) echo ', '.$sOSMType.' '.$aAddressLine['osm_id'].''; + echo ', GOTO'; + echo ', '.$aAddressLine['area']; + echo ')'; + echo '
'; + } + } + if (sizeof($aParentOfLines) >= 500) { + echo '

There are more child objects which are not shown.

'; + } + echo ''; + } exit;