PHP Geo PHP 地理位置计算库

phpgeo 是一个用于计算地理坐标之间高精度距离。

示例代码:

<?php

use Location\\Coordinate;
use Location\\Distance\\Vincenty;

$coordinate1 = new Coordinate(19.820664, -155.468066); // Mauna Kea Summit
$coordinate2 = new Coordinate(20.709722, -156.253333); // Haleakala Summit

$calculator = new Vincenty();

echo $calculator->getDistance($coordinate1, $coordinate2); // returns 128130.850 (meters; ≈128 kilometers)

© 版权声明
THE END
喜欢就支持一下吧
点赞661 分享
Many people start a career with a dream, then get busy forgetting it.
很多人一开始为了梦想而忙,后来忙得忘了梦想