Documentation
¶
Index ¶
- Constants
- Variables
- func QuadKey(c Coordinate, zoom uint) string
- type Box
- type BruteFence
- type Coordinate
- type Feature
- type Fence
- type Rfence
- type Rnode
- type Rtree
- type Shape
- func (s *Shape) Add(c ...Coordinate)
- func (s *Shape) Append(o *Shape)
- func (s *Shape) BoundingBox() Box
- func (s *Shape) Contains(c Coordinate) bool
- func (s *Shape) Edges() <-chan []Coordinate
- func (s *Shape) Head() Coordinate
- func (s *Shape) IsClockwise() bool
- func (s *Shape) IsClosed() bool
- func (s *Shape) Length() int
- func (s *Shape) Reverse()
- func (s *Shape) Tail() Coordinate
Constants ¶
View Source
const ( EarthRad = 6372800 //meters RadToDeg = 180 / math.Pi DegToRad = math.Pi / 180 )
View Source
const ( PolygonFeature = "polygon" LineFeature = "line" PointFeature = "point" )
Variables ¶
View Source
var ( RtreeMinChildren = 25 RtreeMaxChildren = 50 )
Functions ¶
func QuadKey ¶
func QuadKey(c Coordinate, zoom uint) string
Types ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
func NewBox ¶
func NewBox(min, max Coordinate) (box Box, err error)
func (Box) Contains ¶
func (b Box) Contains(coords ...Coordinate) (in bool)
type BruteFence ¶
type BruteFence struct {
// contains filtered or unexported fields
}
func NewBruteFence ¶
func NewBruteFence() *BruteFence
func (*BruteFence) Add ¶
func (b *BruteFence) Add(f *Feature)
func (*BruteFence) Get ¶
func (b *BruteFence) Get(c Coordinate) []*Feature
func (*BruteFence) Size ¶
func (b *BruteFence) Size() int
type Coordinate ¶
type Coordinate struct {
Lat, Lon float64
}
func (Coordinate) Difference ¶
func (c Coordinate) Difference(o Coordinate) (d Coordinate)
func (Coordinate) Distance ¶
func (cd Coordinate) Distance(od Coordinate) float64
Distance between coordinates in meters
func (Coordinate) String ¶
func (c Coordinate) String() string
func (Coordinate) ToRad ¶
func (c Coordinate) ToRad() Coordinate
func (Coordinate) X ¶
func (c Coordinate) X() float64
func (Coordinate) Y ¶
func (c Coordinate) Y() float64
type Feature ¶
func MakeFeature ¶
func NewFeature ¶
func NewLineFeature ¶
func NewPointFeature ¶
func NewPolygonFeature ¶
func (*Feature) Center ¶
func (f *Feature) Center() (avg Coordinate)
type Rfence ¶
type Rfence struct {
// contains filtered or unexported fields
}
func (*Rfence) Get ¶
func (r *Rfence) Get(c Coordinate) []*Feature
type Rtree ¶
type Rtree struct {
// contains filtered or unexported fields
}
func (*Rtree) Contains ¶
func (r *Rtree) Contains(c Coordinate) []*Rnode
func (*Rtree) Intersections ¶
type Shape ¶
type Shape struct {
Coordinates []Coordinate
}
func NewShape ¶
func NewShape(coords ...Coordinate) *Shape
func (*Shape) Add ¶
func (s *Shape) Add(c ...Coordinate)
func (*Shape) BoundingBox ¶
func (*Shape) Contains ¶
func (s *Shape) Contains(c Coordinate) bool
func (*Shape) Edges ¶
func (s *Shape) Edges() <-chan []Coordinate
func (*Shape) Head ¶
func (s *Shape) Head() Coordinate
func (*Shape) IsClockwise ¶
func (*Shape) Tail ¶
func (s *Shape) Tail() Coordinate
Directories
¶
Path | Synopsis |
---|---|
package tile_system is a collection of conversion utilities to go between geo/pixel/tile/quadkey space This package uses WGS84 coordinates and a mercator projection
|
package tile_system is a collection of conversion utilities to go between geo/pixel/tile/quadkey space This package uses WGS84 coordinates and a mercator projection |
Click to show internal directories.
Click to hide internal directories.