func PointKey(lat, lng float64, t time.Time, k string) []byte {
	c := s2.CellIDFromLatLng(s2.LatLngFromDegrees(lat, lng))
	gk := make([]byte, len(Prefix)+1+8+8+len(k))
	copy(gk, Prefix+"G")
	copy(gk[len(Prefix)+1:], itob(uint64(c)))
	ts := int64tob(math.MaxInt64 - t.UnixNano())
	copy(gk[len(Prefix)+1+8:], ts)
	copy(gk[len(Prefix)+1+8+8:], k)
	return gk
}
PointKey returns the key generated for a position + id
package storage
import (
	"bytes"
	"encoding/binary"
	"math"
	"time"
	"github.com/golang/geo/s2"
)
const Prefix = "TT"
type Indexer interface {
	Store(k string, v []byte, lat, lng float64, t time.Time) error
	StoreTx(tx Tx, k string, v []byte, lat, lng float64, t time.Time) error
	Get(k string) (*DataPoint, error)
	Keys() ([]string, error)
	GetAll(k string, count int) ([]DataPoint, error)
	RadiusSearch(lat, lng, radius float64) ([]DataPoint, error)
	RectSearch(urlat, urlng, bllat, bllng float64) ([]DataPoint, error)
	Begin() Tx
}
type Tx interface {
	Discard()
	Commit() error
}
type DataPoint struct {
	Lat, Lng float64
	Key      string
	Value    []byte
	Time     time.Time
}
func DataKey(k string, t time.Time, lat, lng float64) []byte {
	dk := make([]byte, len(Prefix)+1+len(k)+1+8+8)
	copy(dk, Prefix+"D")
	copy(dk[len(Prefix)+1:], k)
	dk[len(Prefix)+1+len(k)] = '#'
	ts := int64tob(math.MaxInt64 - t.UnixNano())
	copy(dk[len(Prefix)+1+len(k)+1:], ts)
	c := s2.CellIDFromLatLng(s2.LatLngFromDegrees(lat, lng))
	copy(dk[len(Prefix)+1+len(k)+1+8:], itob(uint64(c)))
	return dk
}