2017 © Pedro Peláez
 

library geo

Geohash library port of ngeohash

image

cdekok/geo

Geohash library port of ngeohash

  • Thursday, September 28, 2017
  • by mech7
  • Repository
  • 1 Watchers
  • 1 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Geohash

PHP implementation for encoding / decoding geohashes, (*1)

Build Status Coverage Status, (*2)

Usage

use Cdekok\Geo\Geohash;

// Encode
$hash = (new Geohash)->encode($lat, $lon);

// Decode
$location = (new Geohash)->decode($hash);
echo $location['latitude'] . "\n";
echo $location['longitude'] . "\n";

// Decode bounding box
$bb = (new Geohash)->deodeBbox($hash);
echo 'Min latitude: ' . $bb[0] . "\n";
echo 'Min longitude: ' . $bb[1] . "\n";
echo 'Max latitude: ' . $bb[2] . "\n";
echo 'Max longitude: ' . $bb[3] . "\n";

// Find neighbour hash
$north = (new Geohash)->neighbour($hash, Geohash::DIRECTION_NORTH);

// Find all geohashes within a bounding box
$minLat = -90;
$minLon = -180;
$maxLat = 90;
$maxLon = 180;
$length = 1;
$hashes = (new Geohash)->bboxes($minLat, $minLon, $maxLat, $maxLon, $length);
prin_r($hashes);
[
    '0',
    '1',
    '4',
    ...

Credits

PHP port of ngeohash, (*3)

The Versions

28/09 2017

dev-develop

dev-develop

Geohash library port of ngeohash

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

geo geohash ngeohash

28/09 2017

dev-master

9999999-dev

Geohash library port of ngeohash

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

geo geohash ngeohash

28/09 2017

1.0.1

1.0.1.0

Geohash library port of ngeohash

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

geo geohash ngeohash

16/09 2017

1.0.0

1.0.0.0

Geohash library port of ngeohash

  Sources   Download

MIT

The Requires

 

The Development Requires

geo geohash ngeohash