PHPackages                             alexperegrina/geotools - 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. alexperegrina/geotools

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

alexperegrina/geotools
======================

Geo-related tools PHP 7.3+ library

0.8.3(4y ago)0111MITPHPPHP ^7.3 || ^7.4 || ^8.0

Since Feb 6Pushed 4y agoCompare

[ Source](https://github.com/alexperegrina/geotools)[ Packagist](https://packagist.org/packages/alexperegrina/geotools)[ RSS](/packages/alexperegrina-geotools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (33)Used By (1)

Geotools
========

[](#geotools)

fork:

**Geotools** is a PHP geo-related library, built atop [Geocoder](https://github.com/willdurand/Geocoder) and [React](https://github.com/reactphp/react) libraries.

[![Build Status](https://camo.githubusercontent.com/e1e87b6803da2c958edb3b5446c1456383c93de8756dde5196b96d69c6ff7971/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f67656f746f6f6c732f6d61737465722e737667)](https://travis-ci.org/thephpleague/geotools)[![Latest Version](https://camo.githubusercontent.com/ab5f99fcf0a9f8360b790d9d71e9c72b302294c32d1ea651993458fa432eb5e4/68747470733a2f2f706f7365722e707567782e6f72672f6c65616775652f67656f746f6f6c732f762f737461626c65)](https://github.com/thephpleague/geotools/releases)[![Total Downloads](https://camo.githubusercontent.com/3d8f849d3df584cd0f154526adbff1a27e8be11521661a57d25fa3a9b9fe28d5/68747470733a2f2f706f7365722e707567782e6f72672f6c65616775652f67656f746f6f6c732f646f776e6c6f616473)](https://packagist.org/packages/league/geotools)[![Quality Score](https://camo.githubusercontent.com/6a11a3817a2d903c51bdf5d263e28d19edc62bdbb13d63ebb5baafb4505779f0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f67656f746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/geotools/?branch=master)[![SensioLabs Insight](https://camo.githubusercontent.com/93ab1667c4d06c94c4ae59b695f72f90c60e5a52ddfd561ecc93785c2b232902/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f37643262343438662d623232332d346462392d396661622d3936636465646564663033642e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/7d2b448f-b223-4db9-9fab-96cdededf03d)[![PHP7 Ready](https://camo.githubusercontent.com/1bdeb491d2b30d89ec425c42b74dba8d14431e7355c551cb5a573b46f4e0bf35/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850372d72656164792d677265656e2e737667)](https://packagist.org/packages/league/geotools)

Features
--------

[](#features)

- **Batch** geocode &amp; reverse geocoding request(s) in **series** / in **parallel** against one or a **set of providers**. [»](#batch)
- **Cache** geocode &amp; reverse geocoding result(s) with **PSR-6** to improve performances. [»](#batch)
- Compute geocode &amp; reverse geocoding in the **command-line interface** (CLI) + dumpers and formatters. [»](#cli)
- Accept **almost** all kind of WGS84 [geographic coordinates](http://en.wikipedia.org/wiki/Geographic_coordinate_conversion) as coordinates. [»](#coordinate--ellipsoid)
- Support **23 different ellipsoids** and it's easy to provide a new one if needed. [»](#coordinate--ellipsoid)
- **Convert** and **format** decimal degrees coordinates to decimal minutes or degrees minutes seconds coordinates. [»](#convert)
- **Convert** decimal degrees coordinates in the [Universal Transverse Mercator](http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system)(UTM) projection. [»](#convert)
- Compute the distance in **meter** (by default), **km**, **mi** or **ft** between two coordinates using **flat**, **great circle**, **haversine** or **vincenty** algorithms. [»](#distance)
- Compute the initial and final **bearing** from the origin coordinate to the destination coordinate in degrees. [»](#point)
- Compute the initial and final **cardinal point** (direction) from the origin coordinate to the destination coordinate, read more in [wikipedia](http://en.wikipedia.org/wiki/Cardinal_direction). [»](#point)
- Compute the **half-way point** (coordinate) between the origin and the destination coordinates. [»](#point)
- Compute the **destination point** (coordinate) with given bearing in degrees and a distance in meters. [»](#point)
- Encode a coordinate to a **geo hash** string and decode it to a coordinate, read more in [wikipedia](http://en.wikipedia.org/wiki/Geohash) and on [geohash.org](http://geohash.org/). [»](#geohash)
- Encode a coordinate via the 10:10 algorithm. [»](#1010)
- **Polygon** class provides methods to check either a poing (coordinate) is in, or on the polygon's boundaries. [»](#polygon)
- A **command-line interface** (CLI) for **Distance**, **Point**, **Geohash** and **Convert** classes. [»](#cli)
- Integration with Frameworks: **Laravel 4**, **Silex** ... [»](#integration-with-frameworks)
- ... more to come ...

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

[](#installation)

**Geotools** can be found on [Packagist](https://packagist.org/packages/league/geotools). The recommended way to install **Geotools** is through [composer](http://getcomposer.org).

Run the following on the command line:

```
php composer require league/geotools=@stable

```

**Protip:** you should browse the [`league/geotools`](https://packagist.org/packages/league/geotools)page to choose a stable version to use, avoid the `@stable` meta constraint.

**Important:** you should use the `0.4` version if you use Geocoder `2.x` or/and PHP `5.3`.

And install dependencies:

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

Now you can add the autoloader, and you will have access to the library:

```
