phayes/geoPHP — pull request #39 by mprins (2012-07-10 14:15:40+00:00)
Title: adding GeoHash adapter

initial version of an adapter that will work with geohashes.
Note that geohash is only something meaningful for a Point

Fixes #32

ps. sorry for the whitespace mods, seems the Github for Windows does some magic

for a quick test you can use the following:
```
equals(new Point(141.4, 43.03))){
echo 'Test OK', PHP_EOL;
}
$geometry = geoPHP::load('xn76urx4epb0','geohash');
if ($geometry->equals(new Point(139.766822, 35.681318))){
echo 'Test OK', PHP_EOL;
}

$p = new Point(139.766822, 35.681318);
$hash = $p->out('geohash');
if ($hash==='xn76urx4epb0'){
echo 'Test OK', PHP_EOL;
}

// round trip
$p = new Point(141.377,43.025);
$hash = $p->out('geohash');
$geometry = geoPHP::load($hash,'geohash');
if ($p->equals($geometry)){
echo 'Test OK', PHP_EOL;
}

```