2017 © Pedro Peláez
 

library geo

PHP 5.4+ library to make working with Geo coordinates safer, easier, and fun

image

black/geo

PHP 5.4+ library to make working with Geo coordinates safer, easier, and fun

  • Saturday, November 8, 2014
  • by pocky
  • Repository
  • 1 Watchers
  • 1 Stars
  • 36 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Geo

PHP 5.4+ library to make working with Geo coordinates safer, easier, and fun!, (*1)

SensioLabsInsight Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads, (*2)

Installation

The recommended way to install Geo is through Composer:, (*3)

{
    "require": {
        "black/geo": "@stable"
    }
}

Protip: You should browse the [black/geo](https://packagist.org/packages/black/geo page to choose a stable version to use, avoid the @stable meta constraint., (*4)

Usage

Usage of this class is simple. First, Geo coordinates are based on three values : latitude, longitude and elevation. Elevation is not required and initialised to 0 if arguments are not provided., (*5)

There are three ways to create a Geo object:, (*6)

$geo = new Geo\Coordinates(37.42242, -122.08585, 0);
$geo->getCoordinates(); // will return "37.42242,-122.08585,0"
Geo\Coordinates::fromCoordinatesAsString("37.42242,-122.08585,0")
    ->getLatitude(); // will return "37.42242"
Geo\Coordinates::fromCoordinatesAsArray([37.42242, -122.08585, 0])
    ->getCoordinates(); // will return "37.42242,-122.08585,0"

Getter, (*7)

List of available getters:, (*8)

  • getLatitude()
  • getLongitude()
  • getElevation()
  • getCoordinates()
  • getCoordinatesAsArray()

Check if two geo are equals, (*9)

  • isEqualTo(Geo $geo)

Exception, (*10)

If you want to pass 1 or less OR 4 or more arguments, a Geo\Exception\InvalidCoordinatesException() will be thrown., (*11)

License

Geo is released under the MIT License. See the bundled LICENSE file for details., (*12)

Contributing

See CONTRIBUTING file., (*13)

Credits

This README is heavily inspired by Geocoder library by the great @willdurand. This guy needs your PR for the sake of the REST in PHP., (*14)

Alexandre "pocky" Balmes alexandre@lablackroom.com. Send me Flattrs if you love my work, buy me gift or hire me!, (*15)

The Versions

08/11 2014

dev-master

9999999-dev http://www.lablackroom.com

PHP 5.4+ library to make working with Geo coordinates safer, easier, and fun

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

coordinates geo libary black-project value-object

08/11 2014

v1.0.1

1.0.1.0 http://www.lablackroom.com

PHP 5.4+ library to make working with Geo coordinates safer, easier, and fun

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

coordinates geo libary black-project value-object

09/10 2014

v1.0.0

1.0.0.0 http://www.lablackroom.com

PHP 5.4+ library to make working with Geo coordinates safer, easier, and fun

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

libary black