PHP地理位置计算库:PHP Geo

jopen 11年前

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)

项目主页:http://www.open-open.com/lib/view/home/1388455326516