X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f5dfd93c5cc0800b14548f07a1d25c7350a49fbe..a44f9c6aab386256983342f7411d1c5d5f3650a5:/website/details.php?ds=sidebyside diff --git a/website/details.php b/website/details.php index b7a38b2d..c92e3f77 100755 --- a/website/details.php +++ b/website/details.php @@ -18,6 +18,17 @@ if (isset($_GET['osmtype']) && isset($_GET['osmid']) && (int)$_GET['osmid'] && ($_GET['osmtype'] == 'N' || $_GET['osmtype'] == 'W' || $_GET['osmtype'] == 'R')) { $_GET['place_id'] = $oDB->getOne("select place_id from placex where osm_type = '".$_GET['osmtype']."' and osm_id = ".(int)$_GET['osmid']." order by type = 'postcode' asc"); + + // Be nice about our error messages for broken geometry + if (!$_GET['place_id']) + { + $sErrorMessage = $oDB->getOne("select ST_IsValidReason(geometry) from place where osm_type = '".$_GET['osmtype']."' and osm_id = ".(int)$_GET['osmid']." order by type = 'postcode' asc"); + if (!PEAR::isError($sErrorMessage) && $sErrorMessage) { + echo "Problem with geometry: "; + echo $sErrorMessage; + exit; + } + } } if (!isset($_GET['place_id']))