proximityhash

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 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

ProximityHash: Geohashes in Proximity to a Point

Geohash is a geocoding system invented by Gustavo Niemeyer and placed into the public domain. It is a hierarchical spatial data structure which subdivides space into buckets of grid shape, which is one of the many applications of what is known as a Z-order curve, and generally space-filling curves.

ProximityHash

ProximityHash generates a set of geohashes that cover a circular area, given the center coordinates and the radius. It returns two sets. One contains all geohashes falling entirely within the radius. The other contains all geohashes which fall partially within the radius. On a map, the results would look like a (rough) circle of geohashes which fully match (with the origin point lying at the circle's center) with a ring of partially matching geohashes around the perimeter of the circle.

Important Disclaimer: I only guarantee that this library works in Japan, which is where I use it! So make sure you test your own use case!

Usage

You can download this package using go get:

go get github.com/phonaputer/proximityhash

and then import it into your Go project like so:

import "github.com/phonaputer/proximityhash"

Documentation

Documentation can be found on Godoc.

Contributors

phonaputer [https://github.com/phonaputer]

Idea Taken From

ProximityHash by Ashwin Nair [https://github.com/ashwin711/proximityhash]

Documentation

Overview

Proximityhash is a utility which finds all geohashes that lie within a given distance (in meters) of a given latitude, longitude coordinate point.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGeohashesWithinRadius

func FindGeohashesWithinRadius(lat, lng, radius float64, precision uint) (fullMatches, partialMatches []string)

The FindGeohashesWithinRadius function finds all geohashes within the given radius (in meters) of the given (lat, lng) coordinate point. The geohashes will have the given precision. Geohashes which are 100% inside the radius will be in the fullMatches return value. Geohashes which lie partially but not fully within the radius will be in the partialMatches return value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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