sodecl / coordinates
在UTM和经纬度之间转换坐标
0.4
2020-10-07 22:16 UTC
Requires (Dev)
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-09-08 06:28:09 UTC
README
coordinates
// 将UTM转换为LatLong及其相反。
安装
composer require sodecl/coordinates
用法
<?php require_once 'vendor/autoload.php'; use sodecl\Coordinates\UtmCoordinate; use sodecl\Coordinates\LatLngCoordinate; $x = 723536.02; $y = 5738948.51; $utm = new UtmCoordinate($x,$y); echo $utm->toLatLng(18,false).PHP_EOL; $lat =-38.469999579845 ; $long = -72.438489495502; $latlng = new LatLngCoordinate($lat,$long); echo $latlng->toUtm().PHP_EOL; ?>