itinance/tinygeo 问题修复 & 功能扩展

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

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

itinance/tinygeo

最新稳定版本:v0.2

Composer 安装命令:

composer require itinance/tinygeo

包简介

README 文档

README

Provides classes for geographic calculations and related data structures.

Installation using composer:

    "repositories": [
        {
            "type": "git",
            "url": "git@github.com:itinance/tinygeo.git"
        }
    ],
    "require": {
        "itinance/tinygeo": "dev-master"
    },

Usage examples:

$p1 = new GeoPoint("48°07'31.5''", "011°32'23''");
echo $p1->lat . ', ' . $p1->lng;
$p1 = new GeoPoint(48.346611, 11.578393);
echo $p1->getStringAsDegreeMinuteSecond()
$d = new GeoDegree(16, 19, 28.29);
$this->assertEquals(16.324525, $d->toDecimals());
$d = GeoDegree::fromString("48°08'10''");
$this->assertEquals( 48, $d->degrees );
$this->assertEquals( 8, $d->minutes );
$this->assertEquals( 10, $d->seconds);
$p1 = new GeoPoint(48.135993, 11.539721);
$destination = GeoCalculation::movePointUpwards($p1, 1.200);
$center = new GeoPoint(48.135993, 11.539721);

$box = GeoCalculation::getBoundingBox($center, 0.7); // 700m
$this->assertEquals( new GeoPoint( 48.1404443, 11.54637187 ),  $box->getNorthEast(), '', 0.001 );
$this->assertEquals( new GeoPoint( 48.1404443, 11.53307013 ),  $box->getNorthWest(), '', 0.001 );
$this->assertEquals( new GeoPoint( 48.13154, 11.53307013 ),  $box->getSouthWest(), '', 0.001 );
$this->assertEquals( new GeoPoint( 48.13154, 11.54637187 ),  $box->getSouthEast(), '', 0.001 );

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-09-13