Documentation
¶
Index ¶
Constants ¶
View Source
const (
// Default level of s2 cells.
DefaultS2CellLevel = 15
)
Variables ¶
View Source
var ( // Default value for geo indexer. DefaultGeoIndexer = NewS2Index(DefaultS2CellLevel) )
Functions ¶
func LoopFromCoordinates ¶
func LoopFromCoordinates(coordinates []Coordinate) *s2.Loop
func PolygonFromCoordinates ¶
func PolygonFromCoordinates(coordinates [][]Coordinate) *s2.Polygon
Types ¶
type Coordinate ¶
type CoordinateProps ¶
type CoordinateProps struct { Props []Props `json:"props"` Coordinate Coordinate `json:"coordinate"` }
type GeoIndex ¶
type GeoIndex interface { Find(Coordinate) string Cover(*s2.Polygon) []string }
GeoIndex is an interface for geo indexing.
type Lookuper ¶
type Lookuper interface {
Lookup(coordinates []Coordinate) []CoordinateProps
}
Lookuper is an interface for lookup services.
type PolyProps ¶
func PolyPropsFromCoordinates ¶
func PolyPropsFromCoordinates(coordinates [][]Coordinate, props map[string]interface{}) PolyProps
type S2Index ¶
type S2Index struct {
// contains filtered or unexported fields
}
S2Index is an s2-based polygon indexer.
func (S2Index) Find ¶
func (s S2Index) Find(coordinate Coordinate) string
Find returns an s2 cell that contains the given point.
Click to show internal directories.
Click to hide internal directories.