Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.11 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Class Geodata
  5.  */
  6. class Geodata extends MX_Controller
  7. {
  8.     private $countries = [
  9.         'RU',
  10.         'KZ',
  11.         'UA',
  12.         'BY',
  13.     ];
  14.  
  15.     private $currency = [
  16.         'RU' => 'RUB',
  17.         'KZ' => 'KZT',
  18.         'UA' => 'UAH',
  19.         'BY' => 'BYN',
  20.     ];
  21.  
  22.     /*
  23.       RUB 810 (вообще 643 но у нас 810)
  24.       BY 933
  25.       UA 980
  26.       KZ 398
  27.     */
  28.     private $currency_codes = [
  29.         'RU' => 810,
  30.         'KZ' => 398,
  31.         'UA' => 960,
  32.         'BY' => 933,
  33.     ];
  34.  
  35.     private $path = FCPATH . '../data/';
  36.  
  37.     /**
  38.      * @var \PDO
  39.      */
  40.     private $pdo = null;
  41.  
  42.     /**
  43.      * @var int
  44.      */
  45.     private $insertChunk = 5000;
  46.  
  47.     /**
  48.      * Geodata constructor.
  49.      */
  50.     public function __construct()
  51.     {
  52.         exit;
  53.         header('Content-type: text/plain; charset=utf-8');
  54.         ini_set('display_errors', 'yes');
  55.         ini_set('error_reporting', 'E_ALL');
  56.         //ini_set('max_execution_time', 10);
  57.  
  58.         $this->pdo = $this->db->conn_id;
  59.         $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
  60.         $this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);
  61.         $this->pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, FALSE);
  62.  
  63.         parent::__construct();
  64.     }
  65.  
  66.     /**
  67.      *
  68.      */
  69.     public function __destruct()
  70.     {
  71.         echo bytesToKbOrMb(memory_get_peak_usage(true)), "\n";
  72.     }
  73.  
  74.     /**
  75.      *
  76.      */
  77.     public function countries()
  78.     {
  79.         header('Content-type: text/plain; charset=utf-8');
  80.  
  81.         $data = file(FCPATH . '../data/BY.txt');
  82.  
  83.         $cities = [];
  84.         $i = 0;
  85.         foreach ($data as $line) {
  86.  
  87.             $rows = explode("\t", $line);
  88.  
  89.  
  90.             /*            exit($rows[7]);*/
  91.  
  92.             $first = mb_substr($rows[7], 0, 1);
  93.  
  94.             if ($first != 'P' && $first != 'A') {
  95.                 // print_r($rows);
  96.                 continue;
  97.             }
  98.  
  99.             $cities[] = [
  100.                 'geonameid' => $rows[0],
  101.                 'aliases'   => array_unique(array_map('trim', explode(',', $rows[1] . ',' . $rows[3]))),
  102.                 'lat'       => round($rows[4] * 1000000),
  103.                 'lon'       => round($rows[5] * 1000000),
  104.                 'timezone'  => $rows[17],
  105.                 'original'  => $rows,
  106.             ];
  107.  
  108.             ++$i;
  109.  
  110.             if ($i > 100) {
  111.                 break;
  112.             }
  113.         }
  114.  
  115.  
  116.         print_r($cities);
  117.  
  118.  
  119.     }
  120.  
  121.     /**
  122.      *
  123.      */
  124.     public function cities()
  125.     {
  126.         // количество колонок в исходной таблице geonames (RU.txt KZ.txt etc.)
  127.         $record_fields_count = 19;
  128.  
  129.         $this->pdo->query('SET NAMES \'utf8mb4\';');
  130.  
  131.         // все source файлы долэжны быть на месте
  132.         foreach ($this->countries as $country) {
  133.             if (!file_exists($this->path . $country . '.txt')) {
  134.                 exit('File ' . $country . '.txt Not found');
  135.             }
  136.         }
  137.  
  138.         $insertData = [];
  139.  
  140.         foreach ($this->countries as $country) {
  141.  
  142.             echo 'Country: ' . $country . "\n";
  143.  
  144.             $linesCount = 0;
  145.             $realInsertLines = 0;
  146.  
  147.             // use generator
  148.             $gline = $this->readFileByLines($this->path . $country . '.txt');
  149.             while ($gline->valid()) {
  150.  
  151.                 $data = explode("\t", $gline->current());
  152.  
  153.                 if (count($data) !== $record_fields_count) {
  154.                     $gline->next();
  155.                     continue;
  156.                 }
  157.  
  158.                 $data[7] = mb_strtoupper($data[7]);
  159.  
  160.                 $first = mb_substr($data[7], 0, 3);
  161.  
  162.                 if ($first !== 'PPL' && $first !== 'ADM') {
  163.                     $gline->next();
  164.                     continue;
  165.                 }
  166.  
  167.                 // сколько строк надо вставить
  168.                 ++$linesCount;
  169.  
  170.                 $tmp = [
  171.                     (int)$data[0],
  172.                     $this->pdo->quote($data[1]),
  173.                     round($data[4] * 1000000),
  174.                     round($data[5] * 1000000),
  175.                     $this->pdo->quote($data[6]),
  176.                     $this->pdo->quote($data[7]),
  177.                     $this->pdo->quote($data[8]),
  178.                     $this->pdo->quote($data[9]),
  179.                     $this->pdo->quote($data[10]),
  180.                     $this->pdo->quote($data[11]),
  181.                     $this->pdo->quote($data[12]),
  182.                     $this->pdo->quote($data[13]),
  183.                     $data[14],
  184.                     (int)$data[15],
  185.                     $this->pdo->quote($data[17]),
  186.                     $this->pdo->quote($data[18]),
  187.                 ];
  188.  
  189.                 // сохраняем готовую для вставки строчку
  190.                 $insertData[] = $tmp;
  191.  
  192.                 if (count($insertData) === $this->insertChunk) {
  193.                     $realInsertLines += $this->InsertBatchTo__geonames_cities($insertData);
  194.  
  195.                     $insertData = [];
  196.                 }
  197.  
  198.                 $gline->next();
  199.             }
  200.  
  201.             // добавляем данные, если остались
  202.             if (count($insertData)) {
  203.                 $realInsertLines += $this->InsertBatchTo__geonames_cities($insertData);
  204.             }
  205.  
  206.             unset($insertData);
  207.  
  208.             echo "Lines $country ", $linesCount, "\n";
  209.             echo "realInsertLines ", $realInsertLines, "\n";
  210.         }
  211.     }
  212.  
  213.     /**
  214.      *
  215.      */
  216.     public function admin1Codes()
  217.     {
  218.         // количество колонок в исходной таблице geonames (RU.txt KZ.txt etc.)
  219.         $record_fields_count = 4;
  220.         $insertData = [];
  221.         $linesCount = 0;
  222.         $realInsertLines = 0;
  223.         $key_geonameId = 1;
  224.  
  225.         $this->pdo->query('SET NAMES \'utf8mb4\';');
  226.  
  227.         // use generator
  228.         $gline = $this->readFileByLines($this->path . 'admin1CodesASCII.txt');
  229.         while ($gline->valid()) {
  230.             $data = explode("\t", $gline->current());
  231.  
  232.             if (count($data) !== $record_fields_count) {
  233.                 $gline->next();
  234.                 continue;
  235.             }
  236.  
  237.             ++$linesCount;
  238.  
  239.             $tmp = [
  240.                 $this->pdo->quote($data[0]),
  241.                 // $key_geonameId = 1 (array index)
  242.                 (int)$data[3],
  243.                 $this->pdo->quote($data[1]),
  244.                 $this->pdo->quote($data[2]),
  245.             ];
  246.  
  247.             // сохраняем готовую для вставки строчку
  248.             $insertData[] = $tmp;
  249.  
  250.             if (count($insertData) === $this->insertChunk) {
  251.                 $realInsertLines += $this->InsertBatchTo__geonames_admin1Codes($insertData, $key_geonameId);
  252.  
  253.                 $insertData = [];
  254.             }
  255.  
  256.             $gline->next();
  257.  
  258.         }
  259.  
  260.         // добавляем данные, если остались
  261.         if (count($insertData)) {
  262.             $realInsertLines += $this->InsertBatchTo__geonames_admin1Codes($insertData, $key_geonameId);
  263.         }
  264.  
  265.         unset($insertData);
  266.  
  267.         echo "Lines ", $linesCount, "\n";
  268.         echo "realInsertLines ", $realInsertLines, "\n";
  269.     }
  270.  
  271.     /**
  272.      *
  273.      */
  274.     public function admin2Codes()
  275.     {
  276.         // количество колонок в исходной таблице geonames (RU.txt KZ.txt etc.)
  277.         $record_fields_count = 4;
  278.         $insertData = [];
  279.         $linesCount = 0;
  280.         $realInsertLines = 0;
  281.         $key_geonameId = 1;
  282.  
  283.         $this->pdo->query('SET NAMES \'utf8mb4\';');
  284.  
  285.         // use generator
  286.         $gline = $this->readFileByLines($this->path . 'admin2Codes.txt');
  287.         while ($gline->valid()) {
  288.  
  289.             $data = explode("\t", $gline->current());
  290.  
  291.             if (count($data) !== $record_fields_count) {
  292.                 $gline->next();
  293.                 continue;
  294.             }
  295.  
  296.             ++$linesCount;
  297.  
  298.             $tmp = [
  299.                 $this->pdo->quote($data[0]),
  300.                 # $key_geonameId = 1 (array index)
  301.                (int)$data[3],
  302.                 $this->pdo->quote($data[1]),
  303.                 $this->pdo->quote($data[2]),
  304.             ];
  305.  
  306.             // сохраняем готовую для вставки строчку
  307.             $insertData[] = $tmp;
  308.  
  309.             if (count($insertData) === $this->insertChunk) {
  310.                 $realInsertLines += $this->InsertBatchTo__geonames_admin2Codes($insertData, $key_geonameId);
  311.  
  312.                 $insertData = [];
  313.             }
  314.  
  315.             $gline->next();
  316.         }
  317.  
  318.         // добавляем данные, если остались
  319.         if (count($insertData)) {
  320.             $realInsertLines += $this->InsertBatchTo__geonames_admin2Codes($insertData, $key_geonameId);
  321.         }
  322.  
  323.         unset($insertData);
  324.  
  325.         echo "Lines ", $linesCount, "\n";
  326.         echo "realInsertLines ", $realInsertLines, "\n";
  327.     }
  328.  
  329.     /**
  330.      *
  331.      */
  332.     public function altnames()
  333.     {
  334.         $record_fields_count = 8;
  335.         $linesCount = 0;
  336.         $realInsertLines = 0;
  337.         $insertData = [];
  338.         $key_geonameId = 1;
  339.  
  340.         $this->pdo->query('SET NAMES \'utf8mb4\';');
  341.  
  342.         // use generator
  343.         $gline = $this->readFileByLines($this->path . 'alternateNames.txt');
  344.         while ($gline->valid()) {
  345.             $data = explode("\t", $gline->current());
  346.  
  347.             if (count($data) !== $record_fields_count) {
  348.                 $gline->next();
  349.                 continue;
  350.             }
  351.  
  352.             ++$linesCount;
  353.  
  354.             $tmp = [
  355.                 // alternateNameId (primory)
  356.                 (int)$data[0],
  357.                 // $key_geonameId = 1 (array index)
  358.                 (int)$data[1],
  359.                 // isolanguage
  360.                 $this->pdo->quote(mb_strtolower($data[2])),
  361.                 // alternate nam
  362.                 $this->pdo->quote($data[3]),
  363.                 // isPreferredNam
  364.                 (int)$data[4],
  365.                 // isShortName
  366.                 (int)$data[5],
  367.                 // isColloquial
  368.                 (int)$data[6],
  369.                 // isHistoric
  370.                 (int)$data[7],
  371.             ];
  372.  
  373.             $insertData[] = $tmp;
  374.  
  375.             if (count($insertData) === $this->insertChunk) {
  376.                 echo '--- INSERT CHUNK ---', "\n";
  377.                 $realInsertLines += $this->InsertBatchTo__geonames_altnames($insertData, $key_geonameId);
  378.  
  379.                 $insertData = [];
  380.             }
  381.  
  382.             $gline->next();
  383.  
  384.         }
  385.  
  386.         // добавляем данные, если остались
  387.         if (count($insertData)) {
  388.             echo '--- INSERT LAST CHUNK ---', "\n";
  389.             $realInsertLines += $this->InsertBatchTo__geonames_altnames($insertData, $key_geonameId);
  390.         }
  391.  
  392.         unset($insertData);
  393.  
  394.         echo "\n", "\n", '--- END ---', "\n";
  395.         echo "Lines ", $linesCount, "\n";
  396.         echo "realInsertLines ", $realInsertLines, "\n";
  397.     }
  398.  
  399.     public function sphinx()
  400.     {
  401.  
  402.         $chunkSize = 3000;
  403.         $start = 0;
  404.  
  405.         $records = 0;
  406.  
  407.         do {
  408.             $sql = 'SELECT `geonameid`, `name`, `country_code`, `admin1_code`, `admin2_code` FROM `_geonames_cities` WHERE `feature_class`="P" ORDER BY `geonameid` ASC LIMIT '
  409.                 . $start . ',' . $chunkSize . ';';
  410.  
  411.             $data = $this->pdo->query($sql)->fetchAll(\PDO::FETCH_ASSOC);
  412.  
  413.             $this->citiesToFullPath($data);
  414.  
  415.             $records += count($data);
  416.             $start += $chunkSize;
  417.  
  418.         } while (is_array($data) && count($data) > 0);
  419.  
  420.         echo 'Records: ' . $records, "\n";
  421.     }
  422.  
  423.     /**
  424.      * @param string $file
  425.      *
  426.      * @return Generator|null
  427.      */
  428.     private function readFileByLines($file)
  429.     {
  430.         // 1Mb
  431.         $bufSize = 2.5 * 1024 * 1024;
  432.         $buf = '';
  433.  
  434.         if (!file_exists($file) || !is_readable($file)) {
  435.             return null;
  436.         }
  437.  
  438.         $fp = fopen($file, 'rb');
  439.  
  440.         while (is_resource($fp) && !feof($fp)) {
  441.             $buf = fread($fp, $bufSize);
  442.  
  443.             if (is_resource($fp) && !feof($fp)) {
  444.                 $buf .= fgets($fp);
  445.             }
  446.  
  447.             $lines = explode("\n", $buf);
  448.  
  449.             foreach ($lines as $line) {
  450.                 yield $line;
  451.             }
  452.         }
  453.  
  454.         if (is_resource($fp)) {
  455.             fclose($fp);
  456.         }
  457.     }
  458.  
  459.     /**
  460.      * @param array $data
  461.      *
  462.      * @return int
  463.      */
  464.     private function InsertBatchTo__geonames_cities(array $data)
  465.     {
  466.         $sql = 'INSERT INTO `_geonames_cities`
  467. (`geonameid`, `name`, `latitude`, `longitude`, `feature_class`, `feature_code`, `country_code`, `cc2`,
  468. `admin1_code`, `admin2_code`, `admin3_code`, `admin4_code`, `population`, `elevation`, `timezone`, `modification_date`)';
  469.  
  470.         return $this->InsertBatch($sql, $data);
  471.     }
  472.  
  473.     /**
  474.      * @param array   $data
  475.      * @param integer $key_geonameId
  476.      *
  477.      * @return int
  478.      */
  479.     private function InsertBatchTo__geonames_altnames(array $data, $key_geonameId)
  480.     {
  481.         $data = $this->filterGeonamesId($data, $key_geonameId);
  482.  
  483.         if (count($data) == 0) {
  484.             return 0;
  485.         }
  486.  
  487.         $sql = 'INSERT INTO `_geonames_altnames`
  488. (`alternateNameId`, `geonameid`, `isolanguage`, `alternate_name`, `isPreferredNam`, `isShortName`, `isColloquial`, `isHistoric`)';
  489.  
  490.         return $this->InsertBatch($sql, $data);
  491.     }
  492.  
  493.     /**
  494.      * @param array   $data
  495.      * @param integer $key_geonameId
  496.      *
  497.      * @return int
  498.      */
  499.     private function InsertBatchTo__geonames_admin1Codes(array $data, $key_geonameId)
  500.     {
  501.         $this->filterCountry($data, 0);
  502.  
  503.         if (count($data) == 0) {
  504.             return 0;
  505.         }
  506.  
  507.         $sql = 'INSERT INTO `_geonames_admin1Codes` (`code`, `geonameid`, `name1`, `name2`)';
  508.  
  509.         return $this->InsertBatch($sql, $data);
  510.     }
  511.  
  512.     /**
  513.      * @param array   $data
  514.      * @param integer $key_geonameId
  515.      *
  516.      * @return int
  517.      */
  518.     private function InsertBatchTo__geonames_admin2Codes(array $data, $key_geonameId)
  519.     {
  520.         $this->filterCountry($data, 0);
  521.  
  522.         if (count($data) == 0) {
  523.             return 0;
  524.         }
  525.  
  526.         $sql = 'INSERT INTO `_geonames_admin2Codes` (`code`, `geonameid`, `name1`, `name2`)';
  527.  
  528.         return $this->InsertBatch($sql, $data);
  529.  
  530.     }
  531.  
  532.     /**
  533.      * @param string $sql
  534.      * @param array  $data
  535.      *
  536.      * @return int
  537.      */
  538.     private function InsertBatch(&$sql, array &$data)
  539.     {
  540.         $data = $this->joinForInsert($data);
  541.         $chunks_insert_row_count = count($data);
  542.  
  543.         $stmt = $this->pdo->query($sql . ' VALUES (' . join('),(', $data) . ');');
  544.  
  545.         if (is_object($stmt) && $stmt->rowCount() !== $chunks_insert_row_count) {
  546.  
  547.             echo('Must: ' . $chunks_insert_row_count . ' REAL: ' . $stmt->rowCount() . "\n");
  548.             var_dump($stmt->rowCount());
  549.  
  550.             exit('BAD INSERT #1');
  551.         } elseif (!is_object($stmt)) {
  552.             var_dump($stmt);
  553.             print_r($this->pdo->errorInfo());
  554.             //echo($sql);
  555.             exit('BAD INSERT #2');
  556.         }
  557.  
  558.         return $stmt->rowCount();
  559.     }
  560.  
  561.     /**
  562.      * @param array   $data
  563.      * @param integer $key_geonameId
  564.      *
  565.      * @return array
  566.      */
  567.     private function filterGeonamesId(array &$data, $key_geonameId)
  568.     {
  569.         $geonamesID = array_unique(array_column($data, $key_geonameId));
  570.  
  571.         $foundGeonamesId = $this->pdo
  572.             ->query('SELECT `geonameid` FROM `_geonames_cities` WHERE `geonameid` IN (' . join(',', $geonamesID) . ');')
  573.             ->fetchAll(PDO::FETCH_COLUMN);
  574.  
  575.         $foundGeonamesId1 = $this->pdo
  576.             ->query('SELECT `geonameid` FROM `_geonames_admin1Codes` WHERE `geonameid` IN (' . join(',', $geonamesID) . ');')
  577.             ->fetchAll(PDO::FETCH_COLUMN);
  578.  
  579.         $foundGeonamesId2 = $this->pdo
  580.             ->query('SELECT `geonameid` FROM `_geonames_admin2Codes` WHERE `geonameid` IN (' . join(',', $geonamesID) . ');')
  581.             ->fetchAll(PDO::FETCH_COLUMN);
  582.  
  583.         $foundGeonamesId = array_unique(array_merge($foundGeonamesId, $foundGeonamesId1, $foundGeonamesId2));
  584.  
  585.         if (count($foundGeonamesId) == 0) {
  586.             return [];
  587.         }
  588.  
  589.         foreach ($data as $k => $v) {
  590.             if (!in_array($v[$key_geonameId], $foundGeonamesId)) {
  591.                 unset($data[$k]);
  592.             }
  593.         }
  594.  
  595.         return $data;
  596.     }
  597.  
  598.     /**
  599.      * @param array $data
  600.      *
  601.      * @return array
  602.      */
  603.     private function joinForInsert(array $data)
  604.     {
  605.  
  606.         foreach ($data as $k => $v) {
  607.             $data[$k] = join(',', $v);
  608.         }
  609.  
  610.         return $data;
  611.  
  612.     }
  613.  
  614.     /**
  615.      * @param array   $data
  616.      * @param integer $key
  617.      */
  618.     private function filterCountry(array &$data, $key)
  619.     {
  620.         foreach ($data as $k => $v) {
  621.             list($country) = explode('.', $v[$key]);
  622.             $country = trim($country, ' \'');
  623.  
  624.  
  625.             if (!in_array($country, $this->countries)) {
  626.                 unset($data[$k]);
  627.             }
  628.         }
  629.     }
  630.  
  631.     public function find()
  632.     {
  633.         $q = $this->input->get('q');
  634.  
  635.         $this->load->library('MY_Sphinx');
  636.         $sphinx = $this->my_sphinx->init();
  637.  
  638.         $data = $sphinx->searchCity($q);
  639.         //print_r($data);
  640.         $order_field = array_column($data, 'id');
  641.  
  642.         $result = $this->pdo->query('SELECT * FROM `_geonames_altnames` WHERE `alternateNameId` IN (' . join(',', array_column($data, 'id')) . ')
  643.        ORDER BY FIELD(`alternateNameId`,' . join(',', $order_field) . ') ASC;')->fetchAll(\PDO::FETCH_ASSOC);
  644.  
  645.         print_r($result);
  646.     }
  647.  
  648.     private function citiesToFullPath(array &$data)
  649.     {
  650.  
  651.         if (!isset($this->_geonames_admin1Codes)) {
  652.             $this->_geonames_admin1Codes = $this->pdo->query('SELECT * FROM `_geonames_admin1Codes`;')->fetchAll();
  653.             $this->_geonames_admin2Codes = $this->pdo->query('SELECT * FROM `_geonames_admin2Codes`;')->fetchAll();
  654.  
  655.             keyBy($this->_geonames_admin1Codes, 'code');
  656.             keyBy($this->_geonames_admin2Codes, 'code');
  657.  
  658.         }
  659.  
  660.         foreach ($data as $k => $city) {
  661.             $geonamesForAlt = [$city['geonameid']];
  662.  
  663.             $admin1_key = ($city['country_code'] . '.' . $city['admin1_code']);
  664.             $admin2_key = ($city['country_code'] . '.' . $city['admin1_code'] . '.' . $city['admin2_code']);
  665.  
  666.             if (mb_strlen($city['admin1_code']) && isset($this->_geonames_admin1Codes[$admin1_key])) {
  667.                 $data[$k]['admin1'] = $this->_geonames_admin1Codes[$admin1_key];
  668.                 $geonamesForAlt[] = $data[$k]['admin1']['geonameid'];
  669.             }
  670.  
  671.             if (mb_strlen($city['admin1_code']) && mb_strlen($city['admin2_code']) && isset($this->_geonames_admin2Codes[$admin2_key])) {
  672.                 $data[$k]['admin2'] = $this->_geonames_admin1Codes[$admin2_key];
  673.                 $geonamesForAlt[] = $data[$k]['admin2']['geonameid'];
  674.             }
  675.  
  676.             $altNmaes = $this->getAltNames($geonamesForAlt);
  677.             $this->setTopNames($data[$k], $altNmaes);
  678.  
  679.                 print_r($data[$k]);
  680.                 print_r($altNmaes);
  681.             exit;
  682.         }
  683.     }
  684.  
  685.     private function getAltNames($geonameId)
  686.     {
  687.         $out = [];
  688.  
  689.         if (!is_array($geonameId)) {
  690.             $geonameId[] = $geonameId;
  691.         }
  692.  
  693.         $data = $this->pdo->query('SELECT * FROM `_geonames_altnames` WHERE `geonameid` IN (' . join(',', $geonameId) . ')
  694.        AND `isolanguage` IN (\'\', \'en\', \'ru\', \'be\', \'kk\', \'uk\');')
  695.                           ->fetchAll();
  696.  
  697.         foreach ($geonameId as $id)
  698.         {
  699.             $out[$id] = [];
  700.         }
  701.  
  702.         foreach ($data as $row)
  703.         {
  704.             $out[$row['geonameid']][] = $row;
  705.         }
  706.  
  707.         return $out;
  708.     }
  709.  
  710.     private function setTopNames(array &$city, array &$altNmaes)
  711.     {
  712.         $city['topName'] = $city['name'];
  713.  
  714.         if (isset($altNmaes[$city['geonameid']]) && count($altNmaes[$city['geonameid']]))
  715.         {
  716.  
  717.         }
  718.  
  719.  
  720.     }
  721. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement