Skip to content

Commit d57aba0

Browse files
author
Isaac Brodsky
authored
Bump to v4.0.0-rc5 (#104)
* Bump to v4.0.0-rc5 * Add PR number
1 parent 0da477c commit d57aba0

File tree

7 files changed

+39
-34
lines changed

7 files changed

+39
-34
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The public API of this library consists of the public functions declared in
66
file [H3Core.java](./src/main/java/com/uber/h3core/H3Core.java), and support
77
for the Linux x64 and Darwin x64 platforms.
88

9+
## [4.0.0-rc4] - 2022-08-17
10+
### Breaking Changes
11+
- Upgraded the core library to v4.0.0-rc5. (#104)
12+
- `exactEdgeLength` function renamed to `edgeLength`. (#104)
13+
914
## [4.0.0-rc3] - 2022-07-26
1015
### Breaking Changes
1116
- Upgraded the core library to v4.0.0-rc4. (#102)

h3version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
h3.git.reference=v4.0.0-rc4
1+
h3.git.reference=v4.0.0-rc5

src/main/c/h3-java/src/jniapi.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -947,14 +947,14 @@ Java_com_uber_h3core_NativeMethods_greatCircleDistanceM(
947947

948948
/*
949949
* Class: com_uber_h3core_NativeMethods
950-
* Method: exactEdgeLengthRads
950+
* Method: edgeLengthRads
951951
* Signature: (J)D
952952
*/
953953
JNIEXPORT jdouble JNICALL
954-
Java_com_uber_h3core_NativeMethods_exactEdgeLengthRads(JNIEnv *env,
954+
Java_com_uber_h3core_NativeMethods_edgeLengthRads(JNIEnv *env,
955955
jobject thiz, jlong h3) {
956956
jdouble out;
957-
H3Error err = exactEdgeLengthRads(h3, &out);
957+
H3Error err = edgeLengthRads(h3, &out);
958958
if (err) {
959959
ThrowH3Exception(env, err);
960960
}
@@ -963,13 +963,13 @@ Java_com_uber_h3core_NativeMethods_exactEdgeLengthRads(JNIEnv *env,
963963

964964
/*
965965
* Class: com_uber_h3core_NativeMethods
966-
* Method: exactEdgeLengthKm
966+
* Method: edgeLengthKm
967967
* Signature: (J)D
968968
*/
969-
JNIEXPORT jdouble JNICALL Java_com_uber_h3core_NativeMethods_exactEdgeLengthKm(
969+
JNIEXPORT jdouble JNICALL Java_com_uber_h3core_NativeMethods_edgeLengthKm(
970970
JNIEnv *env, jobject thiz, jlong h3) {
971971
jdouble out;
972-
H3Error err = exactEdgeLengthKm(h3, &out);
972+
H3Error err = edgeLengthKm(h3, &out);
973973
if (err) {
974974
ThrowH3Exception(env, err);
975975
}
@@ -978,13 +978,13 @@ JNIEXPORT jdouble JNICALL Java_com_uber_h3core_NativeMethods_exactEdgeLengthKm(
978978

979979
/*
980980
* Class: com_uber_h3core_NativeMethods
981-
* Method: exactEdgeLengthM
981+
* Method: edgeLengthM
982982
* Signature: (J)D
983983
*/
984-
JNIEXPORT jdouble JNICALL Java_com_uber_h3core_NativeMethods_exactEdgeLengthM(
984+
JNIEXPORT jdouble JNICALL Java_com_uber_h3core_NativeMethods_edgeLengthM(
985985
JNIEnv *env, jobject thiz, jlong h3) {
986986
jdouble out;
987-
H3Error err = exactEdgeLengthM(h3, &out);
987+
H3Error err = edgeLengthM(h3, &out);
988988
if (err) {
989989
ThrowH3Exception(env, err);
990990
}

src/main/java/com/uber/h3core/H3Core.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,8 @@ public double greatCircleDistance(LatLng a, LatLng b, LengthUnit unit) {
863863
* @param unit Unit of measure to use.
864864
* @return Length of the given edge.
865865
*/
866-
public double exactEdgeLength(String edgeAddress, LengthUnit unit) {
867-
return exactEdgeLength(stringToH3(edgeAddress), unit);
866+
public double edgeLength(String edgeAddress, LengthUnit unit) {
867+
return edgeLength(stringToH3(edgeAddress), unit);
868868
}
869869

870870
/**
@@ -874,10 +874,10 @@ public double exactEdgeLength(String edgeAddress, LengthUnit unit) {
874874
* @param unit Unit of measure to use.
875875
* @return Length of the given edge.
876876
*/
877-
public double exactEdgeLength(long edge, LengthUnit unit) {
878-
if (unit == LengthUnit.rads) return h3Api.exactEdgeLengthRads(edge);
879-
else if (unit == LengthUnit.km) return h3Api.exactEdgeLengthKm(edge);
880-
else if (unit == LengthUnit.m) return h3Api.exactEdgeLengthM(edge);
877+
public double edgeLength(long edge, LengthUnit unit) {
878+
if (unit == LengthUnit.rads) return h3Api.edgeLengthRads(edge);
879+
else if (unit == LengthUnit.km) return h3Api.edgeLengthKm(edge);
880+
else if (unit == LengthUnit.m) return h3Api.edgeLengthM(edge);
881881
else throw new IllegalArgumentException(String.format("Invalid unit: %s", unit));
882882
}
883883

src/main/java/com/uber/h3core/H3CoreV3.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ public double pointDist(LatLng a, LatLng b, LengthUnit unit) {
623623
* @return Length of the given edge.
624624
*/
625625
public double exactEdgeLength(String edgeAddress, LengthUnit unit) {
626-
return h3Api.exactEdgeLength(edgeAddress, unit);
626+
return h3Api.edgeLength(edgeAddress, unit);
627627
}
628628

629629
/**
@@ -634,7 +634,7 @@ public double exactEdgeLength(String edgeAddress, LengthUnit unit) {
634634
* @return Length of the given edge.
635635
*/
636636
public double exactEdgeLength(long edge, LengthUnit unit) {
637-
return h3Api.exactEdgeLength(edge, unit);
637+
return h3Api.edgeLength(edge, unit);
638638
}
639639

640640
/**

src/main/java/com/uber/h3core/NativeMethods.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ native void polygonToCells(
9292

9393
native double greatCircleDistanceM(double lat1, double lon1, double lat2, double lon2);
9494

95-
native double exactEdgeLengthRads(long h3);
95+
native double edgeLengthRads(long h3);
9696

97-
native double exactEdgeLengthKm(long h3);
97+
native double edgeLengthKm(long h3);
9898

99-
native double exactEdgeLengthM(long h3);
99+
native double edgeLengthM(long h3);
100100

101101
native double getHexagonAreaAvgKm2(int res);
102102

src/test/java/com/uber/h3core/TestMiscellaneous.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,19 @@ public void testCellAreaInvalidUnit() {
152152
}
153153

154154
@Test
155-
public void testExactEdgeLength() {
155+
public void testEdgeLength() {
156156
for (int res = 0; res <= 15; res++) {
157157
long cell = h3.latLngToCell(0, 0, res);
158158

159159
for (long edge : h3.originToDirectedEdges(cell)) {
160160
String edgeAddress = h3.h3ToString(edge);
161161

162-
double areaAddressM = h3.exactEdgeLength(edgeAddress, LengthUnit.m);
163-
double areaAddressKm = h3.exactEdgeLength(edgeAddress, LengthUnit.km);
164-
double areaAddressRads = h3.exactEdgeLength(edgeAddress, LengthUnit.rads);
165-
double areaM = h3.exactEdgeLength(edge, LengthUnit.m);
166-
double areaKm = h3.exactEdgeLength(edge, LengthUnit.km);
167-
double areaRads = h3.exactEdgeLength(edge, LengthUnit.rads);
162+
double areaAddressM = h3.edgeLength(edgeAddress, LengthUnit.m);
163+
double areaAddressKm = h3.edgeLength(edgeAddress, LengthUnit.km);
164+
double areaAddressRads = h3.edgeLength(edgeAddress, LengthUnit.rads);
165+
double areaM = h3.edgeLength(edge, LengthUnit.m);
166+
double areaKm = h3.edgeLength(edge, LengthUnit.km);
167+
double areaRads = h3.edgeLength(edge, LengthUnit.rads);
168168

169169
// Only asserts some properties of the functions that the edge lengths
170170
// should have certain relationships to each other, test isn't specific
@@ -180,21 +180,21 @@ public void testExactEdgeLength() {
180180
}
181181

182182
@Test(expected = H3Exception.class)
183-
public void testExactEdgeLengthInvalid() {
183+
public void testEdgeLengthInvalid() {
184184
// Passing in a non-edge should not cause a crash
185-
h3.exactEdgeLength(h3.latLngToCell(0, 0, 0), LengthUnit.km);
185+
h3.edgeLength(h3.latLngToCell(0, 0, 0), LengthUnit.km);
186186
}
187187

188188
@Test(expected = H3Exception.class)
189-
public void testExactEdgeLengthInvalidEdge() {
190-
h3.exactEdgeLength(0, LengthUnit.rads);
189+
public void testEdgeLengthInvalidEdge() {
190+
h3.edgeLength(0, LengthUnit.rads);
191191
}
192192

193193
@Test(expected = IllegalArgumentException.class)
194-
public void testExactEdgeLengthInvalidUnit() {
194+
public void testEdgeLengthInvalidUnit() {
195195
long cell = h3.latLngToCell(0, 0, 0);
196196
long edge = h3.originToDirectedEdges(cell).get(0);
197-
h3.exactEdgeLength(edge, null);
197+
h3.edgeLength(edge, null);
198198
}
199199

200200
@Test

0 commit comments

Comments
 (0)