承接 wntechs/php-coord 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wntechs/php-coord

Composer 安装命令:

composer require wntechs/php-coord

包简介

Originally Forked from dvdoug/PHPCoord to add Israeli TM Ref class. PHPCoord is a set of PHP functions for handling various co-ordinate systems and converting between them

README 文档

README

Conversion/modernisation/enhancement of phpcoord.

Build Status Scrutinizer Code Quality Download count Download count

The original code by Jonathan Stott can be found at http://www.jstott.me.uk/phpcoord/

PHPCoord is a set of PHP functions for handling various co-ordinate systems and converting between them. Currently, OSGB (Ordnance Survey of Great Britain) grid references, traditional Irish Grid references, the newer ITM (Irish Transverse Mercator) system, UTM (Universal Transverse Mercator) references and latitude/longitude are supported.

Conversions between latitudes/longitudes in WGS84 (GPS), OSGB36, ED50 and NAD27 datums are built-in, and helper functions exist to ease conversion between other datums.

A function is also provided to find the surface distance between two points of latitude and longitude.

Output of calculations have been changed from the original code in various ways:

  • [BUGFIX] When converting latitude and longitude between WGS84 and OSGB36 or vice-versa, a wrong constant for the y translation has been corrected (was off by 1 metre)
  • [BUGFIX] Corrected issue with Helmert transform where the resulting co-ordinate could be placed into the wrong quadrant
  • [BUGFIX] When calculating surface distances, a more accurate mean radius is now used rather than that derived from historical definitions of a nautical mile
  • [BUGFIX] Corrected calculation of OS 6-figure grid references (rounding instead of truncating meant the grid square was sometimes off by 1)
  • [CHANGE] Eastings and northings are rounded to 1m, and lat/long to 5dp (approx 1m) to avoid any misconceptions that precision is the same thing as accuracy
  • [CHANGE] You must specify the reference ellipsoid when creating a LatLng object to avoid guesses as to what was actually meant. If you don't know what that means, you probably want WGS84 which gives GPS compatibility
  • [CHANGE] Added Irish grid and ITM support
  • [CHANGE] Co-ordinates are now 3D (i.e. w/height), not 2D

Usage

$OSRef = new OSRef(500000, 200000); //Easting, Northing
$LatLng = $OSRef->toLatLng();
$GPSLatLng = $LatLng->toWGS84(); //optional, for GPS compatibility

$lat =  $LatLng->getLat();
$long = $LatLng->getLng();

$LatLng = new LatLng(50.12345, 1.23456, 0, RefEll::wgs84()); //Latitude, Long, height
$OSRef = $LatLng->toOSRef(); 

$easting = $OSRef->getX();
$northing = $OSRef->getY();

Installation

If you use Composer, just add php-coord/php-coord to your project's composer.json file:

    composer require php-coord/php-coord

Otherwise, the library is PSR-4 compliant, so will work with the autoloader of your choice.

Requirements

  • PHP version 7.1 or higher

License

The original PHPcoord is GPL-licensed, and this version inherits that. Terms can be found at http://www.gnu.org/licenses/gpl.html

统计信息

  • 总下载量: 310
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 21
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2019-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固