dev-master
9999999-dev https://github.com/ronanguilloux/GeocoderToolkitGeo-related utils & toolkit PHP library, build atop the Geocoder lib
MIT
The Requires
- php >=5.3.0
- willdurand/geocoder master-dev
geo geometry geocoder bounds boundingbox
Geo-related utils & toolkit PHP library, build atop the Geocoder lib
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)
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';
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)
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)
Geo-related utils & toolkit PHP library, build atop the Geocoder lib
MIT
geo geometry geocoder bounds boundingbox