2017 © Pedro Peláez
 

library geocodertoolkit

Geo-related utils & toolkit PHP library, build atop the Geocoder lib

image

ronanguilloux/geocodertoolkit

Geo-related utils & toolkit PHP library, build atop the Geocoder lib

  • Saturday, November 3, 2012
  • by Ronan
  • Repository
  • 1 Watchers
  • 2 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

GeocoderToolkit

GeocoderToolkit is a geo-related utils & toolkit PHP library, build atop the Geocoder library, (*1)

It provides simple tools such as * distant geopoints coordinates calculation (bounding box angles, etc.) * other geo-related tools to come (all contributors will be fully credited!), (*2)

Build Status, (*3)

Installation

GeocoderToolkit is not a stand-alone library: it assumes strong dependency with the Geocoder PHP library., (*4)

The recommended way to install Geocoder is through composer., (*5)

Just create a composer.json file for your project:, (*6)

``` json { "require": { "php": ">=5.3.0", "willdurand/geocoder": "master-dev", "ronanguilloux/geocodertoolkit": "master-dev" } }, (*7)


And run these two commands to install it: ``` bash $ wget http://getcomposer.org/composer.phar $ php composer.phar install

Now you can add the autoloader, and you will have access to the library:, (*8)

``` php <?php, (*9)

require 'vendor/autoload.php';, (*10)


If you don't use neither **Composer** nor a _ClassLoader_ in your application, just require the provided autoloader: ``` php <?php require_once 'src/autoload.php';

Usage

Here is an example of how to determine a new geopoint, 500 kilometers away from an origin, in the north-east direction:, (*11)

``` php <?php, (*12)

$origin = new Geocoded(); $origin->fromArray(array('latitude'=>'47.218371', 'longitude'=>'-1.553621')); // Nantes, Loire valley, France $geometry = new BoundingBoxGeometry(); // 45 = bearing angle, 500 = distance, 'kilometer' is default, but miles are OK $northEast = $geometry->getAngle($origin, 45, 500); // a new geocoded resource, (*13)



API --- You can provide your own `geometry` tool, you just need to create a new class which implements `GeometryInterface`. Unit Tests ---------- To run unit tests, you'll need `cURL` and a set of dependencies you can install using Composer: ``` bash $ php composer.phar install --dev

Once installed, just launch the following command:, (*14)

bash $ phpunit, (*15)

Credits

License

GeocoderToolkit is released under the MIT License. See the bundled LICENSE file for details. You can find a copy of this software here: https://github.com/ronanguilloux/GeocoderToolkit, (*16)

The Versions

03/11 2012

dev-master

9999999-dev https://github.com/ronanguilloux/GeocoderToolkit

Geo-related utils & toolkit PHP library, build atop the Geocoder lib

  Sources   Download

MIT

The Requires

 

geo geometry geocoder bounds boundingbox