org.apache.lucene.spatial.geohash
Class GeoHashUtils

java.lang.Object
  extended by org.apache.lucene.spatial.geohash.GeoHashUtils

public class GeoHashUtils
extends Object

Utilities for encoding and decoding geohashes. Based on http://en.wikipedia.org/wiki/Geohash.


Method Summary
static double[] decode(String geohash)
          Decodes the given geohash into a latitude and longitude
static String encode(double latitude, double longitude)
          Encodes the given latitude and longitude into a geohash
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static String encode(double latitude,
                            double longitude)
Encodes the given latitude and longitude into a geohash

Parameters:
latitude - Latitude to encode
longitude - Longitude to encode
Returns:
Geohash encoding of the longitude and latitude

decode

public static double[] decode(String geohash)
Decodes the given geohash into a latitude and longitude

Parameters:
geohash - Geohash to deocde
Returns:
Array with the latitude at index 0, and longitude at index 1


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.