Search in sources :

Example 6 with GeoHash

use of com.firebase.geofire.core.GeoHash in project geofire-java by firebase.

the class GeoHashTest method hashValues.

@Test
public void hashValues() {
    Assert.assertEquals(new GeoHash("7zzzzzzzzz"), new GeoHash(0, 0));
    Assert.assertEquals(new GeoHash("2pbpbpbpbp"), new GeoHash(0, -180));
    Assert.assertEquals(new GeoHash("rzzzzzzzzz"), new GeoHash(0, 180));
    Assert.assertEquals(new GeoHash("5bpbpbpbpb"), new GeoHash(-90, 0));
    Assert.assertEquals(new GeoHash("0000000000"), new GeoHash(-90, -180));
    Assert.assertEquals(new GeoHash("pbpbpbpbpb"), new GeoHash(-90, 180));
    Assert.assertEquals(new GeoHash("gzzzzzzzzz"), new GeoHash(90, 0));
    Assert.assertEquals(new GeoHash("bpbpbpbpbp"), new GeoHash(90, -180));
    Assert.assertEquals(new GeoHash("zzzzzzzzzz"), new GeoHash(90, 180));
    Assert.assertEquals(new GeoHash("9q8yywe56g"), new GeoHash(37.7853074, -122.4054274));
    Assert.assertEquals(new GeoHash("dqcjf17sy6"), new GeoHash(38.98719, -77.250783));
    Assert.assertEquals(new GeoHash("tj4p5gerfz"), new GeoHash(29.3760648, 47.9818853));
    Assert.assertEquals(new GeoHash("umghcygjj7"), new GeoHash(78.216667, 15.55));
    Assert.assertEquals(new GeoHash("4qpzmren1k"), new GeoHash(-54.933333, -67.616667));
    Assert.assertEquals(new GeoHash("4w2kg3s54y"), new GeoHash(-54, -67));
}
Also used : GeoHash(com.firebase.geofire.core.GeoHash) Test(org.junit.Test)

Aggregations

GeoHash (com.firebase.geofire.core.GeoHash)6 Test (org.junit.Test)4 GeoHashQuery (com.firebase.geofire.core.GeoHashQuery)2 DatabaseError (com.google.firebase.database.DatabaseError)2 DataSnapshot (com.google.firebase.database.DataSnapshot)1 DatabaseReference (com.google.firebase.database.DatabaseReference)1 ValueEventListener (com.google.firebase.database.ValueEventListener)1