luoyy/spatial 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

luoyy/spatial

Composer 安装命令:

composer require luoyy/spatial

包简介

php coordinate calculation component

README 文档

README

安装包

composer require luoyy/spatial

Quick Sample Usage

/**
 * DEMO
 */
use luoyy\Spatial\Spatial;
use luoyy\Spatial\Support\LineString;
use luoyy\Spatial\Support\PointWGS84; // WGS84
use luoyy\Spatial\Support\Polygon;
use luoyy\Spatial\Transform;
use luoyy\Spatial\Enums\CoordinateSystemEnum;

var_dump(Transform::transform(new PointWGS84([180, 90]), CoordinateSystemEnum::GCJ02));
var_dump((new PointWGS84([180, 90]))->transform(CoordinateSystemEnum::GCJ02));
var_dump(Spatial::ringArea(new Polygon([[new PointWGS84([116.169465, 39.932670]), new PointWGS84([116.160260, 39.924492]), new PointWGS84([116.150625, 39.710019]), new PointWGS84([116.183198, 39.709920]), new PointWGS84([116.226950, 39.777616]), new PointWGS84([116.442621, 39.799892]), new PointWGS84([116.463478, 39.790066]), new PointWGS84([116.588276, 39.809551]), new PointWGS84([116.536091, 39.808859]), new PointWGS84([116.573856, 39.839643]), new PointWGS84([116.706380, 39.916740]), new PointWGS84([116.600293, 39.937770]), new PointWGS84([116.514805, 39.982375]), new PointWGS84([116.499935, 40.013710]), new PointWGS84([116.546520, 40.030443]), new PointWGS84([116.687668, 40.129961]), new PointWGS84([116.539697, 40.080659]), new PointWGS84([116.503390, 40.058474]), new PointWGS84([116.468800, 40.052578]), new PointWGS84([116.169465, 39.932670])]])));
var_dump(Spatial::distance(new PointWGS84([116.169465, 39.932670]), new PointWGS84([116.160260, 39.924492])));
var_dump(Spatial::lineDistance(new LineString([new PointWGS84([116.169465, 39.932670]), new PointWGS84([116.160260, 39.924492]), new PointWGS84([116.150625, 39.710019]), new PointWGS84([116.183198, 39.709920]), new PointWGS84([116.226950, 39.777616]), new PointWGS84([116.442621, 39.799892]), new PointWGS84([116.463478, 39.790066]), new PointWGS84([116.588276, 39.809551]), new PointWGS84([116.536091, 39.808859]), new PointWGS84([116.573856, 39.839643]), new PointWGS84([116.706380, 39.916740]), new PointWGS84([116.600293, 39.937770]), new PointWGS84([116.514805, 39.982375]), new PointWGS84([116.499935, 40.013710]), new PointWGS84([116.546520, 40.030443]), new PointWGS84([116.687668, 40.129961]), new PointWGS84([116.539697, 40.080659]), new PointWGS84([116.503390, 40.058474]), new PointWGS84([116.468800, 40.052578])])));

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-08-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固