Skip to content

Latest commit

 

History

History
192 lines (142 loc) · 3.72 KB

installation.mdx

File metadata and controls

192 lines (142 loc) · 3.72 KB
id title sidebar_label slug
installation
Installation
Installation
/installation

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

We recommend using prebuilt bindings if they are available for your programming language. Bindings for Go, Java, JavaScript, Python, and others are available.

Package managers

<Tabs groupId="env" defaultValue="python" values={[ {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript', value: 'javascript'}, {label: 'Homebrew', value: 'brew'}, ] }>

Using PyPi, run:

pip install h3

Using Conda, run:

conda config --add channels conda-forge
conda install h3-py

Using Maven, add the following to your pom.xml file:

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

Using Gradle, add the following to your build script:

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

Using npm, run:

npm install h3-js

Using yarn, run:

yarn add h3-js

Using brew, run:

brew install h3

This installs the C library and filter applications.

Install from source

First, clone the repository or download the source and check out the latest release:

git clone https://github.com/uber/h3.git
cd h3
git checkout v$(<VERSION)

Note: You must install build dependencies for your operating system.

<Tabs groupId="os" defaultValue="python" values={[ {label: 'mac OS', value: 'macos'}, {label: 'alpine', value: 'alpine'}, {label: 'Debian/Ubuntu', value: 'debian'}, {label: 'Windows', value: 'windows'}, {label: 'FreeBSD', value: 'freebsd'}, ] }>

First make sure you have the developer tools installed and then run:

# Installing the bare build requirements
brew install cmake
# Installing useful tools for development
brew install clang-format lcov doxygen
# Installing the bare build requirements
apk add cmake make gcc libtool musl-dev
# Installing the bare build requirements
sudo apt install cmake make gcc libtool
# Installing useful tools for development
sudo apt install clang-format cmake-curses-gui lcov doxygen

You need to install CMake and Visual Studio, including the Visual C++ compiler.

:::info

You can build H3 as a shared library (DLL) on Windows, but the test suite does not support this configuration because the tests use functions internal to the DLL, and they are not exposed for testing.

:::

# Installing the bare build requirements
sudo apt install cmake make gcc libtool
# Installing useful tools for development
sudo apt install clang-format cmake-curses-gui lcov doxygen
# Installing the build requirements
sudo pkg install bash cmake gmake doxygen lcov

Next, build the library:

mkdir build
cd build
cmake ..
cmake --build .

Optionally, to run H3's test suite, run:

ctest

By default, the filter applications are built when you build H3. Confirm they are working by running:

./bin/latLngToCell --lat 14 --lng -42 --resolution 2