From: Brian Quinion Date: Thu, 7 Feb 2013 18:39:33 +0000 (+0000) Subject: more debug in reverse geocoding X-Git-Tag: v2.2.0~123 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/7a4d550c7aa7d89fd3c27e18dad7470945576a73 more debug in reverse geocoding --- diff --git a/website/reverse.php b/website/reverse.php index 5eec5c74..ab68a849 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -38,7 +38,8 @@ if (isset($_GET['osm_type']) && isset($_GET['osm_id']) && (int)$_GET['osm_id'] && ($_GET['osm_type'] == 'N' || $_GET['osm_type'] == 'W' || $_GET['osm_type'] == 'R')) { - $iPlaceID = $oDB->getOne("select place_id from placex where osm_type = '".$_GET['osm_type']."' and osm_id = ".(int)$_GET['osm_id']." order by type = 'postcode' asc"); + $iPlaceID = $oDB->getOne($sSQL = ("select place_id from placex where osm_type = '".$_GET['osm_type']."' and osm_id = ".(int)$_GET['osm_id']." order by type = 'postcode' asc")); + if (CONST_Debug) var_dump($sSQL); if (!$iPlaceID) $sError = 'OSM ID Not Found'; } else @@ -101,7 +102,7 @@ $sSQL .= ' and (ST_GeometryType(geometry) not in (\'ST_Polygon\',\'ST_MultiPolygon\') '; $sSQL .= ' OR ST_DWithin('.$sPointSQL.', centroid, '.$fSearchDiam.'))'; $sSQL .= ' ORDER BY ST_distance('.$sPointSQL.', geometry) ASC limit 1'; -//var_dump($sSQL); + if (CONST_Debug) var_dump($sSQL); $aPlace = $oDB->getRow($sSQL); if (PEAR::IsError($aPlace)) { @@ -163,4 +164,7 @@ $aPlace['addresstype'] = $sAddressType; } + + if (CONST_Debug) exit; + include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php');