3  * SPDX-License-Identifier: GPL-2.0-only
 
   5  * This file is part of Nominatim. (https://nominatim.org)
 
   7  * Copyright (C) 2022 by the Nominatim developer community.
 
   8  * For a full list of authors see the git log.
 
  11 require_once(CONST_LibDir.'/init-website.php');
 
  12 require_once(CONST_LibDir.'/log.php');
 
  13 require_once(CONST_LibDir.'/output.php');
 
  14 ini_set('memory_limit', '200M');
 
  16 $oParams = new Nominatim\ParameterParser();
 
  17 $sOutputFormat = $oParams->getSet('format', array('json'), 'json');
 
  18 set_exception_handler_by_format($sOutputFormat);
 
  20 $oDB = new Nominatim\DB(CONST_Database_DSN);
 
  23 $sSQL = 'select placex.place_id, country_code,';
 
  24 $sSQL .= " name->'name' as name, i.* from placex, import_polygon_delete i";
 
  25 $sSQL .= ' where placex.osm_id = i.osm_id and placex.osm_type = i.osm_type';
 
  26 $sSQL .= ' and placex.class = i.class and placex.type = i.type';
 
  27 $aPolygons = $oDB->getAll($sSQL, null, 'Could not get list of deleted OSM elements.');
 
  34 if ($sOutputFormat == 'json') {
 
  35     javascript_renderData($aPolygons);