PHPackages                             meetme/php-geopoint - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. meetme/php-geopoint

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

meetme/php-geopoint
===================

PHP implementation of GeoPoint

1.0(10y ago)142.5k↓39%5[1 PRs](https://github.com/MeetMe/php-geopoint/pulls)MITPHPPHP &gt;=5.3.3

Since Feb 16Pushed 8y ago5 watchersCompare

[ Source](https://github.com/MeetMe/php-geopoint)[ Packagist](https://packagist.org/packages/meetme/php-geopoint)[ Docs](https://github.com/MeetMe/php-geopoint/)[ RSS](/packages/meetme-php-geopoint/feed)WikiDiscussions master Synced 1mo ago

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

Geographic Point
================

[](#geographic-point)

GeoPoint represents a geographic point for PHP including conversion, point-to-point distance, and bounding-box calculations.

Usage
-----

[](#usage)

```
$statueOfLibertyPoint = new GeoPoint(40.689604, -74.04455, GeoPoint::DEGREES);

```

Constructor options
-------------------

[](#constructor-options)

- `latitude` -- Latitude
- `longitude` -- Longitude
- `format` -- The format of the passed-in lat/lon as GeoPoint::DEGREES or GeoPoint::RADIANS

Methods
-------

[](#methods)

- `getLatitude()`: Return the point's latitude per the format of the point (GeoPoint::DEGREES or GeoPoint::RADIANS)
- `getLongitude()`: Return the point's longitude per the format of the point (GeoPoint::DEGREES or GeoPoint::RADIANS)
- `distanceTo(GeoPoint, kmOrMiles)`: Calculate the distance to another `GeoPoint` instance using either GeoPoint::KILOMETERS or GeoPoint::MILES.
- `boundingCoordinates(distance, radius, kmOrMiles)`: Calculates the bounding coordinates of `distance` from the point and returns an array with the SW and NE points of the bounding box . If `radius` is not provided, the radius of the Earth will be used. The distance is calculated in kilometers unless kmOrMiles is set to GeoPoint::MILES.

Static Methods
--------------

[](#static-methods)

- `GeoPoint::degreesToRadians(value)`: Converts `value` in degrees to radians
- `GeoPoint::radiansToDegrees(value)`: Converts `value` in radians to degrees
- `GeoPoint::milesToKilometers(value)`: Converts `value` in miles to kilometers
- `GeoPoint::kilometersToMiles(value)`: Converts `value` in kilometers to miles

Running Tests
-------------

[](#running-tests)

`php composer.phar test`

Credits
=======

[](#credits)

Background
----------

[](#background)

This is inspired by [David Wood's JavaScript port](https://github.com/davidwood/node-geopoint) of the Java code presented in [Finding Points Within a Distance of a Latitude/Longitude Using Bounding Coordinates](http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates) by [Jan Philip Matuschek](http://janmatuschek.de/Contact).

Authors/Contributors
--------------------

[](#authorscontributors)

- Will Fitch ()
- Jonah H. Harris ()

License
-------

[](#license)

```
The MIT License

Copyright (c) 2016 MeetMe, Inc. http://www.meetmecorp.com/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72b4b9168ceab957d09aa4e1423f810cf613c9e6381adfee60e4c1ed7b25750d?d=identicon)[willfitch](/maintainers/willfitch)

---

Tags

latitudelongitudedistancegeopoint

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/meetme-php-geopoint/health.svg)

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

###  Alternatives

[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)[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)[laravie/geotools

Geo-related tools PHP 7+ library

19105.4k1](/packages/laravie-geotools)[ballen/distical

A distance (Lat/Long) calculation library for PHP

40180.2k2](/packages/ballen-distical)[data-values/geo

Geographical value objects, parsers and formatters

20631.0k18](/packages/data-values-geo)[adlino/locations

Iran Provinces, Counties and Cities with a Google Map Location for Laravel.

171.3k](/packages/adlino-locations)

PHPackages © 2026

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