Skip to content

Commit

Permalink
test: Added some tests for toGeohash Esri#213
Browse files Browse the repository at this point in the history
  • Loading branch information
muchembledMartin committed Mar 3, 2024
1 parent 5fd7cb0 commit 84ef58e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/com/esri/core/geometry/TestGeohash.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,19 @@ public void testGeohashToEnvelopeGoodDimensions2(){
assertEquals(latDiff, env.ymax-env.ymin, delta);
}

@Test
public void testToGeohashHasGoodPrecision(){
Point2D point = new Point2D(18.068581, 59.329323);
assertEquals(6, Geohash.toGeohash(point, 6).length());
}

@Test
public void testToGeohash(){
String expected = "u6sce";
Point2D point = new Point2D(18.068581, 59.329323);
String geoHash = Geohash.toGeohash(point, 5);

assertEquals(expected, geoHash);
}

}

0 comments on commit 84ef58e

Please sign in to comment.