]> git.openstreetmap.org Git - nominatim.git/blob - website/deletable.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / deletable.php
1 <?php
2
3 require_once(CONST_BasePath.'/lib/init-website.php');
4 require_once(CONST_BasePath.'/lib/log.php');
5 require_once(CONST_BasePath.'/lib/output.php');
6 ini_set('memory_limit', '200M');
7
8 $oParams = new Nominatim\ParameterParser();
9 $sOutputFormat = $oParams->getSet('format', array('json'), 'json');
10 set_exception_handler_by_format($sOutputFormat);
11
12 $oDB = new Nominatim\DB();
13 $oDB->connect();
14
15 $sSQL = 'select placex.place_id, country_code,';
16 $sSQL .= " name->'name' as name, i.* from placex, import_polygon_delete i";
17 $sSQL .= ' where placex.osm_id = i.osm_id and placex.osm_type = i.osm_type';
18 $sSQL .= ' and placex.class = i.class and placex.type = i.type';
19 $aPolygons = $oDB->getAll($sSQL, null, 'Could not get list of deleted OSM elements.');
20
21 if (CONST_Debug) {
22     var_dump($aPolygons);
23     exit;
24 }
25
26 if ($sOutputFormat == 'json') {
27     javascript_renderData($aPolygons);
28 }