2017 © Pedro Peláez
 

library geonames

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

image

michaeldrennen/geonames

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  • Friday, June 22, 2018
  • by michaeldrennen
  • Repository
  • 1 Watchers
  • 19 Stars
  • 364 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 4 Open issues
  • 20 Versions
  • 23 % Grown

The README.md

geonames v7.x

Latest Stable Version Total Downloads License GitHub issues GitHub forks GitHub stars Travis (.org), (*1)

A Laravel (php) package to interface with the geo-location services at geonames.org., (*2)

Major Version Jump

I jumped several major versions to catch up with Larvel's major version number. Makes things a little clearer., (*3)

Notes

There is still a lot that needs to be done to make this package "complete". I've gotten it to a point where I can use it for my next project. As time allows, I will improve the documentation and testing that comes with this package. Thanks for understanding., (*4)

Installation

composer require michaeldrennen/geonames

And then add geonames provider to providers array in app.php config file:, (*5)

MichaelDrennen\Geonames\GeonamesServiceProvider::class,

After that, Run migrate command:, (*6)

php artisan migrate

Want to install all of the geonames records for the US, Canada, and Mexico as well as pull in the feature codes definitions file in English?, (*7)

php artisan geonames:install --country=US --country=CA --country=MX --language=en

Want to just install everything in the geonames database?, (*8)

php artisan geonames:install

Maintenance

Now that you have the geonames database up and running on your system, you need to keep it up-to-date., (*9)

I have an update script that you need to schedule in Laravel to run every day., (*10)

Some info on how to schedule Laravel artisan commands:, (*11)

https://laravel.com/docs/5.6/scheduling#scheduling-artisan-commands, (*12)

You can read this notice at: http://download.geonames.org/export/dump/, (*13)

The "last modified" timestamp is in Central European Time. , (*14)

It looks like geonames updates their data around 3AM CET., (*15)

So if you schedule your system to run the geonames:update artisan command after 4AM CET, you should be good to go., (*16)

I like to keep my servers running on GMT. Keeps things consistent., (*17)

(Central European Time is 1 hour ahead of Greenwich Mean Time), (*18)

Assuming your servers are running on GMT, your update command would look like:, (*19)

$schedule->command('geonames:update')->dailyAt('3:00');

The update artisan command will handle the updates and deletes to the geonames table., (*20)

By default, GeonamesServiceProvider will run it for you daily at config('geonames.update_daily_at')., (*21)

Gotchas

Are you getting something like: 1071 Specified key was too long, (*22)

@see https://laravel-news.com/laravel-5-4-key-too-long-error, (*23)

Add this to your AppServiceProvider.php file:, (*24)

Schema::defaultStringLength(191);

A quick word on indexes

This library contains a bunch of migrations that contain a bunch of indexes. Now not everyone will need all of the indexes., (*25)

So when you install this library, run the migrations and delete the indexes that you don't need., (*26)

Also, Laravel doesn't let you specify a key length for indexes on varchar columns. There are two indexes suffering from this limit. Instead of creating indexes on those columns the "Laravel way", I send a raw/manual query to create the indexes with the proper lengths., (*27)

The Versions

22/06 2018
20/06 2018
20/06 2018
19/06 2018
18/06 2018
18/06 2018
18/06 2018
18/06 2018
15/04 2018
12/02 2018
27/03 2017

v0.0.9

0.0.9.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

26/02 2017

v0.0.8

0.0.8.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

19/02 2017

v0.0.7

0.0.7.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

19/02 2017

v0.0.6

0.0.6.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

19/02 2017

v0.0.5

0.0.5.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

18/02 2017

v0.0.4

0.0.4.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

18/02 2017

v0.0.3

0.0.3.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

16/02 2017

v0.0.2

0.0.2.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

15/02 2017

v0.0.1

0.0.1.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen

15/02 2017

v0.0.0

0.0.0.0

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Drennen