Skip to content
/ go-zrange Public

This package implements an efficient algorithm for performing spatial range queries with geohash-encoded keys and a search radius.

License

Notifications You must be signed in to change notification settings

umpc/go-zrange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-zrange

GoDoc Go Report Card

go get -u github.com/umpc/go-zrange

Package zrange implements an efficient algorithm for performing geospatial range queries with Geohash-encoded keys and a search radius.

The RadialRange method appears to be sufficient for range queries of around 5,000km or less. Changes that efficiently add support for larger query ranges are welcome.

Example usage

...

rangeParams := zrange.RadialRangeParams{
  Radius:    32.18688,
  Latitude:  37.334722,
  Longitude: -122.008889,
}

keyRanges := rangeParams.RadialRange()

...

Note: Geohash range searches are imprecise. Results should be filtered using the input radius where precision is desired.

References

  • The RadialRange method was inspired by the algorithm in the "Search" section of this page.

About

This package implements an efficient algorithm for performing spatial range queries with geohash-encoded keys and a search radius.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages