private function createFallbackToponym($code, $name, $toponymId)
 {
     $toponym = new Toponym($toponymId);
     $toponym->setName($name)->setAsciiName($name)->setFeature($this->getContinentFeature())->setLastModify(new \DateTime('1970-01-01'));
     $this->om->persist($toponym);
     return $toponym;
 }
Пример #2
0
 protected function loadToponyms()
 {
     $fixtures = array(array(2635167, 'United Kingdom of Great Britain and Northern Ireland', 'United Kingdom of Great Britain and Northern Ireland', 54.75844, -2.69531, 'A.PCLI', 'GB', '00', null, null, null, 62348447, null), array(2657896, 'Zürich', 'Zurich', 47.36667, 8.550000000000001, 'P.PPLA', 'CH', 'ZH', '112', '261', null, 341730, null), array(2659836, 'Lugano', 'Lugano', 46.01008, 8.960039999999999, 'P.PPLA2', 'CH', 'TI', '2105', '5192', null, 26365, null), array(3017382, 'Republic of France', 'Republic of France', 46, 2, 'A.PCLI', 'FR', '00', null, null, null, 64768389, null), array(3164603, 'Venezia', 'Venezia', 45.43861, 12.32667, 'P.PPLA', 'IT', '20', 'VE', '027042', null, 270816, null), array(3165361, 'Regione Toscana', 'Regione Toscana', 43.41667, 11, 'A.ADM1', 'IT', '16', null, null, null, 3730130, null), array(3166546, 'Provincia di Siena', 'Provincia di Siena', 43.21667, 11.4, 'A.ADM2', 'IT', '16', 'SI', null, null, 271365, null), array(3169070, 'Rome', 'Rome', 41.89474, 12.4839, 'P.PPLC', 'IT', '07', 'RM', '058091', null, 2563241, null), array(3173435, 'Milano', 'Milano', 45.46427, 9.18951, 'P.PPLA', 'IT', '09', 'MI', '015146', null, 1306661, '120'), array(3174618, 'Regione Lombardia', 'Regione Lombardia', 45.66667, 9.5, 'A.ADM1', 'IT', '09', null, null, null, 9826141, null), array(3175395, 'Repubblica Italiana', 'Repubblica Italiana', 42.83333, 12.83333, 'A.PCLI', 'IT', '00', null, null, null, 60340328, null), array(3176958, 'Provincia di Firenze', 'Provincia di Firenze', 43.83333, 11.33333, 'A.ADM2', 'IT', '16', 'FI', null, null, 991862, null), array(3178227, 'Provincia di Como', 'Provincia di Como', 45.98333, 9.216670000000001, 'A.ADM2', 'IT', '09', 'CO', null, null, 590050, null), array(3178229, 'Como', 'Como', 45.80998, 9.087440000000001, 'P.PPLA2', 'IT', '09', 'CO', '013075', null, 78680, null), array(3181006, 'Campione d\'Italia', 'Campione d\'Italia', 45.96808, 8.971030000000001, 'P.PPLA3', 'IT', '09', 'CO', '013040', null, 2267, null), array(6255146, 'Africa', 'Africa', 7.1881, 21.09375, 'L.CONT', null, null, null, null, null, null, null), array(6255148, 'Europe', 'Europe', 48.69096, 9.14062, 'L.CONT', null, null, null, null, null, null, null), array(6535698, 'Ello', 'Ello', 45.78568, 9.36534, 'P.PPLA3', 'IT', '09', 'LC', '097033', null, 1110, null), array(6537155, 'Romano di Lombardia', 'Romano di Lombardia', 45.52458, 9.74836, 'A.ADM3', 'IT', '09', 'BG', '016183', null, 18622, null));
     foreach ($fixtures as $f) {
         $toponym = new Toponym($f[0]);
         $toponym->setName($f[1])->setAsciiName($f[2])->setLatitude($f[3])->setLongitude($f[4])->setFeature($this->features[$f[5]])->setCountryCode($f[6])->setAdmin1Code($f[7])->setAdmin2Code($f[8])->setAdmin3Code($f[9])->setAdmin4Code($f[10])->setPopulation($f[11])->setElevation($f[12])->setLastModify(new \DateTime());
         $this->om->persist($toponym);
     }
 }
Пример #3
0
 public function toponymProvider()
 {
     $all = array(array(array(6535698, 'Ello', 'Ello', 45.78568, 9.36534, 'P.PPLA3', 'IT', '09', 'LC', '097033', null, 1110, null), array(array(45.78568, 9.36534), 45.78568, 9.36534, null, null, null, 'Ello', null, null, null, 'LC', null, '09', null, 'IT', null)));
     foreach ($all as &$data) {
         list($class, $code) = explode('.', $data[0][5]);
         $feature = new Feature($class, $code);
         $toponym = new Toponym($data[0][0]);
         $toponym->setName($data[0][1])->setAsciiName($data[0][2])->setLatitude($data[0][3])->setLongitude($data[0][4])->setFeature($feature)->setCountryCode($data[0][6])->setAdmin1Code($data[0][7])->setAdmin2Code($data[0][8])->setAdmin3Code($data[0][9])->setAdmin4Code($data[0][10])->setPopulation($data[0][11])->setElevation($data[0][12]);
         $data[0] = $toponym;
     }
     return $all;
 }