laravel package help you to implement geographical calculation, with several algorithms that help you deal with coordinates and distances.

Overview

logo

Geographical Calculator

License Build Status Code Intelligence Status Code Quality

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

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:
php artisan geo:install

Features

config options

add your custom units,keys ..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

Please see the CHANGELOG for more information about what has changed or updated or added recently.

Security

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

Credits

karam mustafa

You might also like...
this package can help you to test race condition in Laravel Feature Test
this package can help you to test race condition in Laravel Feature Test

Laravel Async Testing this package can help you to test race condition in Laravel Feature Test Requirements Laravel versions 5.7, 6.x, 7.x and 8.x PHP

a Laravel package help you to execute more effective databases queries.
a Laravel package help you to execute more effective databases queries.

Laravel Query Helper Laravel Query Helper was developed for laravel 7.2+ to help you optimizing sql queries, this package will contain all advanced sq

This package aims to help you standardize all your API responses in a simple and structured way.

Laravel API Response This package aims to help you standardize all your API responses in a simple and structured way. By default, the stucture of the

Relational Metrics - lararvel package help you to make your metrics easier
Relational Metrics - lararvel package help you to make your metrics easier

Relational Metrics This package will help you to make your metrics easier, You could get metrics about your Models, Models depending on their relation

You already have your dream house? Sam Building will help you find the perfect home.
You already have your dream house? Sam Building will help you find the perfect home.

SAM BUILDING Setup Fork or clone this repo! git clone github.com/Igorballo/Real-Estate-App.git Installation des dépendances npm install #or yarn insta

Electrik is a full-featured, open-source, starter-kit to help you build you your SaaS application.
Electrik is a full-featured, open-source, starter-kit to help you build you your SaaS application.

Electrik Electrik is a full-featured and open-source stater-kit for for your next SaaS application. It's built on top of Laravel, Livewire, neerajsoha

PHP package to help the development of Laravel-based Telegram bots
PHP package to help the development of Laravel-based Telegram bots

Laravel-telegram-bot Project description goes here. This description is usually two to three lines long. It should give an overview of what the projec

Laravel Livewire package for clone screen with the help of websocket

screen-wire This is a Laravel Livewire package. It allow you to see what users are doing on their screen. Installation composer require mrbohem/scree

A Laravel package to help track user onboarding steps.
A Laravel package to help track user onboarding steps.

Onboard A Laravel package to help track user onboarding steps. Installation: Install the package via composer composer require calebporzio/onboard Reg

Comments
  • problem with  functionGet ordering points by nearest neighbor algorithm

    problem with functionGet ordering points by nearest neighbor algorithm

    The algorithm returns the ranking of 85 sorted points the first time (this will decrease to 82), the second time it returns the ranking of 2 points but the total points is 82, this function is used inside a while loop, and I'm using clearResult() as the documentation says

    good first issue 
    opened by ricardsos 1
  • v2.2.0

    v2.2.0

    • [ ] Improved traits design.
    • [ ] Added check if the point is located in a given area.
    • [x] Added the farthest point from a set of points to a custom point.
    • [ ] Added Features to eloquent model scope.
    feature 
    opened by karam-mustafa 0
  • V2.1.0

    V2.1.0

    • [X] Added all function to get all package features.
    • [X] Added Loops trait helper.
    • [X] Improved getDistance and getCenter function to accept callback.
    • [x] Added nearest neighbor algorithm.
    • [x] Added the closest point from a set of points to a custom point.
    • [x] Improved tests and code style
    feature 
    opened by karam-mustafa 0
Releases(v2.2.0)
Owner
karam mustafa
Full Stack Web Developer, I work on large and small projects and love creating packages, and all about open source.
karam mustafa
Determine the geographical location of website visitors based on their IP addresses.

GeoIP for Laravel Determine the geographical location and currency of website visitors based on their IP addresses. GeoIP for Laravel on Packagist Geo

Daniel Stainback 1.9k Jan 6, 2023
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

PHPAlgorithms A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDow

Doğan Can Uçar 921 Dec 18, 2022
Vandar Cashier is a Laravel package that allows you to seamlessly implement IPG and Direct Debit on your application

Vandar Cashier is a Laravel package that provides you with a seamless integration with Vandar services. Take a look at Vandar Documentation for more i

Vandar 11 Dec 14, 2022
A package to implement repository pattern for laravel models

Laravel Model UUID A simple package to use Repository Pattern approach for laravel models . Repository pattern Repositories are classes or components

null 26 Dec 21, 2022
Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework.

Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework. This rep

LaraBug 197 Dec 9, 2022
A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

Vikas Ukani 3 Jan 6, 2022
Laminas\Console is a component to design and implement console applications in PHP.

laminas-console This package is abandoned and will receive no further development! We recommend using laminas/laminas-cli. Laminas\Console is a compon

Laminas Project 10 Nov 27, 2021
Cascading deletes for Eloquent models that implement soft deletes

Cascading soft deletes for the Laravel PHP Framework Introduction In scenarios when you delete a parent record - say for example a blog post - you may

Michael Dyrynda 767 Jan 6, 2023
Testbench Component is the de-facto package that has been designed to help you write tests for your Laravel package

Laravel Testing Helper for Packages Development Testbench Component is the de-facto package that has been designed to help you write tests for your La

Orchestra Platform 1.9k Dec 29, 2022
This package should help you with creating and managing a Laravel DDD Application

This package should help you with creating and managing a Laravel DDD Application. This package is heavily inspired by "Laravel beyond CRUD" from Spatie.

J. Regner 158 Dec 25, 2022