Package edu.caltech.csn.geocell.converter

Examples of edu.caltech.csn.geocell.converter.GeohashConv


   * Test predating unit tests that was implemented to mimic navigating a
   * known map of San Francisco.
   */
  @Test
  public void testWanderWithGeohash() {
    final Converter<String> geohashConv = new GeohashConv();
    long geocell = GeocellLibrary.getGeocell(57.64911, 10.40744, 50);
    assertEquals(geohashConv.toGeocell("u4pruydqqv"), geocell);

    // Trot around San Francisco using geohashes.
    geocell = geohashConv.toGeocell("9q8yyj");
    assertEquals("9q8yyj", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getEast(geocell);
    assertEquals("9q8yym", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getEast(geocell);
    assertEquals("9q8yyt", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getSouth(geocell);
    assertEquals("9q8yys", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getSouth(geocell);
    assertEquals("9q8yye", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getWest(geocell);
    assertEquals("9q8yy7", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getNorth(geocell);
    assertEquals("9q8yyk", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getSouth(geocell);
    assertEquals("9q8yy7", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getWest(geocell);
    assertEquals("9q8yy5", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getNorth(geocell);
    assertEquals("9q8yyh", geohashConv.fromGeocell(geocell));
    geocell = GeocellLibrary.getNorth(geocell);
    assertEquals("9q8yyj", geohashConv.fromGeocell(geocell));
  }
View Full Code Here

TOP

Related Classes of edu.caltech.csn.geocell.converter.GeohashConv

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.