dev-master
9999999-devCSV data importer from geonames.org
BSD-3-Clause
The Requires
- php >=5.4.0
- ext-curl *
- ext-zip *
by Max Kalyabin
geonames kalyabin cities database countries database
CSV data importer from geonames.org
CSV data importer from geonames.org, (*1)
Use open CSV base from geonames: - cities bases (cities5000.zip, cities15000.zip, RU.zip, US.zip, etc.) - countries base - states base (admin1code.csv), (*2)
Run in your console, (*3)
php composer.phar require "kalyabin/geonames-importer" "dev-master"
$importer = new \kalyabin\geonames\importer\Country('/tmp/', function($country) { print 'Consume country: ' . "\n"; print_r($country); print "\n"; // do something else }); $importer->process();
$importer = new \kalyabin\geonames\importer\City('/tmp/', 'cities5000.zip', function($city) { print 'Consume city: ' . "\n"; print_r($city); print "\n"; // do something else }); $importer->process();
You may type second param like RU.zip, US.zip, cities15000.zip, etc., (*4)
$importer = new \kalyabin\geonames\importer\Admin1CodeASCII('/tmp/', function($region) { fwrite(STDOUT, "Consume region: "); print_r($region); fwrite(STDOUT, "\n"); }); $importer->process();
More about geonames open base read at http://download.geonames.org/export/dump/readme.txt, (*5)
CSV data importer from geonames.org
BSD-3-Clause
geonames kalyabin cities database countries database