]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/polygons.php
polygons.php: print total number of broken polygons
[nominatim.git] / website / polygons.php
index 3e2e878cfb8ff869941b16f362bc7d77b277806e..b9ce249d91ab161b6c835f09e3a18ff768ab835f 100755 (executable)
@@ -1,6 +1,7 @@
 <?php
-        require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
-        require_once(CONST_BasePath.'/lib/log.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-website.php');
+       require_once(CONST_BasePath.'/lib/log.php');
 
        $sOutputFormat = 'html';
        ini_set('memory_limit', '200M');
        $sClass = false;
        if (isset($_GET['class'])) $sClass = $_GET['class'];
 
+       $iTotalBroken = (int) $oDB->getOne('select count(*) from import_polygon_error');
+
        $aPolygons = array();
-       while(!sizeof($aPolygons))
+       while($iTotalBroken && !sizeof($aPolygons))
        {
                $sSQL = 'select osm_type as "type",osm_id as "id",class as "key",type as "value",name->\'name\' as "name",';
                $sSQL .= 'country_code as "country",errormessage as "error message",updated';
 <!DOCTYPE html>
 <html>
 <head>
-    <meta charset="utf-8"/>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
-    
-    <title>Nominatim Broken Polygon Data</title>
-    
-    <meta name="description" content="List of broken OSM polygon data by date" lang="en-US" />
+       <meta charset="utf-8"/>
+       <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+       
+       <title>Nominatim Broken Polygon Data</title>
+       
+       <meta name="description" content="List of broken OSM polygon data by date" lang="en-US" />
 
 </head>
 
@@ -83,6 +86,7 @@ table td {
 
 <?php
 
+       echo "<p>Total number of broken polygons: $iTotalBroken</p>";
        echo "<table>";
        echo "<tr>";
 //var_dump($aPolygons[0]);