H3Go

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

codecov

Go H3

Go utilities for H3 library function support.

Support

  • H3 Radius Lookup

Usage

H3 Index

func TestH3Index(t *testing.T) {
	result := "87283472bffffff"
	index := H3Go.H3Index(37.3615593, -122.0553238, 7)
}

KRing

func TestKRing(t *testing.T) {
    resolution := 8
    radiusInKM := 4
	origin := H3Go.H3Index(37.3615593, -122.0553238, resolution)
	resultArray := H3Go.KRing(origin, resolution, radiusInKM)
}

Performance Benchmarks

Benchmark Done by HP ProBook 450 G5 8GB Ram machine

+-------------------------------+------------+-----------------------------------+
| Method                                    | Ops           | Average time ns/op |
+-------------------------------+------------+-----------------------------------+
| BenchmarkH3Index                          | 1000000       | 1154 ns/op         |
| BenchmarkKRing                            | 528979        | 2381 ns/op         |
+-------------------------------+------------+-----------------------------------+

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func H3Index

func H3Index(latitude, longitude float64, res int) h3.H3Index

H3Index returns the index of the cell of the location PARAMS latitude, longitude float64, res - H3 cell resolution

func KRing

func KRing(origin h3.H3Index, res int, distance float64) []h3.H3Index

KRing returns the array of neighbouring cell indexes at a given distance KM PARAMS origin base cell index, resolution int, distance in KM

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址