loco

package
v0.0.0-...-75216fc Latest Latest
Warning

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

Go to latest
Published: May 20, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MERGE_THRESHOLD = 2
)

Variables

This section is empty.

Functions

func FindCellIDs

func FindCellIDs(area s2.Rect) (cellUnion s2.CellUnion)

func GenerateGeohash

func GenerateGeohash(p s2.Point) (geohash int64)

Generate a geohash for the supplied point

func GenerateGeohashFromLatLng

func GenerateGeohashFromLatLng(lat float64, lng float64) (geohash int64)

Generate a geohash for the given latitude & longitude

func GenerateHashKey

func GenerateHashKey(geohash int64, hashKeyLength int) (hashkey int64)

Generate a DynamoDB hashkey of the given length for the supplied geohash

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(dynamoDB *dynamodb.DynamoDB) *Database

type GeohashRange

type GeohashRange struct {
	RangeMin s2.CellID
	RangeMax s2.CellID
}

func MergeCells

func MergeCells(cellUnion s2.CellUnion) (ranges []GeohashRange)

Merge continuous cells in CellUnion and return a list of merged GeohashRanges.

func (*GeohashRange) TryMerge

func (g *GeohashRange) TryMerge(otherRange *GeohashRange) (merged bool)

Jump to

Keyboard shortcuts

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