Skip to content

Commit

Permalink
Fix: lat and lon were inverted in test for toGeohash
Browse files Browse the repository at this point in the history
  • Loading branch information
muchembledMartin committed Mar 3, 2024
1 parent b21e5b9 commit 7191907
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/test/java/com/esri/core/geometry/TestGeohash.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public void testConvertToBinary() {

@Test
public void testToGeoHash() {
Point2D p1 = new Point2D(48.669, -4.329);
Point2D p2 = new Point2D(70.273, -30.382);
Point2D p3 = new Point2D(37.691, 14.276);
Point2D p1 = new Point2D(-4.329,48.669);
Point2D p2 = new Point2D(-30.382, 70.273);
Point2D p3 = new Point2D(14.276, 37.691);

int chrLen = 5;

Expand All @@ -127,4 +127,22 @@ public void testToGeohash2(){
assertEquals(expected, geoHash);
}

@Test
public void testContainingGeohashWithHugeValues(){
Envelope2D envelope = new Envelope2D(-179, -89, 179, 89);
assertEquals("", Geohash.containingGeohash(envelope));
}

@Test
public void testContainingGeohash(){
Envelope2D envelope = new Envelope2D(-179, -89, -140, -50);
assertEquals("0", Geohash.containingGeohash(envelope));
}

@Test
public void testContainingGeohash2(){
Envelope2D envelope = new Envelope2D(18.078, 59.3564, 18.1,59.3344);
assertEquals("u6sce", Geohash.containingGeohash(envelope));
}

}

0 comments on commit 7191907

Please sign in to comment.