kmlaravel/laravel-geographical-calculator
Composer 安装命令:
composer require kmlaravel/laravel-geographical-calculator
包简介
laravel package help you to implement geographical calculation, with With several algorithms that help you deal with coordinates
README 文档
README
Geographical Calculator
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
- Get the distance between one or more of points
- Get the center between set of points
- Get the closest point to the specific point
- Get the farthest point to the specific point
- Check if a given point located in a given area
- Get a ranking of points by the nearest neighbor algorithm
- Get all package 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 karam2mustafa@gmail.com, if we do not fix it within a short period of time please open a new issue describing your problem.
Credits
kmlaravel/laravel-geographical-calculator 适用场景与选型建议
kmlaravel/laravel-geographical-calculator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 83.11k 次下载、GitHub Stars 达 426, 最近一次更新时间为 2020 年 11 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kmlaravel/laravel-geographical-calculator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kmlaravel/laravel-geographical-calculator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 83.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 427
- 点击次数: 27
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-20
