2017 © Pedro Peláez
 

library geo

Geolocation utilities

image

leroy-merlin-br/geo

Geolocation utilities

  • Friday, May 20, 2016
  • by gmsantos
  • Repository
  • 20 Watchers
  • 11 Stars
  • 4,426 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GeoTools

leroy-merlin-br/geo is a simple to use set of tools for geolocation. It's an abstraction built on top of the powerfull phayes/geophp., (*1)

SensioLabsInsight, (*2)

Region matching

With the LeroyMerlin\GeoTools\RegionMatcher you can easily test if a coordinate is inside of a region., (*3)

Example of use:, (*4)

$regionMatcher = new LeroyMerlin\GeoTools\RegionMatcher;

$regionMatcher->loadRegion('/path/to/myRegion.kml');
$regionMatcher->loadRegion('/path/to/intersectingRegion.kml');
$regionMatcher->loadRegion('/path/to/farAwayRegion.kml');

$regionMatcher->getRegionsThatMatches(23, 23);
// returns ['myRegion', 'intersectingRegion']

IP to geolocation

LeroyMerlin\GeoTools\IpLocator uses ip-api.com to find out the geolocation of a given IP address., (*5)

Example of use:, (*6)

$locator = new LeroyMerlin\GeoTools\IpLocator;

$locator->getLocation('208.80.152.201');
// array(
//   'as' => 'AS14907 Wikimedia Foundation Inc.',
//   'city' => 'San Francisco',
//   'country' => 'United States',
//   'countryCode' => 'US',
//   'isp' => 'Wikimedia Foundation',
//   'lat' => 37.7898,
//   'lon' => -122.3942,
//   'org' => 'Wikimedia Foundation',
//   'query' => '208.80.152.201',
//   'region' => 'CA',
//   'regionName' => 'California',
//   'status' => 'success',
//   'timezone' => 'America/Los_Angeles',
//   'zip' => '94105'
// )

$locator->getCoordinates('208.80.152.201');
// array(
//   'x' => 37.7898,
//   'y' => -122.3942
// )

The Versions

20/05 2016

dev-master

9999999-dev

Geolocation utilities

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Zizaco

gps geolocation geo map location kml polygon

20/05 2016

1.0-beta

1.0.0.0-beta

Geolocation utilities

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Zizaco

gps geolocation geo map location kml polygon