2016-06-12 13:39:09 +03:00
|
|
|
<?php
|
2022-01-03 18:23:58 +03:00
|
|
|
/**
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
*
|
|
|
|
* This file is part of Nominatim. (https://nominatim.org)
|
|
|
|
*
|
|
|
|
* Copyright (C) 2022 by the Nominatim developer community.
|
|
|
|
* For a full list of authors see the git log.
|
|
|
|
*/
|
2016-06-12 13:39:09 +03:00
|
|
|
|
2016-09-14 04:16:46 +03:00
|
|
|
|
2016-09-11 06:22:51 +03:00
|
|
|
function formatOSMType($sType, $bIncludeExternal = true)
|
2016-09-04 04:19:48 +03:00
|
|
|
{
|
2021-07-10 15:59:38 +03:00
|
|
|
if ($sType == 'N') {
|
|
|
|
return 'node';
|
|
|
|
}
|
|
|
|
if ($sType == 'W') {
|
|
|
|
return 'way';
|
|
|
|
}
|
|
|
|
if ($sType == 'R') {
|
|
|
|
return 'relation';
|
|
|
|
}
|
2016-09-04 04:19:48 +03:00
|
|
|
|
2021-07-10 15:59:38 +03:00
|
|
|
if (!$bIncludeExternal) {
|
|
|
|
return '';
|
|
|
|
}
|
2016-09-04 04:19:48 +03:00
|
|
|
|
2021-07-10 15:59:38 +03:00
|
|
|
if ($sType == 'T') {
|
|
|
|
return 'way';
|
|
|
|
}
|
|
|
|
if ($sType == 'I') {
|
|
|
|
return 'way';
|
|
|
|
}
|
2016-09-04 04:19:48 +03:00
|
|
|
|
2020-02-09 18:50:04 +03:00
|
|
|
// not handled: P, L
|
|
|
|
|
2016-09-04 04:19:48 +03:00
|
|
|
return '';
|
|
|
|
}
|