2017 © Pedro Peláez
 

library geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

image

smart/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  • Monday, March 6, 2017
  • by smart
  • Repository
  • 2 Watchers
  • 0 Stars
  • 297 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

This library is deprecated, use geobase/countries instead.

Smart Geo

Build Status Latest Stable Version Total Downloads License, (*1)

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects., (*2)

  1. Features
  2. Sources
  3. Requirements
  4. Installation
  5. Country
  6. Region

Features

  • Multiple languages (Currently only supports English, French and German).
  • Country Database
  • Region Database (Currently only for Canada and the United States).
  • IP Geolocation (With MaxMind)

Sources

Requirements

Smart Geo does not require a database, but instead, uses JSON files., (*3)

This library uses PHP 5.6+., (*4)

Installation

You need to install the Smart Geo library through composer. To do so, add the following lines to your composer.json file., (*5)

{
    "require": {
       "smart/geo": "dev-master"
    }
}

To download or update the current data, use the following command., (*6)

php vendor/bin/geo data:update

Country

Database of all countries in the world., (*7)

Properties, (*8)

  • Names
  • Short Code (Alpha-2 code)
  • Code (Alpha-3 code)
  • Latitude
  • Longitude
  • Bounding Box
  • Currency
  • Continent
  • Population
  • Area
  • Capital
  • Timezone

Examples, (*9)

Get a list of all countries., (*10)

$countryCollection = (new Geo)->getCountryRepository()->findAll();

Get country name in english., (*11)

foreach ($countryCollection as $country) {
   echo $country->getNames()->get('en');
}

Order by country name in english., (*12)

$countryCollection->orderByName();

Region

Database of all States, Federal Districts and Territories in the United States, Provinces and Territories in Canada., (*13)

Properties, (*14)

  • Name
  • Code (Alpha-2 code)
  • Country
  • Type
  • Latitude
  • Longitude
  • Bounding Box

Examples, (*15)

Get a list of all regions in the US., (*16)

$geo = new Geo;
$country = $geo->getCountryRepository()->findByCode('US');
$regionCollection = (new Geo)->getRegionRepository()->findByCountry($country);

Get region name and type in english., (*17)

foreach ($regionCollection as $region) {
   echo $region->getNames()->get('en') . " is a " . 
       $region->getType()::class . " of the " . 
       $country->getNames()->get('en);
}

The Versions

06/03 2017

dev-master

9999999-dev https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

25/09 2016

0.4.0

0.4.0.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

22/09 2016

0.3.0

0.3.0.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

18/05 2016

0.2.9

0.2.9.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

06/11 2015

0.2.8

0.2.8.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

06/11 2015

0.2.7

0.2.7.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

04/11 2015

0.2.6

0.2.6.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

22/10 2015

0.2.5

0.2.5.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

17/09 2015

0.2.4

0.2.4.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

08/07 2015

0.2.3

0.2.3.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

06/06 2015

0.2.2

0.2.2.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

16/05 2015

0.2.1

0.2.1.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

24/03 2015

0.2.0

0.2.0.0 https://github.com/smart-io/geo

Smart Geo is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

26/01 2015

0.1.4

0.1.4.0 https://github.com/mysmartdata/php-smartdata

SmartData is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

23/01 2015

0.1.3

0.1.3.0 https://github.com/mysmartdata/php-smartdata

SmartData is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

09/01 2015

0.1.2

0.1.2.0 https://github.com/mysmartdata/php-smartdata

SmartData is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province

10/12 2014

0.1.1

0.1.1.0 https://github.com/mysmartdata/php-smartdata

SmartData is databases from Open Data providers compiled into easy to use PHP objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

database geoip geolocation data country state region province