]> git.openstreetmap.org Git - nominatim.git/blob - website/deletable.php
download dbpedia attempt at geocoords
[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 list of deleted OSM elements.", $sSQL, $aPolygons);
15         }
16
17 //var_dump($aPolygons);
18 ?>
19 <!DOCTYPE html>
20 <html>
21 <head>
22     <meta charset="utf-8"/>
23     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
24     
25     <title>Nominatim Deleted Data</title>
26     
27     <meta name="description" content="List of OSM data that has been deleted" lang="en-US" />
28
29 </head>
30
31 <body>
32 <style type="text/css">
33 table {
34         border-width: 1px;
35         border-spacing: 0px;
36         border-style: solid;
37         border-color: gray;
38         border-collapse: collapse;
39         background-color: white;
40         margin: 10px;
41 }
42 table th {
43         border-width: 1px;
44         padding: 2px;
45         border-style: inset;
46         border-color: gray;
47         border-left-color: #ddd;
48         border-right-color: #ddd;
49         background-color: #eee;
50         -moz-border-radius: 0px 0px 0px 0px;
51 }
52 table td {
53         border-width: 1px;
54         padding: 2px;
55         border-style: inset;
56         border-color: gray;
57         border-left-color: #ddd;
58         border-right-color: #ddd;
59         background-color: white;
60         -moz-border-radius: 0px 0px 0px 0px;
61 }
62 </style>
63
64 <p>Objects in this table have been deleted in OSM but are still in the Nominatim database.</p>
65
66 <table>
67 <?php
68         echo "<tr>";
69 //var_dump($aPolygons[0]);
70         foreach($aPolygons[0] as $sCol => $sVal)
71         {
72                 echo "<th>".$sCol."</th>";
73         }
74         echo "</tr>";
75         foreach($aPolygons as $aRow)
76         {
77                 echo "<tr>";
78                 foreach($aRow as $sCol => $sVal)
79                 {
80                         switch($sCol)
81                         {
82             case 'osm_id':
83                 $sOSMType = ($aRow['osm_type'] == 'N'?'node':($aRow['osm_type'] == 'W'?'way':($aRow['osm_type'] == 'R'?'relation':'')));
84                 echo '<td><a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$sVal.'" target="_new">'.$sVal.'</a></td>';
85                                 break;
86                         case 'place_id':
87                                 echo '<td><a href="'.CONST_Website_BaseURL.'details?place_id='.$sVal.'">'.$sVal.'</a></td>';
88                                 break;
89                         default:
90                                 echo "<td>".($sVal?$sVal:'&nbsp;')."</td>";
91                                 break;
92                         }
93                 }
94                 echo "</tr>";
95         }
96 ?>
97 </table>
98
99
100
101 </body>
102 </html>