Skip to content

Commit f628b6e

Browse files
author
Isaac Brodsky
authored
Upgrade to v4.0.0-rc2 (#91)
Upgrades H3-Java to H3 core library v4.0.0 release candidate. Since this is not the final v4 release, H3-Java with v4 is also considered pre-release. A new class, `H3CoreV3`, is added to act as a compatibility layer during upgrades. Because it is implemented using the v4 library underneath, care was not taken to make exceptions the same across both interfaces - only the function names are the same. I think this makes H3CoreV3 of limited use, so I expect to remove it in an update before or soon after releasing h3-java v4.0.0.
1 parent 56edf17 commit f628b6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3955
-1138
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ file [H3Core.java](./src/main/java/com/uber/h3core/H3Core.java), and support
77
for the Linux x64 and Darwin x64 platforms.
88

99
## [Unreleased]
10+
### Breaking Changes
11+
- Changed the API of `H3Core` to align it with the core library, and introduced `H3CoreV3` for users who wish to use the old names. (#91)
12+
13+
### Added
14+
- Vertex mode API. (#91)
15+
16+
### Changed
17+
- Upgraded the core library to v4.0.0. (#91)
18+
1019
### Removed
1120
- Removed support for Linux MIPSEL (#92)
1221

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ double lat = 37.775938728915946;
3737
double lng = -122.41795063018799;
3838
int res = 9;
3939

40-
String hexAddr = h3.geoToH3Address(lat, lng, res);
40+
String hexAddr = h3.latLngToCellAddress(lat, lng, res);
4141
```
4242

4343
Decode a hexagon address into coordinates:
4444

4545
```java
46-
List<GeoCoord> geoCoords = h3.h3ToGeoBoundary(hexAddr);
46+
List<LatLng> LatLngs = h3.cellToGeoBoundary(hexAddr);
4747
```
4848

4949
## Supported Operating Systems

docs/migrating-from-v3.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Migrating from h3-java version 3
2+
3+
The H3 library introduced breaking [changes](https://h3geo.org/docs/next/library/migrating-3.x) in 4.0.0 which are reflected in H3-Java 4.0.0.
4+
5+
Cell indexes generated in 3.x and 4.x are the same and can be used in either library version interchangably.
6+
7+
## Renaming
8+
9+
Functions and classes were renamed in H3 version 4.0.0 to have a more consistent and predictable naming scheme. The corresponding H3-Java names were changed to match.
10+
11+
### Legacy API
12+
13+
If you do not wish to use the new names, the H3-Java library provides `H3CoreV3` as a temporary compatability layer for applications. Your application can use `H3CoreV3` where it previously used `H3Core` and continue using the same function names. Because `H3CoreV3` uses the core library version 4.0.0 internally, exceptions and error codes are not backwards compatible.
14+
15+
## Exceptions
16+
17+
Specialized exceptions in H3-Java have been replaced with `H3Exception`, which is a `RuntimeException`. This exception wraps the error codes now returned by the H3 core library. The library may also throw standard Java exceptions like `IllegalArgumentException`.
18+
19+
## Removed
20+
21+
* `kRings`: This function is no longer exposed in the H3 library as it existed only for FFI performance reasons.

h3version.properties

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

0 commit comments

Comments
 (0)