bordeux/geoname-bundle
Symfony bundle to import and access GeoNames.org geographic data in PostgreSQL via Doctrine ORM. Load countries, timezones, states/provinces, and cities/towns/suburbs from the GeoNames export using built-in console import commands.
Provides access to the data exported by GeoNames.org into Symfony 5, 6 applications. Starting version 3.0 this library supporting only PostgreSQL database.
From the geonames.org website:
The GeoNames geographical database covers all countries and contains over eight million place names that are available for download free of charge.
Most useful application for this bundle is to normalize the geograhical information stored in your database such as Countries, States and Cities. Thanks to the extensive geonames.org data almost all cities, towns and suburbs are covered worldwide.
Imports the following geonames.org data:
Provides the following data store implementations:
Install the bundle using composer:
composer require bordeux/geoname-bundle
Add the bundle to your AppKernel.php
// AppKernel::registerBundles()
$bundles = array(
// ...
new Bordeux\Bundle\GeoNameBundle\BordeuxGeoNameBundle(),
// ...
);
Execute the migrations using the supplied migration configuration
php bin/console doctrine:schema:update --force
Note that importing the data from the remote geonames.org repository involves downloading almost 350 MB data from geonames.org.
The following commands can be used in sequence to load all supported data from the geonames.org export (https://download.geonames.org/export/dump)
Loads a list of all data from geonames.org
php bin/console bordeux:geoname:import --env=prod
Just run: docker-compose -f docker-compose.tests.yml up
How can I help you explore Laravel packages today?