2017 © Pedro Peláez
 

library tinygeo

image

itinance/tinygeo

  • Tuesday, September 23, 2014
  • by itinance
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

tinygeo

Provides classes for geographic calculations and related data structures., (*1)

Installation using composer:, (*2)

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

Usage examples:, (*3)

$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 );

The Versions

23/09 2014

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.4.4

 

The Development Requires

by hagen huebel

23/09 2014

v0.2

0.2.0.0

  Sources   Download

The Requires

  • php >=5.4.4

 

The Development Requires

by hagen huebel