]> git.openstreetmap.org Git - nominatim.git/blob - website/deletable.php
add web view for import_polygon_delete
[nominatim.git] / website / deletable.php
1 <?php
2         require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
3         require_once(CONST_BasePath.'/lib/log.php');
4
5         $sOutputFormat = 'html';
6         ini_set('memory_limit', '200M');
7
8         $oDB =& getDB();
9
10         $sSQL = "select placex.place_id, calculated_country_code as country_code, name->'name' as name, i.* from placex, import_polygon_delete i where placex.osm_id = i.osm_id and placex.osm_type = i.osm_type and placex.class = i.class and placex.type = i.type";
11         $aPolygons = $oDB->getAll($sSQL);
12     if (PEAR::isError($aPolygons))
13     {
14          failInternalError("Could not get small viewbox.", $sSQL, $aPolygons);
15     }
16
17
18 //var_dump($aPolygons);
19 ?>
20 <!DOCTYPE html>
21 <html>
22 <head>
23     <meta charset="utf-8"/>
24     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
25     
26     <title>Nominatim Deleted Data</title>
27     
28     <meta name="description" content="List of OSM data that has been deleted" lang="en-US" />
29
30 </head>
31
32 <body>
33 <style type="text/css">
34 table {
35         border-width: 1px;
36         border-spacing: 0px;
37         border-style: solid;
38         border-color: gray;
39         border-collapse: collapse;
40         background-color: white;
41         margin: 10px;
42 }
43 table th {
44         border-width: 1px;
45         padding: 2px;
46         border-style: inset;
47         border-color: gray;
48         border-left-color: #ddd;
49         border-right-color: #ddd;
50         background-color: #eee;
51         -moz-border-radius: 0px 0px 0px 0px;
52 }
53 table td {
54         border-width: 1px;
55         padding: 2px;
56         border-style: inset;
57         border-color: gray;
58         border-left-color: #ddd;
59         border-right-color: #ddd;
60         background-color: white;
61         -moz-border-radius: 0px 0px 0px 0px;
62 }
63 </style>
64
65 <p>Objects in this table have been deleted in OSM but are still in the Nominatim database.</p>
66
67 <table>
68 <?php
69         echo "<tr>";
70 //var_dump($aPolygons[0]);
71         foreach($aPolygons[0] as $sCol => $sVal)
72         {
73                 echo "<th>".$sCol."</th>";
74         }
75         echo "</tr>";
76         foreach($aPolygons as $aRow)
77         {
78                 echo "<tr>";
79                 foreach($aRow as $sCol => $sVal)
80                 {
81                         switch($sCol)
82                         {
83             case 'osm_id':
84                 $sOSMType = ($aRow['osm_type'] == 'N'?'node':($aRow['osm_type'] == 'W'?'way':($aRow['osm_type'] == 'R'?'relation':'')));
85                 echo '<td><a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$sVal.'" target="_new">'.$sVal.'</a></td>';
86                                 break;
87                         case 'place_id':
88                                 echo '<td><a href="'.CONST_Website_BaseURL.'details?place_id='.$sVal.'">'.$sVal.'</a></td>';
89                                 break;
90                         default:
91                                 echo "<td>".($sVal?$sVal:'&nbsp;')."</td>";
92                                 break;
93                         }
94                 }
95                 echo "</tr>";
96         }
97 ?>
98 </table>
99
100
101
102 </body>
103 </html>