- 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'];
- } elseif (isset($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']);
+ $aAddressLine['label'] = Nominatim\ClassTypes\getProperty($aAddressLine, 'label');
+ if (!$aAddressLine['label']) {
+ $aAddressLine['label'] = ucwords($aAddressLine['type']);
+ }