PHPackages                             webworker01/geo-location - 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. webworker01/geo-location

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

webworker01/geo-location
========================

Retrieve bounding coordinates, distances, longitude and latitude with GeoLocation.class.php

v1.1.2(7y ago)01.9kMITPHPPHP &gt;=5.3.0

Since Oct 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/webworker01/GeoLocation.php)[ Packagist](https://packagist.org/packages/webworker01/geo-location)[ Docs](https://github.com/webworker01/GeoLocation.php)[ RSS](/packages/webworker01-geo-location/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (4)Used By (0)

GeoLocation
===========

[](#geolocation)

Retrieve bounding coordinates and distances with GeoLocation. You can also calculate and measure the distance between geopoints with this php class.

This is a PHP port of Java code that was originally published at [](http://JanMatuschek.de/LatitudeLongitudeBoundingCoordinates). A few modifications were made and an additional helper method to retrieve latitude and longitude from an address has been provided using Google's Geocoding API.

License:

Examples
========

[](#examples)

Get distance between two points:
--------------------------------

[](#get-distance-between-two-points)

	```

		use AnthonyMartin\GeoLocation\GeoLocation as GeoLocation;

		// Set locations
		$edison_nj = GeoLocation::fromDegrees(40.5187154, -74.4120953);
		$brooklyn_ny = GeoLocation::fromDegrees(40.65, -73.95);

		echo "Distance from Edison, NJ to Brookyln, NY: " .
			$edison_nj->distanceTo($brooklyn_ny, 'miles') . " miles \n";

		# Distance from Edison, NJ to Brookyln, NY: 25.888611494606 miles

		echo "Distance from Edison, NJ to Brooklyn, NY: " .
			$edison_nj->distanceTo($brooklyn_ny, 'kilometers') . " kilometers \n";

		# Distance from Edison, NJ to Brooklyn, NY: 41.663681581973 kilometers

```

Get bounding coordinates
------------------------

[](#get-bounding-coordinates)

	```

		use AnthonyMartin\GeoLocation\GeoLocation as GeoLocation;

		$edison = GeoLocation::fromDegrees(40.5187154, -74.4120953);
		$coordinates = $edison->boundingCoordinates(3, 'miles');

		echo "min latitude: " . $coordinates[0]->getLatitudeInDegrees() . " \n";
		echo "min longitude: " . $coordinates[0]->getLongitudeInDegrees() . " \n";

		echo "max latitude: " . $coordinates[1]->getLatitudeInDegrees() . " \n";
		echo "max longitude: " . $coordinates[1]->getLongitudeInDegrees() . " \n";

		/**
		*	Returns:
		*	min latitude: 40.47529593323
		*	min longitude: -74.469211617725
		*	max latitude: 40.56213486677
		*	max longitude: -74.354978982275
		**/

```

Get latitude and longitude from address or location
---------------------------------------------------

[](#get-latitude-and-longitude-from-address-or-location)

	```

	use AnthonyMartin\GeoLocation\GeoLocation as GeoLocation;

	$location = 'New York City';
	$response = GeoLocation::getGeocodeFromGoogle($location);
	$latitude = $response->results[0]->geometry->location->lat;
	$longitude = $response->results[0]->geometry->location->lng;
	echo $latitude . ', ' . $longitude;
	# 40.7143528, -74.0059731

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~1002 days

Total

3

Last Release

2631d ago

### Community

Maintainers

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

---

Top Contributors

[![anthonymartin](https://avatars.githubusercontent.com/u/949506?v=4)](https://github.com/anthonymartin "anthonymartin (24 commits)")[![demerzel3](https://avatars.githubusercontent.com/u/442835?v=4)](https://github.com/demerzel3 "demerzel3 (2 commits)")[![pfuhrmann](https://avatars.githubusercontent.com/u/1627445?v=4)](https://github.com/pfuhrmann "pfuhrmann (2 commits)")[![webworker01](https://avatars.githubusercontent.com/u/3256000?v=4)](https://github.com/webworker01 "webworker01 (2 commits)")

---

Tags

geocodinggeolocationbounding coordinatesdistances

### Embed Badge

![Health badge](/badges/webworker01-geo-location/health.svg)

```
[![Health](https://phpackages.com/badges/webworker01-geo-location/health.svg)](https://phpackages.com/packages/webworker01-geo-location)
```

###  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

1961.0M11](/packages/anthonymartin-geo-location)[torann/geoip

Support for multiple Geographical Location services.

2.2k15.3M98](/packages/torann-geoip)[toin0u/geocoder-laravel

Geocoder Service Provider for Laravel

7615.4M17](/packages/toin0u-geocoder-laravel)[willdurand/geocoder

Common files for PHP Geocoder

17437.9M170](/packages/willdurand-geocoder)[zoujingli/ip2region

ip2region v3.0 for PHP - 企业级 IP 地理位置查询库，支持 IPv4 和 IPv6，多种缓存策略，零依赖，开箱即用

1.4k475.0k67](/packages/zoujingli-ip2region)[ip2location/ip2location-php

\[Official Release\] IP2Location PHP API to get location info from IPv4 and IPv6 address.

2244.2M37](/packages/ip2location-ip2location-php)

PHPackages © 2026

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