salaun/geonames

Geonames importer and models for Eloquent ORM. This repo is a fork from Yurtesen/Geonames.

1.0.2 2021-11-02 09:38 UTC

README

License

This package provides a way to import/update a local copy of GeoNames databases. The data is retrieved from GeoNames text file export on a public server. You are welcome to read GeoNames README for more informations on this service.

Installation

Note: If you are using Lumen. You have to first install irazasyed/larasupport !

You can install the package via composer:

composer require salaun/geonames

You can publish and run the migrations with:

php artisan vendor:publish --provider="Salaun\Geonames\GeonamesServiceProvider" --tag="geonames-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="Salaun\Geonames\GeonamesServiceProvider" --tag="geonames-config"

This is the contents of the published config file:

return [
];

Usage

Please see the wiki for further information.

Provided Eloquent Models

Please see the Wiki pages for implementation details.

NameKeyRelationsScopes
GeonamesGeonamegeoname_idalternateName, timeZone,countryadmin1,city,countryInfo
GeonamesAlternateNamegeoname_idgeoname
GeonamesCountryInfoisotimezone,continent
GeonamesFeatureCodecode
GeonamesLanguageCodeiso_639_3
GeonamesTimezonetimezone_id
GeonamesHierarchyparent_id
GeonamesAdmin1Codegeoname_idgeoname,hierarchies
GeonamesAdmin2Codegeoname_idgeoname,hierarchies

Tables

GeoNames file names and corresponding table names created in your database.

FilenameTablename
timeZones.txtgeonames_timezones
allCountries.zipgeonames_geonames
countryInfo.txtgeonames_country_infos
iso-languagecodes.txtgeonames_language_codes
alternateNames.zipgeonames_alternate_names
hierarchy.zipgeonames_hierarchies
admin1CodesASCII.txtgeonames_admin1_codes
admin2Codes.txtgeonames_admin2_codes
featureCodes_en.txtgeonames_feature_codes

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.