PHPackages                             wntechs/php-coord - 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. wntechs/php-coord

ActiveLibrary

wntechs/php-coord
=================

Originally Forked from dvdoug/PHPCoord to add Israeli TM Ref class. PHPCoord is a set of PHP functions for handling various co-ordinate systems and converting between them

v3.1.0(6y ago)1309GPL-2.0-or-laterPHPPHP ^7.1

Since Feb 13Pushed 6y agoCompare

[ Source](https://github.com/wntechs/PHPCoord)[ Packagist](https://packagist.org/packages/wntechs/php-coord)[ Docs](https://github.com/dvdoug/PHPCoord)[ RSS](/packages/wntechs-php-coord/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (16)Used By (0)

PHPCoord
========

[](#phpcoord)

Conversion/modernisation/enhancement of phpcoord.

[![Build Status](https://camo.githubusercontent.com/05cdafdb4db0154c0dec8d007822c8f810406a999ade394f7391311ff8168189/68747470733a2f2f7472617669732d63692e6f72672f6476646f75672f504850436f6f72642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dvdoug/PHPCoord)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e03e004453230ff135591a1b61a3965368a153972e2facb35dc00f8ace916c6c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6476646f75672f504850436f6f72642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dvdoug/PHPCoord/?branch=master)[![Download count](https://camo.githubusercontent.com/a744f5a5a6db4370999b3c2e2d127815ce7a6e50437010e5a6bb4c77e1c2a217/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d636f6f72642f7068702d636f6f72642e737667)](https://packagist.org/packages/php-coord/php-coord)[![Download count](https://camo.githubusercontent.com/fe7c732e7589dc25ca981e15eeb467e48d2108a93152f5561492c8854e6410f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068702d636f6f72642f7068702d636f6f72642e737667)](https://packagist.org/packages/php-coord/php-coord)

The original code by Jonathan Stott can be found at

PHPCoord is a set of PHP functions for handling various co-ordinate systems and converting between them. Currently, OSGB (Ordnance Survey of Great Britain) grid references, traditional Irish Grid references, the newer ITM (Irish Transverse Mercator) system, UTM (Universal Transverse Mercator) references and latitude/longitude are supported.

Conversions between latitudes/longitudes in WGS84 (GPS), OSGB36, ED50 and NAD27 datums are built-in, and helper functions exist to ease conversion between other datums.

A function is also provided to find the surface distance between two points of latitude and longitude.

Output of calculations have been changed from the original code in various ways:

- \[BUGFIX\] When converting latitude and longitude between WGS84 and OSGB36 or vice-versa, a wrong constant for the y translation has been corrected (was off by 1 metre)
- \[BUGFIX\] Corrected issue with Helmert transform where the resulting co-ordinate could be placed into the wrong quadrant
- \[BUGFIX\] When calculating surface distances, a more accurate mean radius is now used rather than that derived from historical definitions of a nautical mile
- \[BUGFIX\] Corrected calculation of OS 6-figure grid references (rounding instead of truncating meant the grid square was sometimes off by 1)
- \[CHANGE\] Eastings and northings are rounded to 1m, and lat/long to 5dp (approx 1m) to avoid any misconceptions that precision is the same thing as accuracy
- \[CHANGE\] You must specify the reference ellipsoid when creating a LatLng object to avoid guesses as to what was actually meant. If you don't know what that means, you probably want WGS84 which gives GPS compatibility
- \[CHANGE\] Added Irish grid and ITM support
- \[CHANGE\] Co-ordinates are now 3D (i.e. w/height), not 2D

Usage
-----

[](#usage)

```
$OSRef = new OSRef(500000, 200000); //Easting, Northing
$LatLng = $OSRef->toLatLng();
$GPSLatLng = $LatLng->toWGS84(); //optional, for GPS compatibility

$lat =  $LatLng->getLat();
$long = $LatLng->getLng();

$LatLng = new LatLng(50.12345, 1.23456, 0, RefEll::wgs84()); //Latitude, Long, height
$OSRef = $LatLng->toOSRef();

$easting = $OSRef->getX();
$northing = $OSRef->getY();
```

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

[](#installation)

If you use [Composer](http://getcomposer.org/), just add `php-coord/php-coord` to your project's `composer.json` file:

```
    composer require php-coord/php-coord

```

Otherwise, the library is PSR-4 compliant, so will work with the autoloader of your choice.

Requirements
------------

[](#requirements)

- PHP version 7.1 or higher

License
-------

[](#license)

The original PHPcoord is GPL-licensed, and this version inherits that. Terms can be found at

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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 ~234 days

Recently: every ~316 days

Total

11

Last Release

2490d ago

Major Versions

1.1.2 → 2.02016-01-03

2.1 → v3.0.02019-04-13

PHP version history (2 changes)1.0PHP &gt;=5.3.0

v3.0.0PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/bab6cad34f36ce70cdb5ca1a8664f5f208a6fa33caf0915d5f5c97c0c03057cb?d=identicon)[wntechs](/maintainers/wntechs)

---

Top Contributors

[![dvdoug](https://avatars.githubusercontent.com/u/1571110?v=4)](https://github.com/dvdoug "dvdoug (144 commits)")[![teeedwards](https://avatars.githubusercontent.com/u/117519304?v=4)](https://github.com/teeedwards "teeedwards (4 commits)")[![wntechs](https://avatars.githubusercontent.com/u/4102840?v=4)](https://github.com/wntechs "wntechs (2 commits)")[![caffme](https://avatars.githubusercontent.com/u/3276090?v=4)](https://github.com/caffme "caffme (1 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (1 commits)")[![stevegoddard](https://avatars.githubusercontent.com/u/16681762?v=4)](https://github.com/stevegoddard "stevegoddard (1 commits)")

---

Tags

geolatitudelongitudegpsUTMcoordwgs84grid refosgb36itm

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/wntechs-php-coord/health.svg)

```
[![Health](https://phpackages.com/badges/wntechs-php-coord/health.svg)](https://phpackages.com/packages/wntechs-php-coord)
```

###  Alternatives

[php-coord/php-coord

PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points.

110914.5k12](/packages/php-coord-php-coord)[mjaschen/phpgeo

Simple Yet Powerful Geo Library

1.6k8.6M22](/packages/mjaschen-phpgeo)[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[anthonymartin/geo-location

Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP

196949.5k5](/packages/anthonymartin-geo-location)[malhal/laravel-geographical

Easily add longitude and latitude columns to your records and use inherited functionality for calculating distances

283375.6k](/packages/malhal-laravel-geographical)[data-values/geo

Geographical value objects, parsers and formatters

20631.0k18](/packages/data-values-geo)

PHPackages © 2026

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