PHPackages                             kmlaravel/laravel-geographical-calculator - 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. kmlaravel/laravel-geographical-calculator

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

kmlaravel/laravel-geographical-calculator
=========================================

laravel package help you to implement geographical calculation, with With several algorithms that help you deal with coordinates

v2.2.0(4y ago)42677.2k—8.1%33[6 issues](https://github.com/karam-mustafa/laravel-geographical-calculator/issues)2MITPHP

Since Nov 20Pushed 2y ago7 watchersCompare

[ Source](https://github.com/karam-mustafa/laravel-geographical-calculator)[ Packagist](https://packagist.org/packages/kmlaravel/laravel-geographical-calculator)[ RSS](/packages/kmlaravel-laravel-geographical-calculator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (24)Used By (2)

[![logo](assets/logo.png)](assets/logo.png)

Geographical Calculator
-----------------------

[](#geographical-calculator)

[![License](https://camo.githubusercontent.com/009c9295e448042da01f8c8298089e4911401dd6cbe80e809050d3e2d45b4a80/68747470733a2f2f706f7365722e707567782e6f72672f6b6d6c61726176656c2f617069732d67656e657261746f722f6c6963656e7365)](//packagist.org/packages/kmlaravel/laravel-geographical-calculator)[![PHP Composer](https://github.com/karam-mustafa/laravel-geographical-calculator/actions/workflows/php.yml/badge.svg)](https://github.com/karam-mustafa/laravel-geographical-calculator/actions/workflows/php.yml)[![Check & fix styling](https://github.com/karam-mustafa/laravel-geographical-calculator/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/karam-mustafa/laravel-geographical-calculator/actions/workflows/php-cs-fixer.yml)[![Run tests](https://github.com/karam-mustafa/laravel-geographical-calculator/actions/workflows/tests.yml/badge.svg)](https://github.com/karam-mustafa/laravel-geographical-calculator/actions/workflows/tests.yml)[![Code Quality](https://camo.githubusercontent.com/41629590f47c96f7ca332f7670729a52792cb03379e9bbf397cf9390bb6b70eb/68747470733a2f2f6170692e636f646967612e696f2f70726f6a6563742f33303432392f73636f72652f737667)](https://api.codiga.io/project/30429/score/svg)

Geographical Calculator was developed for laravel 5.8+ to help you to implement geographical calculation, with With several algorithms that help you deal with coordinates.

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

[](#installation)

##### 1 - Dependency

[](#1---dependency)

The first step is using composer to install the package and automatically update your composer.json file, you can do this by running:

```
composer require kmlaravel/laravel-geographical-calculator
```

##### 2 - Copy the package providers to your local config with the publish command, this will publish the config:

[](#2---copy-the-package-providers-to-your-local-config-with-the-publish-command-this-will-publish-the-config)

```
php artisan geo:install
```

Features
--------

[](#features)

- [Get the distance between one or more of points](https://github.com/karam-mustafa/laravel-geographical-calculator/blob/main/docs/distances.md#basic-usage)
- [Get the center between set of points](https://github.com/karam-mustafa/laravel-geographical-calculator/blob/main/docs/areas.md#get-the-center-for-a-given-coordinates)
- [Get the closest point to the specific point](https://github.com/karam-mustafa/laravel-geographical-calculator/blob/main/docs/ordering.md#get-closest-point)
- [Get the farthest point to the specific point](https://github.com/karam-mustafa/laravel-geographical-calculator/blob/main/docs/ordering.md#get-farthest-point)
- [Check if a given point located in a given area](https://github.com/karam-mustafa/laravel-geographical-calculator/blob/main/docs/areas.md#check-if-a-given-point-located-in-a-given-area)
- [Get a ranking of points by the nearest neighbor algorithm](https://github.com/karam-mustafa/laravel-geographical-calculator/blob/main/docs/ordering.md#get-ordering-points-by-nearest-neighbor-algorithm)
- [Get all package features](https://github.com/karam-mustafa/laravel-geographical-calculator/blob/main/docs/all.md#all-features-in-one-function)

config options
--------------

[](#config-options)

> ## add your custom units,keys ..etc.
>
> [](#add-your-custom-unitskeys-etc)

```
    /*
    |--------------------------------------------------------------------------
    | units values
    |--------------------------------------------------------------------------
    | your custom units, the initial units its convert from a mile to any value
    | (1.609344) is the conversion factor from a mile to a kilometer
    */
    'units' => [
        'mile' => 1,
        'km' => 1.609344,
        'm' => (1.609344 * 1000),
        'cm' => (1.609344 * 100),
        'mm' => (1.609344 * 1000 * 1000),
    ],

    /*
    |--------------------------------------------------------------------------
    | distance_key_prefix
    |--------------------------------------------------------------------------
    | if you declared more than tow points to resolve their distance,
    | you will see the result in the following format:
    | "1-2" => ["km" => "some result"],
    | "2-3" => ["km" => "some result"],
    | "3-4" => ["km" => "some result"],
    | and if you want to set any prefix before each index
    | you must change the below value to any value you want.
    |
    */
    'distance_key_prefix' => '',
```

Changelog
---------

[](#changelog)

Please see the [CHANGELOG](https://github.com/kmlaravel/laravel-geographical-calculator/blob/master/CHANGELOG.md) for more information about what has changed or updated or added recently.

Security
--------

[](#security)

If you discover any security related issues, please email them first to , if we do not fix it within a short period of time please open a new issue describing your problem.

Credits
-------

[](#credits)

[karam mustafa](https://www.linkedin.com/in/karam2mustafa)

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 99% 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 ~34 days

Recently: every ~11 days

Total

14

Last Release

1560d ago

Major Versions

v1.1.0 → v2.0.02021-12-15

### Community

Maintainers

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

---

Top Contributors

[![karam-mustafa](https://avatars.githubusercontent.com/u/71431942?v=4)](https://github.com/karam-mustafa "karam-mustafa (208 commits)")[![iambateman](https://avatars.githubusercontent.com/u/1709997?v=4)](https://github.com/iambateman "iambateman (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

geocodergeocoder-librarygeocodinggeogrageographical-calculatorgeolocationgeometrylaravellaravel-geolocationlaravel-packagepackagephp-geocoder

### Embed Badge

![Health badge](/badges/kmlaravel-laravel-geographical-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/kmlaravel-laravel-geographical-calculator/health.svg)](https://phpackages.com/packages/kmlaravel-laravel-geographical-calculator)
```

###  Alternatives

[rich-davis1/phpw2v

A PHP implementation of Word2Vec, a popular word embedding algorithm created by Tomas Mikolov and popularized by Radim Řehůřek &amp; Peter Sojka with the Gensim Python library.

481.2k](/packages/rich-davis1-phpw2v)[syrian-open-source/laravel-youtube-iframe-generator

Laravel package allows you to generate an iframe tag with a video player depending on a youtube URL.

184.2k](/packages/syrian-open-source-laravel-youtube-iframe-generator)

PHPackages © 2026

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