H3.NET.Native 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package H3.NET.Native --version 0.1.0
                    
NuGet\Install-Package H3.NET.Native -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="H3.NET.Native" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="H3.NET.Native" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="H3.NET.Native" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add H3.NET.Native --version 0.1.0
                    
#r "nuget: H3.NET.Native, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package H3.NET.Native@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=H3.NET.Native&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=H3.NET.Native&version=0.1.0
                    
Install as a Cake Tool

H3.NET.Native

NuGet License: Apache 2.0 CI

A thin, idiomatic P/Invoke binding over Uber H3 v4.5.0 for .NET 8 and .NET 10 (net8.0 / net10.0). H3.NET.Native exposes the H3 hexagonal hierarchical geospatial indexing system through a clean, managed .NET API. The native libh3 is built from a pinned upstream source revision and bundled directly in the NuGet package, so consumers need no C compiler, CMake, or other native toolchain to use it.

NuGet package id

The published NuGet PackageId is H3.NET.Native. The shorter id H3.NET was already taken on nuget.org by an unrelated package, so the binding is distributed as H3.NET.Native. Use H3.NET.Native in all dotnet add package and PackageReference declarations.

Status

First preview release on the 0.x line. The full Uber H3 v4.5.0 public surface (roughly seventy functions across inspection, hierarchy, grid traversal, directed edges, vertices, measures/units, and regions) is implemented and validated. As a 0.x preview the API is largely stable but may still receive minor refinements before 1.0.

Installation

dotnet add package H3.NET.Native

The bundled native assets are delivered through NuGet's runtimes/{rid}/native/ convention. This means H3.NET.Native must be consumed as a PackageReference (from nuget.org or another feed) so the native libraries propagate to your build and publish output. A bare ProjectReference to the source project does not carry the bundled native libraries, and your application will fail to load libh3 at runtime.

Supported platforms

Aspect Support
Target frameworks net10.0, net8.0
Runtime identifiers linux-x64, linux-musl-x64, osx-arm64

There is currently no Windows support and no Native AOT requirement or support; both are out of scope for this initial release and may be considered later.

Quickstart

The following snippet illustrates the public API. All latitude and longitude values are in degrees (radians are internal only), matching h3-py and h3-go. On the 0.x line the API may still see minor refinements before 1.0.

using H3.NET.Native;

var cell = H3Index.FromLatLng(new LatLng(37.7752, -122.4188), resolution: 9);
Console.WriteLine(cell);                 // H3 index

var center = cell.ToLatLng();            // back to LatLng (degrees)

foreach (var neighbor in cell.GridDisk(1))
    Console.WriteLine(neighbor);

Versioning

The library follows Semantic Versioning. Versions are derived from annotated git tags prefixed with v (for example v0.1.0) via MinVer. The library version is independent of the bundled Uber H3 version but tracks it: the binding currently bundles and targets Uber H3 v4.5.0.

Correctness and benchmarks

Correctness is validated against the reference implementation, not against other managed ports: the differential test corpus is generated from the official Uber H3 C library (via h3-py ≥ 4, pinned to the bundled v4.5.0), with h3-go available as a tiebreaker and a pure-C valgrind harness guarding native memory usage.

Performance is measured with BenchmarkDotNet. Consistent with the early-preview status, the benchmark project today wires a single comparison:

  • pocketken.H3 — the managed (NetTopologySuite-based) port; answers the practical "how does this compare to the managed library many teams run today?" question. The pocketken side is currently a clearly-marked placeholder so the project compiles; its bodies must be replaced with the real pocketken.H3 calls before the numbers mean anything.

Two further baselines are planned to place this binding on the full spectrum:

  • Raw libh3 C — direct P/Invoke into native libh3 with no idiomatic layer; the speed ceiling, isolating this library's own marshalling overhead.
  • H3.Standard — the other native P/Invoke binding (v4.0.1); an apples-to-apples binding comparison.

Benchmarks are informational, never gate CI, and their shapes may change while the binding is in preview.

License

Licensed under the Apache License, Version 2.0. Copyright 2026 FOOincognita.

Uber H3 is a separate project, also licensed under Apache-2.0, copyright Uber Technologies, Inc. See https://github.com/uber/h3.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 165 7/6/2026
0.2.0 75 7/3/2026
0.1.1 78 7/3/2026
0.1.0 108 6/29/2026