-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsole-nominatim.php
52 lines (46 loc) · 1.13 KB
/
console-nominatim.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
include ("includes/console-connect.php");
include ("includes/importer.php");
error_reporting(1);
$importer = new importer();
//$importer->setUser($_SESSION["osm_user"]);
$importer->setPDO($dbh);
//To seed continents
//$importer->continents();
//To seed countries
//$importer->countries();
//To seed a single country
//Ísland 122
//Botswana 105
//Lesotho 216
//Zimbabwe 198
//Færeyjar 95
//Namibia 80
//Suður Afrík 57
//Andorra 6
//Qatar 164 ------
//Turkey 313
$country = 216;
//$country = $argv[1];
echo $importer->getCountry($country)."\n\n";
//NOMINATIM LOOKUP
//MapQuest Nominatim
//$importer->setUrlNom("http://open.mapquestapi.com/nominatim/v1/reverse.php?format=xml&addressdetails=1&accept-language=xx");
/*
$importer->loadCountryNominatim($country, "yes");
//POPULATE regions and areas
$importer->nominatimByRules($country);
*/
while(true)
{
$importer->resetNominatim();
if ($importer->nominatimCountryCheck() == "nothing")
{
//wait 5 minutes
$importer->resetNominatim();
echo date('H:i:s', time())." \n";
sleep(300);
}
}
echo "fini!!";
?>