PHPackages                             adeb6600/geotools-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. adeb6600/geotools-laravel

ActiveLibrary[Queues &amp; Workers](/categories/queues)

adeb6600/geotools-laravel
=========================

Geo-related tools PHP library for Laravel 4 &amp; 5

1.0.1(10y ago)4532MITPHPPHP &gt;=5.4

Since Apr 27Pushed 10y ago2 watchersCompare

[ Source](https://github.com/adeb6600/Geotools-laravel)[ Packagist](https://packagist.org/packages/adeb6600/geotools-laravel)[ Docs](http://geotools-php.org/)[ RSS](/packages/adeb6600-geotools-laravel/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (5)Versions (9)Used By (0)

Geotools for Lavarel 4 &amp; 5
==============================

[](#geotools-for-lavarel-4--5)

This package allows you to use [**Geotools**](http://geotools-php.org) in [**Laravel**](http://laravel.com/).

[![Latest Stable Version](https://camo.githubusercontent.com/92b504913e843a676f5d4fb6baba89f045a5c0ea22a7f09b8764d2721c2347bf/68747470733a2f2f706f7365722e707567782e6f72672f746f696e30752f47656f746f6f6c732d6c61726176656c2f762f737461626c652e706e67)](https://packagist.org/packages/toin0u/Geotools-laravel)[![Total Downloads](https://camo.githubusercontent.com/dde38a45590e0ad8a9ae26ce73cececcfe2ae539130ad34901df45685cd51078/68747470733a2f2f706f7365722e707567782e6f72672f746f696e30752f47656f746f6f6c732d6c61726176656c2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/toin0u/Geotools-laravel)[![Build Status](https://camo.githubusercontent.com/f43bcc40203f60a2981607646c7171a75dc0b8ceabbc961f9c32c789bbb20d7f/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f746f696e30752f47656f746f6f6c732d6c61726176656c2e706e67)](http://travis-ci.org/toin0u/Geotools-laravel)[![Coverage Status](https://camo.githubusercontent.com/8f39822758c885a5717af0b57f76c7df5ea85706a8f1062da51a83d500830fe9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f746f696e30752f47656f746f6f6c732d6c61726176656c2f62616467652e706e67)](https://coveralls.io/r/toin0u/Geotools-laravel)[![SensioLabsInsight](https://camo.githubusercontent.com/2f8fd224f2c6061e0ce610266f651dfe3bb93a60491487d082431e9f3acb942a/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62323332616230662d323135392d346438322d396135332d6562393337306564653038382f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b232ab0f-2159-4d82-9a53-eb9370ede088)

Installation
------------

[](#installation)

It can be found on [Packagist](https://packagist.org/packages/toin0u/geotools-laravel). The recommended way is through [composer](http://getcomposer.org).

Edit `compose.json` and add:

**Please note**: use version `0.2.*` if you use **Laravel 4**. The document is [here](https://github.com/toin0u/Geotools-laravel/blob/7ad681731a5fb8ab9d85783638fd25dae28533a6/README.md).

```
{
    "require": {
        "adeb6600/geotools-laravel": "~1.0"
    }
}
```

And install dependecies:

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
```

Usage
-----

[](#usage)

Find the `providers` key in `config/app.php` and register the **Geotools Service Provider**.

```
'providers' => [
    // ...

    'Toin0u\Geotools\GeotoolsServiceProvider',
]
```

Find the `aliases` key in `config/app.php` and register the **Geotools Facade**.

```
'aliases' => [
    // ...

    'Geotools' => 'Toin0u\Geotools\Facade\Geotools',
]
```

Examples
--------

[](#examples)

Coordinate &amp; Ellipsoid
--------------------------

[](#coordinate--ellipsoid)

```
use League\Geotools\Coordinate\Ellipsoid;
use Toin0u\Geotools\Facade\Geotools;

// from an \Geocoder\Result\ResultInterface instance within Airy ellipsoid
$coordinate = Geotools::coordinate($geocoderResult, Ellipsoid::createFromName(Ellipsoid::AIRY));
// or in an array of latitude/longitude coordinate within GRS 1980 ellipsoid
$coordinate = Geotools::coordinate([48.8234055, 2.3072664], Ellipsoid::createFromName(Ellipsoid::GRS_1980));
// or in latitude/longitude coordinate within WGS84 ellipsoid
$coordinate = Geotools::coordinate('48.8234055, 2.3072664');
// or in degrees minutes seconds coordinate within WGS84 ellipsoid
$coordinate = Geotools::coordinate('48°49′24″N, 2°18′26″E');
// or in decimal minutes coordinate within WGS84 ellipsoid
$coordinate = Geotools::coordinate('48 49.4N, 2 18.43333E');
// the result will be:
printf("Latitude: %F\n", $coordinate->getLatitude()); // 48.8234055
printf("Longitude: %F\n", $coordinate->getLongitude()); // 2.3072664
printf("Ellipsoid name: %s\n", $coordinate->getEllipsoid()->getName()); // WGS 84
printf("Equatorial radius: %F\n", $coordinate->getEllipsoid()->getA()); // 6378136.0
printf("Polar distance: %F\n", $coordinate->getEllipsoid()->getB()); // 6356751.317598
printf("Inverse flattening: %F\n", $coordinate->getEllipsoid()->getInvF()); // 298.257224
printf("Mean radius: %F\n", $coordinate->getEllipsoid()->getArithmeticMeanRadius()); // 6371007.772533
```

[Read more...](http://geotools-php.org/#coordinate--ellipsoid)

Convert
-------

[](#convert)

```
// ...

$coordinate = Geotools::coordinate('40.446195, -79.948862');
$converted  = Geotools::convert($coordinate);
// convert to decimal degrees without and with format string
printf("%s\n", $converted->toDecimalMinutes()); // 40 26.7717N, -79 56.93172W
printf("%s\n", $converted->toDM('%P%D°%N %p%d°%n')); // 40°26.7717 -79°56.93172
// convert to degrees minutes seconds without and with format string
printf("%s\n", $converted->toDegreesMinutesSeconds('%P%D:%M:%S, %p%d:%m:%s')); // 40:26:46, -79:56:56
printf("%s\n", $converted->toDMS()); // 40°26′46″N, 79°56′56″W
// convert in the UTM projection (standard format)
printf("%s\n", $converted->toUniversalTransverseMercator()); // 17T 589138 4477813
printf("%s\n", $converted->toUTM()); // 17T 589138 4477813 (alias)
```

[Read more...](http://geotools-php.org/#convert)

Distance
--------

[](#distance)

```
// ...

$coordA   = Geotools::coordinate([48.8234055, 2.3072664]);
$coordB   = Geotools::coordinate([43.296482, 5.36978]);
$distance = Geotools::distance()->setFrom($coordA)->setTo($coordB);

printf("%s\n",$distance->flat()); // 659166.50038742 (meters)
printf("%s\n",$distance->in('km')->haversine()); // 659.02190812846
printf("%s\n",$distance->in('mi')->vincenty()); // 409.05330679648
printf("%s\n",$distance->in('ft')->flat()); // 2162619.7519272
```

[Read more...](http://geotools-php.org/#distance)

Point
-----

[](#point)

```
// ...

$coordA   = Geotools::coordinate([48.8234055, 2.3072664]$);
$coordB   = Geotools::coordinate([43.296482, 5.36978]$);
$point    =  Geotools::point()->setFrom($coordA)->setTo($coordB);

printf("%d\n", $point->initialBearing()); // 157 (degrees)
printf("%s\n", $point->initialCardinal()); // SSE (SouthSouthEast)
printf("%d\n", $point->finalBearing()); // 160 (degrees)
printf("%s\n", $point->finalCardinal()); // SSE (SouthSouthEast)

$middlePoint = $point->middle(); // \League\Geotools\Coordinate\Coordinate
printf("%s\n", $middlePoint->getLatitude()); // 46.070143125815
printf("%s\n", $middlePoint->getLongitude()); // 3.9152401085931

$destinationPoint = Geotools::point()->setFrom($coordA)->destination(180, 200000); // \League\Geotools\Coordinate\Coordinate
printf("%s\n", $destinationPoint->getLatitude()); // 47.026774650075
printf("%s\n", $destinationPoint->getLongitude()); // 2.3072664
```

[Read more...](http://geotools-php.org/#point)

Geohash
-------

[](#geohash)

```
// ...

$coordToGeohash = Geotools::coordinate('43.296482, 5.36978');

// encoding
$encoded = Geotools::geohash()->encode($coordToGeohash, 4); // 12 is the default length / precision
// encoded
printf("%s\n", $encoded->getGeohash()); // spey
// encoded bounding box
$boundingBox = $encoded->getBoundingBox(); // array of \League\Geotools\Coordinate\CoordinateInterface
$southWest   = $boundingBox[0];
$northEast   = $boundingBox[1];
printf("http://www.openstreetmap.org/?minlon=%s&minlat=%s&maxlon=%s&maxlat=%s&box=yes\n",
    $southWest->getLongitude(), $southWest->getLatitude(),
    $northEast->getLongitude(), $northEast->getLatitude()
); // http://www.openstreetmap.org/?minlon=5.2734375&minlat=43.2421875&maxlon=5.625&maxlat=43.41796875&box=yes

// decoding
$decoded = Geotools::geohash()->decode('spey61y');
// decoded coordinate
printf("%s\n", $decoded->getCoordinate()->getLatitude()); // 43.296432495117
printf("%s\n", $decoded->getCoordinate()->getLongitude()); // 5.3702545166016
// decoded bounding box
$boundingBox = $decoded->getBoundingBox(); //array of \League\Geotools\Coordinate\CoordinateInterface
$southWest   = $boundingBox[0];
$northEast   = $boundingBox[1];
printf("http://www.openstreetmap.org/?minlon=%s&minlat=%s&maxlon=%s&maxlat=%s&box=yes\n",
    $southWest->getLongitude(), $southWest->getLatitude(),
    $northEast->getLongitude(), $northEast->getLatitude()
); // http://www.openstreetmap.org/?minlon=5.3695678710938&minlat=43.295745849609&maxlon=5.3709411621094&maxlat=43.297119140625&box=yes
```

[Read more...](http://geotools-php.org/#geohash)

Changelog
---------

[](#changelog)

[See the changelog file](https://github.com/toin0u/Geotools-laravel/blob/master/CHANGELOG.md)

Support
-------

[](#support)

[Please open an issues in github](https://github.com/toin0u/Geotools-laravel/issues)

Contributor Code of Conduct
---------------------------

[](#contributor-code-of-conduct)

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at

License
-------

[](#license)

Geotools-laravel is released under the MIT License. See the bundled [LICENSE](https://github.com/toin0u/Geotools-laravel/blob/master/LICENSE) file for details.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 82.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~142 days

Recently: every ~249 days

Total

8

Last Release

3814d ago

Major Versions

0.2.0 → 1.0.02015-02-23

PHP version history (3 changes)0.1.0PHP &gt;=5.3.0

0.2.0PHP &gt;=5.3.3

1.0.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/50a5986ea3e8bf6ac9e9d564349985eb547a0c86469c220e6872aeb016bb9e96?d=identicon)[adeb6600](/maintainers/adeb6600)

---

Top Contributors

[![toin0u](https://avatars.githubusercontent.com/u/672421?v=4)](https://github.com/toin0u "toin0u (57 commits)")[![iamapj](https://avatars.githubusercontent.com/u/6439790?v=4)](https://github.com/iamapj "iamapj (7 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (3 commits)")[![adeb6600](https://avatars.githubusercontent.com/u/1121388?v=4)](https://github.com/adeb6600 "adeb6600 (1 commits)")[![CWSpear](https://avatars.githubusercontent.com/u/495855?v=4)](https://github.com/CWSpear "CWSpear (1 commits)")

---

Tags

asynclaravelgeocodinggeocodergeoipbatchgeometrydistanceboundsgeotools

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adeb6600-geotools-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/adeb6600-geotools-laravel/health.svg)](https://phpackages.com/packages/adeb6600-geotools-laravel)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.5M30](/packages/league-geotools)[toin0u/geotools-laravel

Geo-related tools PHP library for Laravel 4 &amp; 5

240388.8k1](/packages/toin0u-geotools-laravel)[toin0u/geotools

Geo-related tools PHP 7.3+ library

1.4k1.3k](/packages/toin0u-geotools)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

43140.3k](/packages/harris21-laravel-fuse)[laravie/geotools

Geo-related tools PHP 7+ library

18122.1k1](/packages/laravie-geotools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
