dfellis / h3-java

Java bindings for H3, a hierarchical hexagonal geospatial indexing system

Home Page:https://uber.github.io/h3/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

H3-Java

License

This library provides Java bindings for the H3 Core Library. For API reference, please see the H3 Documentation.

Usage

Add it to your pom.xml:

<dependency>
    <groupId>com.uber</groupId>
    <artifactId>h3</artifactId>
    <version>3.0.0</version>
</dependency>

Or, using Gradle:

compile("com.uber:h3:3.0.0")

Encode a location into a hexagon address:

H3Core h3 = H3Core.newInstance();

double lat = 37.775938728915946;
double lng = -122.41795063018799;
int res = 9;

String hexAddr = h3.geoToH3Address(lat, lng, res);

Decode a hexagon address into coordinates:

Vector2D[] geoCoords = h3.h3ToGeoBoundary(hexAddr);

Development

Building the library requires a JDK, Maven, CMake, and a C compiler. To install to your local Maven cache, run:

mvn install

To build the library, run:

mvn package

Additional information on how the build process works is available in the build process documentaiton.

Javadocs

To build Javadocs documentation:

mvn site

Then open the file target/site/apidocs/index.html.

Benchmarking

To run benchmarks, either execute them from IntelliJ or run the following from shell: (Replace the class name as needed)

mvn exec:exec -Dexec.executable="java" -Dexec.args="-classpath %classpath com.uber.h3core.benchmarking.H3CoreBenchmark" -Dexec.classpathScope="test"

Contributing

Pull requests and Github issues are welcome. Please include tests that show the bug is fixed or feature works as intended. Please open issues to discuss large features or changes which would break compatibility, before submitting pull requests.

Before we can merge your changes, you must agree to the Uber Contributor License Agreement.

Legal and Licensing

H3-Java is licensed under the Apache 2.0 License.

DGGRID Copyright (c) 2015 Southern Oregon University

About

Java bindings for H3, a hierarchical hexagonal geospatial indexing system

https://uber.github.io/h3/

License:Apache License 2.0


Languages

Language:Java 76.6%Language:C 19.5%Language:CMake 2.4%Language:Shell 1.5%