From: Sarah Hoffmann Date: Sat, 27 Feb 2016 08:56:36 +0000 (+0100) Subject: Merge pull request #378 from mtmail/spaces-to-tabs X-Git-Tag: v3.0.0~206 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/07628dc05daf0345fab3307601f05186ba863456?hp=8b75e1f4c460b422688c20d530ea91376e035199 Merge pull request #378 from mtmail/spaces-to-tabs spaces-to-tabs for all *.php files --- diff --git a/lib/Geocode.php b/lib/Geocode.php index 80561d27..ba1842c3 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -478,15 +478,15 @@ function getGroupedSearches($aSearches, $aPhraseTypes, $aPhrases, $aValidTokens, $aWordFrequencyScores, $bStructuredPhrases) { /* - Calculate all searches using aValidTokens i.e. - 'Wodsworth Road, Sheffield' => + Calculate all searches using aValidTokens i.e. + 'Wodsworth Road, Sheffield' => - Phrase Wordset - 0 0 (wodsworth road) - 0 1 (wodsworth)(road) - 1 0 (sheffield) + Phrase Wordset + 0 0 (wodsworth road) + 0 1 (wodsworth)(road) + 1 0 (sheffield) - Score how good the search is so they can be ordered + Score how good the search is so they can be ordered */ foreach($aPhrases as $iPhrase => $sPhrase) { @@ -755,32 +755,32 @@ /* Perform the actual query lookup. Returns an ordered list of results, each with the following fields: - osm_type: type of corresponding OSM object + osm_type: type of corresponding OSM object N - node W - way R - relation P - postcode (internally computed) - osm_id: id of corresponding OSM object - class: general object class (corresponds to tag key of primary OSM tag) - type: subclass of object (corresponds to tag value of primary OSM tag) - admin_level: see http://wiki.openstreetmap.org/wiki/Admin_level - rank_search: rank in search hierarchy + osm_id: id of corresponding OSM object + class: general object class (corresponds to tag key of primary OSM tag) + type: subclass of object (corresponds to tag value of primary OSM tag) + admin_level: see http://wiki.openstreetmap.org/wiki/Admin_level + rank_search: rank in search hierarchy (see also http://wiki.openstreetmap.org/wiki/Nominatim/Development_overview#Country_to_street_level) - rank_address: rank in address hierarchy (determines orer in address) - place_id: internal key (may differ between different instances) - country_code: ISO country code - langaddress: localized full address - placename: localized name of object - ref: content of ref tag (if available) - lon: longitude - lat: latitude - importance: importance of place based on Wikipedia link count - addressimportance: cumulated importance of address elements - extra_place: type of place (for admin boundaries, if there is a place tag) - aBoundingBox: bounding Box - label: short description of the object class/type (English only) - name: full name (currently the same as langaddress) - foundorder: secondary ordering for places with same importance + rank_address: rank in address hierarchy (determines orer in address) + place_id: internal key (may differ between different instances) + country_code: ISO country code + langaddress: localized full address + placename: localized name of object + ref: content of ref tag (if available) + lon: longitude + lat: latitude + importance: importance of place based on Wikipedia link count + addressimportance: cumulated importance of address elements + extra_place: type of place (for admin boundaries, if there is a place tag) + aBoundingBox: bounding Box + label: short description of the object class/type (English only) + name: full name (currently the same as langaddress) + foundorder: secondary ordering for places with same importance */ function lookup() { @@ -863,8 +863,8 @@ // Start with a blank search $aSearches = array( array('iSearchRank' => 0, 'iNamePhrase' => -1, 'sCountryCode' => false, 'aName'=>array(), 'aAddress'=>array(), 'aFullNameAddress'=>array(), - 'aNameNonSearch'=>array(), 'aAddressNonSearch'=>array(), - 'sOperator'=>'', 'aFeatureName' => array(), 'sClass'=>'', 'sType'=>'', 'sHouseNumber'=>'', 'fLat'=>'', 'fLon'=>'', 'fRadius'=>'') + 'aNameNonSearch'=>array(), 'aAddressNonSearch'=>array(), + 'sOperator'=>'', 'aFeatureName' => array(), 'sClass'=>'', 'sType'=>'', 'sHouseNumber'=>'', 'fLat'=>'', 'fLon'=>'', 'fRadius'=>'') ); // Do we have a radius search? @@ -1194,8 +1194,8 @@ { $sSQL = "select place_id from placex where calculated_country_code='".$aSearch['sCountryCode']."' and rank_search = 4"; if ($sCountryCodesSQL) $sSQL .= " and calculated_country_code in ($sCountryCodesSQL)"; - if ($bBoundingBoxSearch) - $sSQL .= " and _st_intersects($this->sViewboxSmallSQL, geometry)"; + if ($bBoundingBoxSearch) + $sSQL .= " and _st_intersects($this->sViewboxSmallSQL, geometry)"; $sSQL .= " order by st_area(geometry) desc limit 1"; if (CONST_Debug) var_dump($sSQL); $aPlaceIDs = $this->oDB->getCol($sSQL); @@ -1615,7 +1615,7 @@ if (!preg_match('/\pL/', $sWord)) unset($aRecheckWords[$i]); } - if (CONST_Debug) { echo 'Recheck words:<\i>'; var_dump($aRecheckWords); } + if (CONST_Debug) { echo 'Recheck words:<\i>'; var_dump($aRecheckWords); } foreach($aSearchResults as $iResNum => $aResult) { diff --git a/lib/init-website.php b/lib/init-website.php index 6db83988..a34e4c82 100644 --- a/lib/init-website.php +++ b/lib/init-website.php @@ -13,7 +13,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') exit; if (CONST_ClosedForIndexing && strpos(CONST_ClosedForIndexingExceptionIPs, ','.$_SERVER["REMOTE_ADDR"].',') === false) - { + { echo "Closed for re-indexing..."; exit; } diff --git a/lib/leakybucket.php b/lib/leakybucket.php index 6d4e8f29..47e84477 100644 --- a/lib/leakybucket.php +++ b/lib/leakybucket.php @@ -7,39 +7,39 @@ if (!CONST_ConnectionBucket_MemcacheServerAddress) return null; if (!isset($m)) { - $m = new Memcached(); - $m->addServer(CONST_ConnectionBucket_MemcacheServerAddress, CONST_ConnectionBucket_MemcacheServerPort); + $m = new Memcached(); + $m->addServer(CONST_ConnectionBucket_MemcacheServerAddress, CONST_ConnectionBucket_MemcacheServerPort); } return $m; } function doBucket($asKey, $iRequestCost, $iLeakPerSecond, $iThreshold) { - $m = getBucketMemcache(); + $m = getBucketMemcache(); if (!$m) return 0; $iMaxVal = 0; - $t = time(); + $t = time(); foreach($asKey as $sKey) { - $aCurrentBlock = $m->get($sKey); - if (!$aCurrentBlock) + $aCurrentBlock = $m->get($sKey); + if (!$aCurrentBlock) { - $aCurrentBlock = array($iRequestCost, $t, false); - } + $aCurrentBlock = array($iRequestCost, $t, false); + } else { // add RequestCost // remove leak * the time since the last request - $aCurrentBlock[0] += $iRequestCost - ($t - $aCurrentBlock[1])*$iLeakPerSecond; - $aCurrentBlock[1] = $t; + $aCurrentBlock[0] += $iRequestCost - ($t - $aCurrentBlock[1])*$iLeakPerSecond; + $aCurrentBlock[1] = $t; } - if ($aCurrentBlock[0] <= 0) + if ($aCurrentBlock[0] <= 0) { - $m->delete($sKey); - } + $m->delete($sKey); + } else { // If we have hit the threshold stop and record this to the block list @@ -77,7 +77,7 @@ } } // Only keep in memcache until the time it would have expired (to avoid clutering memcache) - $m->set($sKey, $aCurrentBlock, $t + 1 + $aCurrentBlock[0]/$iLeakPerSecond); + $m->set($sKey, $aCurrentBlock, $t + 1 + $aCurrentBlock[0]/$iLeakPerSecond); } // Bucket result in the largest bucket we find @@ -85,16 +85,16 @@ } return $iMaxVal; - } + } function isBucketSleeping($asKey) { - $m = getBucketMemcache(); + $m = getBucketMemcache(); if (!$m) return false; foreach($asKey as $sKey) { - $aCurrentBlock = $m->get($sKey); + $aCurrentBlock = $m->get($sKey); if ($aCurrentBlock[2]) return true; } return false; @@ -102,15 +102,15 @@ function setBucketSleeping($asKey, $bVal) { - $m = getBucketMemcache(); + $m = getBucketMemcache(); if (!$m) return false; $iMaxVal = 0; - $t = time(); + $t = time(); foreach($asKey as $sKey) { - $aCurrentBlock = $m->get($sKey); + $aCurrentBlock = $m->get($sKey); $aCurrentBlock[2] = $bVal; $m->set($sKey, $aCurrentBlock, $t + 1 + $aCurrentBlock[0]/CONST_ConnectionBucket_LeakRate); } @@ -137,9 +137,9 @@ function getBucketBlocks() { - $m = getBucketMemcache(); + $m = getBucketMemcache(); if (!$m) return null; - $t = time(); + $t = time(); $aBlockedList = $m->get('blockedList', null, $hCasToken); if (!$aBlockedList) $aBlockedList = array(); foreach($aBlockedList as $sKey => $aDetails) @@ -161,7 +161,7 @@ function clearBucketBlocks() { - $m = getBucketMemcache(); + $m = getBucketMemcache(); if (!$m) return false; $m->delete('blockedList'); return true; diff --git a/lib/lib.php b/lib/lib.php index 50cf3dc4..2134e1a4 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -101,7 +101,7 @@ function bySearchRank($a, $b) { if ($a['iSearchRank'] == $b['iSearchRank']) - return strlen($a['sOperator']) + strlen($a['sHouseNumber']) - strlen($b['sOperator']) - strlen($b['sHouseNumber']); + return strlen($a['sOperator']) + strlen($a['sHouseNumber']) - strlen($b['sOperator']) - strlen($b['sHouseNumber']); return ($a['iSearchRank'] < $b['iSearchRank']?-1:1); } diff --git a/lib/template/address-html.php b/lib/template/address-html.php index f8d425e2..b943c530 100644 --- a/lib/template/address-html.php +++ b/lib/template/address-html.php @@ -1,106 +1,106 @@ - - + + - - - - - -
+ + + + + +
- '; - ?> -
+ '; + ?> +
- + -
-
-
-
+
+
+
+
- + @@ -108,22 +108,22 @@ - - + echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';'; + ?> + + diff --git a/lib/template/address-json.php b/lib/template/address-json.php index ff245e14..d1edaf0d 100644 --- a/lib/template/address-json.php +++ b/lib/template/address-json.php @@ -13,13 +13,13 @@ if (isset($aPlace['place_id'])) $aFilteredPlaces['place_id'] = $aPlace['place_id']; $aFilteredPlaces['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright"; $sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':''))); - if ($sOSMType) - { - $aFilteredPlaces['osm_type'] = $sOSMType; - $aFilteredPlaces['osm_id'] = $aPlace['osm_id']; - } - if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat']; - if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon']; + if ($sOSMType) + { + $aFilteredPlaces['osm_type'] = $sOSMType; + $aFilteredPlaces['osm_id'] = $aPlace['osm_id']; + } + if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat']; + if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon']; $aFilteredPlaces['display_name'] = $aPlace['langaddress']; if (isset($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress']; if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags']; diff --git a/lib/template/address-jsonv2.php b/lib/template/address-jsonv2.php index a8a05dd4..40c5c56d 100644 --- a/lib/template/address-jsonv2.php +++ b/lib/template/address-jsonv2.php @@ -13,11 +13,11 @@ if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id']; $aFilteredPlaces['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright"; $sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':''))); - if ($sOSMType) - { - $aFilteredPlaces['osm_type'] = $sOSMType; - $aFilteredPlaces['osm_id'] = $aPlace['osm_id']; - } + if ($sOSMType) + { + $aFilteredPlaces['osm_type'] = $sOSMType; + $aFilteredPlaces['osm_id'] = $aPlace['osm_id']; + } if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat']; if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon']; diff --git a/lib/template/details-html.php b/lib/template/details-html.php index 6845cbb2..463eb4aa 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -264,21 +264,21 @@ diff --git a/lib/template/includes/html-footer.php b/lib/template/includes/html-footer.php index 3083c11b..3d73b1e4 100644 --- a/lib/template/includes/html-footer.php +++ b/lib/template/includes/html-footer.php @@ -1,10 +1,10 @@
-

- Addresses and postcodes are approximate -

- +

+ Addresses and postcodes are approximate +

+
diff --git a/lib/template/includes/html-top-navigation.php b/lib/template/includes/html-top-navigation.php index e0b367b4..61bec19a 100644 --- a/lib/template/includes/html-top-navigation.php +++ b/lib/template/includes/html-top-navigation.php @@ -1,49 +1,49 @@ -
-
- -
- - Data last updated: -
- - -
-
-
- - -
-
-
-
+
+
+ +
+ + Data last updated: +
+ + +
+
+
+ + +
+
+
+
- + diff --git a/lib/template/search-batch-json.php b/lib/template/search-batch-json.php index ef2c143a..edfe3871 100644 --- a/lib/template/search-batch-json.php +++ b/lib/template/search-batch-json.php @@ -11,8 +11,8 @@ foreach($aSearchResults as $iResNum => $aPointDetails) { $aPlace = array( - 'place_id'=>$aPointDetails['place_id'], - ); + 'place_id'=>$aPointDetails['place_id'], + ); $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':''))); if ($sOSMType) @@ -21,8 +21,8 @@ $aPlace['osm_id'] = $aPointDetails['osm_id']; } - if (isset($aPointDetails['aBoundingBox'])) - { + if (isset($aPointDetails['aBoundingBox'])) + { $aPlace['boundingbox'] = array( $aPointDetails['aBoundingBox'][0], $aPointDetails['aBoundingBox'][1], @@ -33,7 +33,7 @@ { $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints']; } - } + } if (isset($aPointDetails['zoom'])) { @@ -58,27 +58,27 @@ if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) { $aPlace['address'] = $aPointDetails['address']; - } + } - if (isset($aPointDetails['asgeojson'])) - { + if (isset($aPointDetails['asgeojson'])) + { $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']); - } + } - if (isset($aPointDetails['assvg'])) - { + if (isset($aPointDetails['assvg'])) + { $aPlace['svg'] = $aPointDetails['assvg']; - } + } - if (isset($aPointDetails['astext'])) - { - $aPlace['geotext'] = $aPointDetails['astext']; - } + if (isset($aPointDetails['astext'])) + { + $aPlace['geotext'] = $aPointDetails['astext']; + } - if (isset($aPointDetails['askml'])) - { - $aPlace['geokml'] = $aPointDetails['askml']; - } + if (isset($aPointDetails['askml'])) + { + $aPlace['geokml'] = $aPointDetails['askml']; + } $aFilteredPlaces[] = $aPlace; } diff --git a/lib/template/search-json.php b/lib/template/search-json.php index 3dcaabdb..5f29fdfb 100644 --- a/lib/template/search-json.php +++ b/lib/template/search-json.php @@ -16,8 +16,8 @@ $aPlace['osm_id'] = $aPointDetails['osm_id']; } - if (isset($aPointDetails['aBoundingBox'])) - { + if (isset($aPointDetails['aBoundingBox'])) + { $aPlace['boundingbox'] = array( $aPointDetails['aBoundingBox'][0], $aPointDetails['aBoundingBox'][1], @@ -28,7 +28,7 @@ { $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints']; } - } + } if (isset($aPointDetails['zoom'])) { @@ -52,22 +52,22 @@ if (isset($aPointDetails['address'])) { $aPlace['address'] = $aPointDetails['address']; - } - - if (isset($aPointDetails['asgeojson'])) - { - $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']); - } - - if (isset($aPointDetails['assvg'])) - { - $aPlace['svg'] = $aPointDetails['assvg']; - } - - if (isset($aPointDetails['astext'])) - { - $aPlace['geotext'] = $aPointDetails['astext']; - } + } + + if (isset($aPointDetails['asgeojson'])) + { + $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']); + } + + if (isset($aPointDetails['assvg'])) + { + $aPlace['svg'] = $aPointDetails['assvg']; + } + + if (isset($aPointDetails['astext'])) + { + $aPlace['geotext'] = $aPointDetails['astext']; + } if (isset($aPointDetails['askml'])) { diff --git a/lib/template/search-jsonv2.php b/lib/template/search-jsonv2.php index e9747720..66098d30 100644 --- a/lib/template/search-jsonv2.php +++ b/lib/template/search-jsonv2.php @@ -14,8 +14,8 @@ $aPlace['osm_id'] = $aPointDetails['osm_id']; } - if (isset($aPointDetails['aBoundingBox'])) - { + if (isset($aPointDetails['aBoundingBox'])) + { $aPlace['boundingbox'] = array( $aPointDetails['aBoundingBox'][0], $aPointDetails['aBoundingBox'][1], @@ -26,7 +26,7 @@ { $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints']; } - } + } if (isset($aPointDetails['zoom'])) { @@ -51,27 +51,27 @@ if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) { $aPlace['address'] = $aPointDetails['address']; - } + } - if (isset($aPointDetails['asgeojson'])) - { + if (isset($aPointDetails['asgeojson'])) + { $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']); - } + } - if (isset($aPointDetails['assvg'])) - { + if (isset($aPointDetails['assvg'])) + { $aPlace['svg'] = $aPointDetails['assvg']; - } + } - if (isset($aPointDetails['astext'])) - { - $aPlace['geotext'] = $aPointDetails['astext']; - } + if (isset($aPointDetails['astext'])) + { + $aPlace['geotext'] = $aPointDetails['astext']; + } - if (isset($aPointDetails['askml'])) - { - $aPlace['geokml'] = $aPointDetails['askml']; - } + if (isset($aPointDetails['askml'])) + { + $aPlace['geokml'] = $aPointDetails['askml']; + } if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags']; if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails']; diff --git a/settings/phrase_settings.php b/settings/phrase_settings.php index 4456316e..2e199ada 100644 --- a/settings/phrase_settings.php +++ b/settings/phrase_settings.php @@ -38,14 +38,14 @@ $aLanguageIn = array( # class/type combinations to exclude $aTagsBlacklist = array( - 'boundary' => array('administrative'), - 'place' => array('house', 'houses'), + 'boundary' => array('administrative'), + 'place' => array('house', 'houses'), ); # If a class is in the white list then all types will # be ignored except the ones given in the list. # Also use this list to exclude an entire class from # special phrases. $aTagsWhitelist = array( - 'highway' => array('bus_stop', 'rest_area', 'raceway'), - 'building' => array(), + 'highway' => array('bus_stop', 'rest_area', 'raceway'), + 'building' => array(), ); diff --git a/website/deletable.php b/website/deletable.php index 4e2e623c..5d6ee15d 100755 --- a/website/deletable.php +++ b/website/deletable.php @@ -1,6 +1,6 @@ - - - - Nominatim Deleted Data - - + + + + Nominatim Deleted Data + + @@ -79,16 +79,16 @@ table td { { switch($sCol) { - case 'osm_id': - $sOSMType = ($aRow['osm_type'] == 'N'?'node':($aRow['osm_type'] == 'W'?'way':($aRow['osm_type'] == 'R'?'relation':''))); - echo ''.$sVal.''; - break; - case 'place_id': - echo ''.$sVal.''; - break; - default: - echo "".($sVal?$sVal:' ').""; - break; + case 'osm_id': + $sOSMType = ($aRow['osm_type'] == 'N'?'node':($aRow['osm_type'] == 'W'?'way':($aRow['osm_type'] == 'R'?'relation':''))); + echo ''.$sVal.''; + break; + case 'place_id': + echo ''.$sVal.''; + break; + default: + echo "".($sVal?$sVal:' ').""; + break; } } echo ""; diff --git a/website/hierarchy.php b/website/hierarchy.php index d99040a2..de83ca44 100755 --- a/website/hierarchy.php +++ b/website/hierarchy.php @@ -78,7 +78,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 +102,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; diff --git a/website/polygons.php b/website/polygons.php index 5a5be9f0..423374c7 100755 --- a/website/polygons.php +++ b/website/polygons.php @@ -39,12 +39,12 @@ - - - - Nominatim Broken Polygon Data - - + + + + Nominatim Broken Polygon Data + +