Documentation ¶
Index ¶
- Variables
- func IsPoint(obj Object) (z float64, ok bool)
- type Circle
- func (g *Circle) AppendJSON(dst []byte) []byte
- func (g *Circle) Center() geometry.Point
- func (g *Circle) Contains(obj Object) bool
- func (g *Circle) Distance(other Object) float64
- func (g *Circle) Empty() bool
- func (g *Circle) ForEach(iter func(geom Object) bool) bool
- func (g *Circle) Haversine() float64
- func (g *Circle) HaversineTo(p geometry.Point) float64
- func (g *Circle) Intersects(obj Object) bool
- func (g *Circle) JSON() string
- func (g *Circle) MarshalJSON() ([]byte, error)
- func (g *Circle) Meters() float64
- func (g *Circle) NumPoints() int
- func (g *Circle) Primative() Object
- func (g *Circle) Rect() geometry.Rect
- func (g *Circle) Spatial() Spatial
- func (g *Circle) String() string
- func (g *Circle) Valid() bool
- func (g *Circle) Within(obj Object) bool
- type Collection
- type EmptySpatial
- func (s EmptySpatial) DistanceLine(line *geometry.Line) float64
- func (s EmptySpatial) DistancePoint(point geometry.Point) float64
- func (s EmptySpatial) DistancePoly(poly *geometry.Poly) float64
- func (s EmptySpatial) DistanceRect(rect geometry.Rect) float64
- func (s EmptySpatial) IntersectsLine(line *geometry.Line) bool
- func (s EmptySpatial) IntersectsPoint(point geometry.Point) bool
- func (s EmptySpatial) IntersectsPoly(poly *geometry.Poly) bool
- func (s EmptySpatial) IntersectsRect(rect geometry.Rect) bool
- func (s EmptySpatial) WithinLine(line *geometry.Line) bool
- func (s EmptySpatial) WithinPoint(point geometry.Point) bool
- func (s EmptySpatial) WithinPoly(poly *geometry.Poly) bool
- func (s EmptySpatial) WithinRect(rect geometry.Rect) bool
- type Feature
- func (g *Feature) AppendJSON(dst []byte) []byte
- func (g *Feature) Base() Object
- func (g *Feature) Center() geometry.Point
- func (g *Feature) Contains(obj Object) bool
- func (g *Feature) Distance(obj Object) float64
- func (g *Feature) DistanceLine(line *geometry.Line) float64
- func (g *Feature) DistancePoint(point geometry.Point) float64
- func (g *Feature) DistancePoly(poly *geometry.Poly) float64
- func (g *Feature) DistanceRect(rect geometry.Rect) float64
- func (g *Feature) Empty() bool
- func (g *Feature) ForEach(iter func(geom Object) bool) bool
- func (g *Feature) Intersects(obj Object) bool
- func (g *Feature) IntersectsLine(line *geometry.Line) bool
- func (g *Feature) IntersectsPoint(point geometry.Point) bool
- func (g *Feature) IntersectsPoly(poly *geometry.Poly) bool
- func (g *Feature) IntersectsRect(rect geometry.Rect) bool
- func (g *Feature) JSON() string
- func (g *Feature) MarshalJSON() ([]byte, error)
- func (g *Feature) Members() string
- func (g *Feature) NumPoints() int
- func (g *Feature) Rect() geometry.Rect
- func (g *Feature) Spatial() Spatial
- func (g *Feature) String() string
- func (g *Feature) Valid() bool
- func (g *Feature) Within(obj Object) bool
- func (g *Feature) WithinLine(line *geometry.Line) bool
- func (g *Feature) WithinPoint(point geometry.Point) bool
- func (g *Feature) WithinPoly(poly *geometry.Poly) bool
- func (g *Feature) WithinRect(rect geometry.Rect) bool
- type FeatureCollection
- func (g *FeatureCollection) AppendJSON(dst []byte) []byte
- func (g *FeatureCollection) Base() []Object
- func (g *FeatureCollection) Center() geometry.Point
- func (g *FeatureCollection) Children() []Object
- func (g *FeatureCollection) Contains(obj Object) bool
- func (g *FeatureCollection) Distance(obj Object) float64
- func (g *FeatureCollection) DistanceLine(line *geometry.Line) float64
- func (g *FeatureCollection) DistancePoint(point geometry.Point) float64
- func (g *FeatureCollection) DistancePoly(poly *geometry.Poly) float64
- func (g *FeatureCollection) DistanceRect(rect geometry.Rect) float64
- func (g *FeatureCollection) Empty() bool
- func (g *FeatureCollection) ForEach(iter func(geom Object) bool) bool
- func (g *FeatureCollection) Indexed() bool
- func (g *FeatureCollection) Intersects(obj Object) bool
- func (g *FeatureCollection) IntersectsLine(line *geometry.Line) bool
- func (g *FeatureCollection) IntersectsPoint(point geometry.Point) bool
- func (g *FeatureCollection) IntersectsPoly(poly *geometry.Poly) bool
- func (g *FeatureCollection) IntersectsRect(rect geometry.Rect) bool
- func (g *FeatureCollection) JSON() string
- func (g *FeatureCollection) MarshalJSON() ([]byte, error)
- func (g *FeatureCollection) NumPoints() int
- func (g *FeatureCollection) Rect() geometry.Rect
- func (g *FeatureCollection) Search(rect geometry.Rect, iter func(child Object) bool)
- func (g *FeatureCollection) Spatial() Spatial
- func (g *FeatureCollection) String() string
- func (g *FeatureCollection) Valid() bool
- func (g *FeatureCollection) Within(obj Object) bool
- func (g *FeatureCollection) WithinLine(line *geometry.Line) bool
- func (g *FeatureCollection) WithinPoint(point geometry.Point) bool
- func (g *FeatureCollection) WithinPoly(poly *geometry.Poly) bool
- func (g *FeatureCollection) WithinRect(rect geometry.Rect) bool
- type GeometryCollection
- func (g *GeometryCollection) AppendJSON(dst []byte) []byte
- func (g *GeometryCollection) Base() []Object
- func (g *GeometryCollection) Center() geometry.Point
- func (g *GeometryCollection) Children() []Object
- func (g *GeometryCollection) Contains(obj Object) bool
- func (g *GeometryCollection) Distance(obj Object) float64
- func (g *GeometryCollection) DistanceLine(line *geometry.Line) float64
- func (g *GeometryCollection) DistancePoint(point geometry.Point) float64
- func (g *GeometryCollection) DistancePoly(poly *geometry.Poly) float64
- func (g *GeometryCollection) DistanceRect(rect geometry.Rect) float64
- func (g *GeometryCollection) Empty() bool
- func (g *GeometryCollection) ForEach(iter func(geom Object) bool) bool
- func (g *GeometryCollection) Indexed() bool
- func (g *GeometryCollection) Intersects(obj Object) bool
- func (g *GeometryCollection) IntersectsLine(line *geometry.Line) bool
- func (g *GeometryCollection) IntersectsPoint(point geometry.Point) bool
- func (g *GeometryCollection) IntersectsPoly(poly *geometry.Poly) bool
- func (g *GeometryCollection) IntersectsRect(rect geometry.Rect) bool
- func (g *GeometryCollection) JSON() string
- func (g *GeometryCollection) MarshalJSON() ([]byte, error)
- func (g *GeometryCollection) NumPoints() int
- func (g *GeometryCollection) Rect() geometry.Rect
- func (g *GeometryCollection) Search(rect geometry.Rect, iter func(child Object) bool)
- func (g *GeometryCollection) Spatial() Spatial
- func (g *GeometryCollection) String() string
- func (g *GeometryCollection) Valid() bool
- func (g *GeometryCollection) Within(obj Object) bool
- func (g *GeometryCollection) WithinLine(line *geometry.Line) bool
- func (g *GeometryCollection) WithinPoint(point geometry.Point) bool
- func (g *GeometryCollection) WithinPoly(poly *geometry.Poly) bool
- func (g *GeometryCollection) WithinRect(rect geometry.Rect) bool
- type LineString
- func (g *LineString) AppendJSON(dst []byte) []byte
- func (g *LineString) Base() *geometry.Line
- func (g *LineString) Center() geometry.Point
- func (g *LineString) Contains(obj Object) bool
- func (g *LineString) Distance(obj Object) float64
- func (g *LineString) DistanceLine(line *geometry.Line) float64
- func (g *LineString) DistancePoint(point geometry.Point) float64
- func (g *LineString) DistancePoly(poly *geometry.Poly) float64
- func (g *LineString) DistanceRect(rect geometry.Rect) float64
- func (g *LineString) Empty() bool
- func (g *LineString) ForEach(iter func(geom Object) bool) bool
- func (g *LineString) Intersects(obj Object) bool
- func (g *LineString) IntersectsLine(line *geometry.Line) bool
- func (g *LineString) IntersectsPoint(point geometry.Point) bool
- func (g *LineString) IntersectsPoly(poly *geometry.Poly) bool
- func (g *LineString) IntersectsRect(rect geometry.Rect) bool
- func (g *LineString) JSON() string
- func (g *LineString) MarshalJSON() ([]byte, error)
- func (g *LineString) NumPoints() int
- func (g *LineString) Rect() geometry.Rect
- func (g *LineString) Spatial() Spatial
- func (g *LineString) String() string
- func (g *LineString) Valid() bool
- func (g *LineString) Within(obj Object) bool
- func (g *LineString) WithinLine(line *geometry.Line) bool
- func (g *LineString) WithinPoint(point geometry.Point) bool
- func (g *LineString) WithinPoly(poly *geometry.Poly) bool
- func (g *LineString) WithinRect(rect geometry.Rect) bool
- type MultiLineString
- func (g *MultiLineString) AppendJSON(dst []byte) []byte
- func (g *MultiLineString) Base() []Object
- func (g *MultiLineString) Center() geometry.Point
- func (g *MultiLineString) Children() []Object
- func (g *MultiLineString) Contains(obj Object) bool
- func (g *MultiLineString) Distance(obj Object) float64
- func (g *MultiLineString) DistanceLine(line *geometry.Line) float64
- func (g *MultiLineString) DistancePoint(point geometry.Point) float64
- func (g *MultiLineString) DistancePoly(poly *geometry.Poly) float64
- func (g *MultiLineString) DistanceRect(rect geometry.Rect) float64
- func (g *MultiLineString) Empty() bool
- func (g *MultiLineString) ForEach(iter func(geom Object) bool) bool
- func (g *MultiLineString) Indexed() bool
- func (g *MultiLineString) Intersects(obj Object) bool
- func (g *MultiLineString) IntersectsLine(line *geometry.Line) bool
- func (g *MultiLineString) IntersectsPoint(point geometry.Point) bool
- func (g *MultiLineString) IntersectsPoly(poly *geometry.Poly) bool
- func (g *MultiLineString) IntersectsRect(rect geometry.Rect) bool
- func (g *MultiLineString) JSON() string
- func (g *MultiLineString) MarshalJSON() ([]byte, error)
- func (g *MultiLineString) NumPoints() int
- func (g *MultiLineString) Rect() geometry.Rect
- func (g *MultiLineString) Search(rect geometry.Rect, iter func(child Object) bool)
- func (g *MultiLineString) Spatial() Spatial
- func (g *MultiLineString) String() string
- func (g *MultiLineString) Valid() bool
- func (g *MultiLineString) Within(obj Object) bool
- func (g *MultiLineString) WithinLine(line *geometry.Line) bool
- func (g *MultiLineString) WithinPoint(point geometry.Point) bool
- func (g *MultiLineString) WithinPoly(poly *geometry.Poly) bool
- func (g *MultiLineString) WithinRect(rect geometry.Rect) bool
- type MultiPoint
- func (g *MultiPoint) AppendJSON(dst []byte) []byte
- func (g *MultiPoint) Base() []Object
- func (g *MultiPoint) Center() geometry.Point
- func (g *MultiPoint) Children() []Object
- func (g *MultiPoint) Contains(obj Object) bool
- func (g *MultiPoint) Distance(obj Object) float64
- func (g *MultiPoint) DistanceLine(line *geometry.Line) float64
- func (g *MultiPoint) DistancePoint(point geometry.Point) float64
- func (g *MultiPoint) DistancePoly(poly *geometry.Poly) float64
- func (g *MultiPoint) DistanceRect(rect geometry.Rect) float64
- func (g *MultiPoint) Empty() bool
- func (g *MultiPoint) ForEach(iter func(geom Object) bool) bool
- func (g *MultiPoint) Indexed() bool
- func (g *MultiPoint) Intersects(obj Object) bool
- func (g *MultiPoint) IntersectsLine(line *geometry.Line) bool
- func (g *MultiPoint) IntersectsPoint(point geometry.Point) bool
- func (g *MultiPoint) IntersectsPoly(poly *geometry.Poly) bool
- func (g *MultiPoint) IntersectsRect(rect geometry.Rect) bool
- func (g *MultiPoint) JSON() string
- func (g *MultiPoint) MarshalJSON() ([]byte, error)
- func (g *MultiPoint) NumPoints() int
- func (g *MultiPoint) Rect() geometry.Rect
- func (g *MultiPoint) Search(rect geometry.Rect, iter func(child Object) bool)
- func (g *MultiPoint) Spatial() Spatial
- func (g *MultiPoint) String() string
- func (g *MultiPoint) Valid() bool
- func (g *MultiPoint) Within(obj Object) bool
- func (g *MultiPoint) WithinLine(line *geometry.Line) bool
- func (g *MultiPoint) WithinPoint(point geometry.Point) bool
- func (g *MultiPoint) WithinPoly(poly *geometry.Poly) bool
- func (g *MultiPoint) WithinRect(rect geometry.Rect) bool
- type MultiPolygon
- func (g *MultiPolygon) AppendJSON(dst []byte) []byte
- func (g *MultiPolygon) Base() []Object
- func (g *MultiPolygon) Center() geometry.Point
- func (g *MultiPolygon) Children() []Object
- func (g *MultiPolygon) Contains(obj Object) bool
- func (g *MultiPolygon) Distance(obj Object) float64
- func (g *MultiPolygon) DistanceLine(line *geometry.Line) float64
- func (g *MultiPolygon) DistancePoint(point geometry.Point) float64
- func (g *MultiPolygon) DistancePoly(poly *geometry.Poly) float64
- func (g *MultiPolygon) DistanceRect(rect geometry.Rect) float64
- func (g *MultiPolygon) Empty() bool
- func (g *MultiPolygon) ForEach(iter func(geom Object) bool) bool
- func (g *MultiPolygon) Indexed() bool
- func (g *MultiPolygon) Intersects(obj Object) bool
- func (g *MultiPolygon) IntersectsLine(line *geometry.Line) bool
- func (g *MultiPolygon) IntersectsPoint(point geometry.Point) bool
- func (g *MultiPolygon) IntersectsPoly(poly *geometry.Poly) bool
- func (g *MultiPolygon) IntersectsRect(rect geometry.Rect) bool
- func (g *MultiPolygon) JSON() string
- func (g *MultiPolygon) MarshalJSON() ([]byte, error)
- func (g *MultiPolygon) NumPoints() int
- func (g *MultiPolygon) Rect() geometry.Rect
- func (g *MultiPolygon) Search(rect geometry.Rect, iter func(child Object) bool)
- func (g *MultiPolygon) Spatial() Spatial
- func (g *MultiPolygon) String() string
- func (g *MultiPolygon) Valid() bool
- func (g *MultiPolygon) Within(obj Object) bool
- func (g *MultiPolygon) WithinLine(line *geometry.Line) bool
- func (g *MultiPolygon) WithinPoint(point geometry.Point) bool
- func (g *MultiPolygon) WithinPoly(poly *geometry.Poly) bool
- func (g *MultiPolygon) WithinRect(rect geometry.Rect) bool
- type Object
- type ParseOptions
- type Point
- func (g *Point) AppendJSON(dst []byte) []byte
- func (g *Point) Base() geometry.Point
- func (g *Point) Center() geometry.Point
- func (g *Point) Contains(obj Object) bool
- func (g *Point) Distance(obj Object) float64
- func (g *Point) DistanceLine(line *geometry.Line) float64
- func (g *Point) DistancePoint(point geometry.Point) float64
- func (g *Point) DistancePoly(poly *geometry.Poly) float64
- func (g *Point) DistanceRect(rect geometry.Rect) float64
- func (g *Point) Empty() bool
- func (g *Point) ForEach(iter func(geom Object) bool) bool
- func (g *Point) Intersects(obj Object) bool
- func (g *Point) IntersectsLine(line *geometry.Line) bool
- func (g *Point) IntersectsPoint(point geometry.Point) bool
- func (g *Point) IntersectsPoly(poly *geometry.Poly) bool
- func (g *Point) IntersectsRect(rect geometry.Rect) bool
- func (g *Point) JSON() string
- func (g *Point) MarshalJSON() ([]byte, error)
- func (g *Point) NumPoints() int
- func (g *Point) Rect() geometry.Rect
- func (g *Point) Spatial() Spatial
- func (g *Point) String() string
- func (g *Point) Valid() bool
- func (g *Point) Within(obj Object) bool
- func (g *Point) WithinLine(line *geometry.Line) bool
- func (g *Point) WithinPoint(point geometry.Point) bool
- func (g *Point) WithinPoly(poly *geometry.Poly) bool
- func (g *Point) WithinRect(rect geometry.Rect) bool
- func (g *Point) Z() float64
- type Polygon
- func (g *Polygon) AppendJSON(dst []byte) []byte
- func (g *Polygon) Base() *geometry.Poly
- func (g *Polygon) Center() geometry.Point
- func (g *Polygon) Contains(obj Object) bool
- func (g *Polygon) Distance(obj Object) float64
- func (g *Polygon) DistanceLine(line *geometry.Line) float64
- func (g *Polygon) DistancePoint(point geometry.Point) float64
- func (g *Polygon) DistancePoly(poly *geometry.Poly) float64
- func (g *Polygon) DistanceRect(rect geometry.Rect) float64
- func (g *Polygon) Empty() bool
- func (g *Polygon) ForEach(iter func(geom Object) bool) bool
- func (g *Polygon) Intersects(obj Object) bool
- func (g *Polygon) IntersectsLine(line *geometry.Line) bool
- func (g *Polygon) IntersectsPoint(point geometry.Point) bool
- func (g *Polygon) IntersectsPoly(poly *geometry.Poly) bool
- func (g *Polygon) IntersectsRect(rect geometry.Rect) bool
- func (g *Polygon) JSON() string
- func (g *Polygon) MarshalJSON() ([]byte, error)
- func (g *Polygon) NumPoints() int
- func (g *Polygon) Rect() geometry.Rect
- func (g *Polygon) Spatial() Spatial
- func (g *Polygon) String() string
- func (g *Polygon) Valid() bool
- func (g *Polygon) Within(obj Object) bool
- func (g *Polygon) WithinLine(line *geometry.Line) bool
- func (g *Polygon) WithinPoint(point geometry.Point) bool
- func (g *Polygon) WithinPoly(poly *geometry.Poly) bool
- func (g *Polygon) WithinRect(rect geometry.Rect) bool
- type Rect
- func (g *Rect) AppendJSON(dst []byte) []byte
- func (g *Rect) Base() geometry.Rect
- func (g *Rect) Center() geometry.Point
- func (g *Rect) Contains(obj Object) bool
- func (g *Rect) Distance(obj Object) float64
- func (g *Rect) DistanceLine(line *geometry.Line) float64
- func (g *Rect) DistancePoint(point geometry.Point) float64
- func (g *Rect) DistancePoly(poly *geometry.Poly) float64
- func (g *Rect) DistanceRect(rect geometry.Rect) float64
- func (g *Rect) Empty() bool
- func (g *Rect) ForEach(iter func(geom Object) bool) bool
- func (g *Rect) Intersects(obj Object) bool
- func (g *Rect) IntersectsLine(line *geometry.Line) bool
- func (g *Rect) IntersectsPoint(point geometry.Point) bool
- func (g *Rect) IntersectsPoly(poly *geometry.Poly) bool
- func (g *Rect) IntersectsRect(rect geometry.Rect) bool
- func (g *Rect) JSON() string
- func (g *Rect) MarshalJSON() ([]byte, error)
- func (g *Rect) NumPoints() int
- func (g *Rect) Rect() geometry.Rect
- func (g *Rect) Spatial() Spatial
- func (g *Rect) String() string
- func (g *Rect) Valid() bool
- func (g *Rect) Within(obj Object) bool
- func (g *Rect) WithinLine(line *geometry.Line) bool
- func (g *Rect) WithinPoint(point geometry.Point) bool
- func (g *Rect) WithinPoly(poly *geometry.Poly) bool
- func (g *Rect) WithinRect(rect geometry.Rect) bool
- type SimplePoint
- func (g *SimplePoint) AppendJSON(dst []byte) []byte
- func (g *SimplePoint) Base() geometry.Point
- func (g *SimplePoint) Center() geometry.Point
- func (g *SimplePoint) Contains(obj Object) bool
- func (g *SimplePoint) Distance(obj Object) float64
- func (g *SimplePoint) DistanceLine(line *geometry.Line) float64
- func (g *SimplePoint) DistancePoint(point geometry.Point) float64
- func (g *SimplePoint) DistancePoly(poly *geometry.Poly) float64
- func (g *SimplePoint) DistanceRect(rect geometry.Rect) float64
- func (g *SimplePoint) Empty() bool
- func (g *SimplePoint) ForEach(iter func(geom Object) bool) bool
- func (g *SimplePoint) Intersects(obj Object) bool
- func (g *SimplePoint) IntersectsLine(line *geometry.Line) bool
- func (g *SimplePoint) IntersectsPoint(point geometry.Point) bool
- func (g *SimplePoint) IntersectsPoly(poly *geometry.Poly) bool
- func (g *SimplePoint) IntersectsRect(rect geometry.Rect) bool
- func (g *SimplePoint) JSON() string
- func (g *SimplePoint) MarshalJSON() ([]byte, error)
- func (g *SimplePoint) NumPoints() int
- func (g *SimplePoint) Rect() geometry.Rect
- func (g *SimplePoint) Spatial() Spatial
- func (g *SimplePoint) String() string
- func (g *SimplePoint) Valid() bool
- func (g *SimplePoint) Within(obj Object) bool
- func (g *SimplePoint) WithinLine(line *geometry.Line) bool
- func (g *SimplePoint) WithinPoint(point geometry.Point) bool
- func (g *SimplePoint) WithinPoly(poly *geometry.Poly) bool
- func (g *SimplePoint) WithinRect(rect geometry.Rect) bool
- type Spatial
Constants ¶
This section is empty.
Variables ¶
var DefaultParseOptions = &ParseOptions{ IndexChildren: 64, IndexGeometry: 64, IndexGeometryKind: geometry.QuadTree, RequireValid: false, AllowSimplePoints: false, DisableCircleType: false, }
DefaultParseOptions ...
Functions ¶
Types ¶
type Circle ¶
type Circle struct {
// contains filtered or unexported fields
}
Circle ...
func (*Circle) HaversineTo ¶
HaversineTo returns the haversine from a given point to circle's center
func (*Circle) Intersects ¶
Intersects returns true the circle intersects other object
func (*Circle) MarshalJSON ¶ added in v1.1.0
MarshalJSON ...
type Collection ¶
type Collection interface { Children() []Object Indexed() bool Search(rect geometry.Rect, iter func(child Object) bool) }
Collection is a searchable collection type.
type EmptySpatial ¶
type EmptySpatial struct{}
EmptySpatial ...
func (EmptySpatial) DistanceLine ¶
func (s EmptySpatial) DistanceLine(line *geometry.Line) float64
DistanceLine ...
func (EmptySpatial) DistancePoint ¶
func (s EmptySpatial) DistancePoint(point geometry.Point) float64
DistancePoint ...
func (EmptySpatial) DistancePoly ¶
func (s EmptySpatial) DistancePoly(poly *geometry.Poly) float64
DistancePoly ...
func (EmptySpatial) DistanceRect ¶
func (s EmptySpatial) DistanceRect(rect geometry.Rect) float64
DistanceRect ...
func (EmptySpatial) IntersectsLine ¶
func (s EmptySpatial) IntersectsLine(line *geometry.Line) bool
IntersectsLine ...
func (EmptySpatial) IntersectsPoint ¶
func (s EmptySpatial) IntersectsPoint(point geometry.Point) bool
IntersectsPoint ...
func (EmptySpatial) IntersectsPoly ¶
func (s EmptySpatial) IntersectsPoly(poly *geometry.Poly) bool
IntersectsPoly ...
func (EmptySpatial) IntersectsRect ¶
func (s EmptySpatial) IntersectsRect(rect geometry.Rect) bool
IntersectsRect ...
func (EmptySpatial) WithinLine ¶
func (s EmptySpatial) WithinLine(line *geometry.Line) bool
WithinLine ...
func (EmptySpatial) WithinPoint ¶
func (s EmptySpatial) WithinPoint(point geometry.Point) bool
WithinPoint ...
func (EmptySpatial) WithinPoly ¶
func (s EmptySpatial) WithinPoly(poly *geometry.Poly) bool
WithinPoly ...
func (EmptySpatial) WithinRect ¶
func (s EmptySpatial) WithinRect(rect geometry.Rect) bool
WithinRect ...
type Feature ¶
type Feature struct {
// contains filtered or unexported fields
}
Feature ...
func NewFeature ¶
NewFeature returns a new GeoJSON Feature. The members must be a valid json object such as `{"id":"391","properties":{}}`, or it must be an empty string. It should not contain a "feature" member.
func (*Feature) DistanceLine ¶
DistanceLine ...
func (*Feature) DistancePoint ¶
DistancePoint ...
func (*Feature) DistancePoly ¶
DistancePoly ...
func (*Feature) DistanceRect ¶
DistanceRect ...
func (*Feature) IntersectsLine ¶
IntersectsLine ...
func (*Feature) IntersectsPoint ¶
IntersectsPoint ...
func (*Feature) IntersectsPoly ¶
IntersectsPoly ...
func (*Feature) IntersectsRect ¶
IntersectsRect ...
func (*Feature) MarshalJSON ¶ added in v1.1.0
MarshalJSON ...
func (*Feature) WithinPoint ¶
WithinPoint ...
type FeatureCollection ¶
type FeatureCollection struct {
// contains filtered or unexported fields
}
FeatureCollection ...
func NewFeatureCollection ¶
func NewFeatureCollection(features []Object) *FeatureCollection
NewFeatureCollection ...
func (*FeatureCollection) AppendJSON ¶
func (g *FeatureCollection) AppendJSON(dst []byte) []byte
AppendJSON appends the GeoJSON reprensentation to dst
func (*FeatureCollection) DistanceLine ¶
func (*FeatureCollection) DistancePoint ¶
func (*FeatureCollection) DistancePoly ¶
func (*FeatureCollection) DistanceRect ¶
func (*FeatureCollection) Intersects ¶
Intersects ...
func (*FeatureCollection) IntersectsLine ¶
func (*FeatureCollection) IntersectsPoint ¶
func (*FeatureCollection) IntersectsPoly ¶
func (*FeatureCollection) IntersectsRect ¶
func (*FeatureCollection) MarshalJSON ¶ added in v1.1.0
func (g *FeatureCollection) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*FeatureCollection) WithinLine ¶
func (*FeatureCollection) WithinPoint ¶
func (*FeatureCollection) WithinPoly ¶
func (*FeatureCollection) WithinRect ¶
type GeometryCollection ¶
type GeometryCollection struct {
// contains filtered or unexported fields
}
GeometryCollection ...
func NewGeometryCollection ¶
func NewGeometryCollection(geometries []Object) *GeometryCollection
NewGeometryCollection ...
func (*GeometryCollection) AppendJSON ¶
func (g *GeometryCollection) AppendJSON(dst []byte) []byte
AppendJSON appends the GeoJSON reprensentation to dst
func (*GeometryCollection) DistanceLine ¶
func (*GeometryCollection) DistancePoint ¶
func (*GeometryCollection) DistancePoly ¶
func (*GeometryCollection) DistanceRect ¶
func (*GeometryCollection) Intersects ¶
Intersects ...
func (*GeometryCollection) IntersectsLine ¶
func (*GeometryCollection) IntersectsPoint ¶
func (*GeometryCollection) IntersectsPoly ¶
func (*GeometryCollection) IntersectsRect ¶
func (*GeometryCollection) MarshalJSON ¶ added in v1.1.0
func (g *GeometryCollection) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*GeometryCollection) WithinLine ¶
func (*GeometryCollection) WithinPoint ¶
func (*GeometryCollection) WithinPoly ¶
func (*GeometryCollection) WithinRect ¶
type LineString ¶
type LineString struct {
// contains filtered or unexported fields
}
LineString ...
func (*LineString) DistanceLine ¶
func (g *LineString) DistanceLine(line *geometry.Line) float64
DistanceLine ...
func (*LineString) DistancePoint ¶
func (g *LineString) DistancePoint(point geometry.Point) float64
DistancePoint ...
func (*LineString) DistancePoly ¶
func (g *LineString) DistancePoly(poly *geometry.Poly) float64
DistancePoly ...
func (*LineString) DistanceRect ¶
func (g *LineString) DistanceRect(rect geometry.Rect) float64
DistanceRect ..
func (*LineString) ForEach ¶
func (g *LineString) ForEach(iter func(geom Object) bool) bool
ForEach ...
func (*LineString) IntersectsLine ¶
func (g *LineString) IntersectsLine(line *geometry.Line) bool
IntersectsLine ...
func (*LineString) IntersectsPoint ¶
func (g *LineString) IntersectsPoint(point geometry.Point) bool
IntersectsPoint ...
func (*LineString) IntersectsPoly ¶
func (g *LineString) IntersectsPoly(poly *geometry.Poly) bool
IntersectsPoly ...
func (*LineString) IntersectsRect ¶
func (g *LineString) IntersectsRect(rect geometry.Rect) bool
IntersectsRect ...
func (*LineString) MarshalJSON ¶ added in v1.1.0
func (g *LineString) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*LineString) WithinLine ¶
func (g *LineString) WithinLine(line *geometry.Line) bool
WithinLine ...
func (*LineString) WithinPoint ¶
func (g *LineString) WithinPoint(point geometry.Point) bool
WithinPoint ...
func (*LineString) WithinPoly ¶
func (g *LineString) WithinPoly(poly *geometry.Poly) bool
WithinPoly ...
func (*LineString) WithinRect ¶
func (g *LineString) WithinRect(rect geometry.Rect) bool
WithinRect ...
type MultiLineString ¶
type MultiLineString struct {
// contains filtered or unexported fields
}
MultiLineString ...
func NewMultiLineString ¶
func NewMultiLineString(lines []*geometry.Line) *MultiLineString
NewMultiLineString ...
func (*MultiLineString) AppendJSON ¶
func (g *MultiLineString) AppendJSON(dst []byte) []byte
AppendJSON ...
func (*MultiLineString) DistanceLine ¶
func (*MultiLineString) DistancePoint ¶
func (*MultiLineString) DistancePoly ¶
func (*MultiLineString) DistanceRect ¶
func (*MultiLineString) Intersects ¶
Intersects ...
func (*MultiLineString) IntersectsLine ¶
func (*MultiLineString) IntersectsPoint ¶
func (*MultiLineString) IntersectsPoly ¶
func (*MultiLineString) IntersectsRect ¶
func (*MultiLineString) MarshalJSON ¶ added in v1.1.0
func (g *MultiLineString) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*MultiLineString) WithinLine ¶
func (*MultiLineString) WithinPoint ¶
func (*MultiLineString) WithinPoly ¶
func (*MultiLineString) WithinRect ¶
type MultiPoint ¶
type MultiPoint struct {
// contains filtered or unexported fields
}
MultiPoint ...
func (*MultiPoint) DistanceLine ¶
func (*MultiPoint) DistancePoint ¶
func (*MultiPoint) DistancePoly ¶
func (*MultiPoint) DistanceRect ¶
func (*MultiPoint) IntersectsLine ¶
func (*MultiPoint) IntersectsPoint ¶
func (*MultiPoint) IntersectsPoly ¶
func (*MultiPoint) IntersectsRect ¶
func (*MultiPoint) MarshalJSON ¶ added in v1.1.0
func (g *MultiPoint) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*MultiPoint) WithinLine ¶
func (*MultiPoint) WithinPoint ¶
func (*MultiPoint) WithinPoly ¶
func (*MultiPoint) WithinRect ¶
type MultiPolygon ¶
type MultiPolygon struct {
// contains filtered or unexported fields
}
MultiPolygon ...
func NewMultiPolygon ¶
func NewMultiPolygon(polys []*geometry.Poly) *MultiPolygon
NewMultiPolygon ...
func (*MultiPolygon) AppendJSON ¶
func (g *MultiPolygon) AppendJSON(dst []byte) []byte
AppendJSON ...
func (*MultiPolygon) DistanceLine ¶
func (*MultiPolygon) DistancePoint ¶
func (*MultiPolygon) DistancePoly ¶
func (*MultiPolygon) DistanceRect ¶
func (*MultiPolygon) IntersectsLine ¶
func (*MultiPolygon) IntersectsPoint ¶
func (*MultiPolygon) IntersectsPoly ¶
func (*MultiPolygon) IntersectsRect ¶
func (*MultiPolygon) MarshalJSON ¶ added in v1.1.0
func (g *MultiPolygon) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*MultiPolygon) WithinLine ¶
func (*MultiPolygon) WithinPoint ¶
func (*MultiPolygon) WithinPoly ¶
func (*MultiPolygon) WithinRect ¶
type Object ¶
type Object interface { Empty() bool Valid() bool Rect() geometry.Rect Center() geometry.Point Contains(other Object) bool Within(other Object) bool Intersects(other Object) bool AppendJSON(dst []byte) []byte JSON() string String() string Distance(obj Object) float64 NumPoints() int ForEach(iter func(geom Object) bool) bool Spatial() Spatial MarshalJSON() ([]byte, error) }
Object is a GeoJSON type
type ParseOptions ¶
type ParseOptions struct { // IndexChildren option will cause the object to index their children // objects when the number of children is greater than or equal to the // provided value. Setting this value to 0 will disable indexing. // The default is 64. IndexChildren int // IndexGeometry option will cause the object to index it's geometry // when the number of points in it's base polygon or linestring is greater // that or equal to the provided value. Setting this value to 0 will // disable indexing. // The default is 64. IndexGeometry int // IndexGeometryKind is the kind of index implementation. // Default is QuadTreeCompressed IndexGeometryKind geometry.IndexKind // RequireValid option cause parse to fail when a geojson object is invalid. RequireValid bool // AllowSimplePoints options will force to parse to return the SimplePoint // type when a geojson point only consists of an 2D x/y coord and no extra // json members. AllowSimplePoints bool // DisableCircleType disables the special Circle syntax that is unique to // only Tile38. DisableCircleType bool }
ParseOptions ...
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point ...
func (*Point) DistanceLine ¶
DistanceLine ...
func (*Point) DistancePoint ¶
DistancePoint ...
func (*Point) DistancePoly ¶
DistancePoly ...
func (*Point) DistanceRect ¶
DistanceRect ...
func (*Point) IntersectsLine ¶
IntersectsLine ...
func (*Point) IntersectsPoint ¶
IntersectsPoint ...
func (*Point) IntersectsPoly ¶
IntersectsPoly ...
func (*Point) IntersectsRect ¶
IntersectsRect ...
func (*Point) MarshalJSON ¶ added in v1.1.0
MarshalJSON ...
type Polygon ¶
type Polygon struct {
// contains filtered or unexported fields
}
Polygon ...
func (*Polygon) DistanceLine ¶
DistanceLine ...
func (*Polygon) DistancePoint ¶
DistancePoint ...
func (*Polygon) DistancePoly ¶
DistancePoly ...
func (*Polygon) DistanceRect ¶
DistanceRect ...
func (*Polygon) IntersectsLine ¶
IntersectsLine ...
func (*Polygon) IntersectsPoint ¶
IntersectsPoint ...
func (*Polygon) IntersectsPoly ¶
IntersectsPoly ...
func (*Polygon) IntersectsRect ¶
IntersectsRect ...
func (*Polygon) MarshalJSON ¶ added in v1.1.0
MarshalJSON ...
func (*Polygon) WithinPoint ¶
WithinPoint ...
type Rect ¶
type Rect struct {
// contains filtered or unexported fields
}
Rect ...
func (*Rect) DistanceLine ¶
DistanceLine ...
func (*Rect) DistancePoint ¶
DistancePoint ...
func (*Rect) DistancePoly ¶
DistancePoly ...
func (*Rect) DistanceRect ¶
DistanceRect ...
func (*Rect) IntersectsLine ¶
IntersectsLine ...
func (*Rect) IntersectsPoint ¶
IntersectsPoint ...
func (*Rect) IntersectsPoly ¶
IntersectsPoly ...
func (*Rect) IntersectsRect ¶
IntersectsRect ...
func (*Rect) MarshalJSON ¶ added in v1.1.0
MarshalJSON ...
type SimplePoint ¶ added in v1.1.1
SimplePoint ...
func NewSimplePoint ¶ added in v1.1.1
func NewSimplePoint(point geometry.Point) *SimplePoint
NewSimplePoint returns a new SimplePoint object.
func (*SimplePoint) AppendJSON ¶ added in v1.1.1
func (g *SimplePoint) AppendJSON(dst []byte) []byte
AppendJSON ...
func (*SimplePoint) Center ¶ added in v1.1.1
func (g *SimplePoint) Center() geometry.Point
Center ...
func (*SimplePoint) Contains ¶ added in v1.1.1
func (g *SimplePoint) Contains(obj Object) bool
Contains ...
func (*SimplePoint) Distance ¶ added in v1.1.1
func (g *SimplePoint) Distance(obj Object) float64
Distance ...
func (*SimplePoint) DistanceLine ¶ added in v1.1.1
func (g *SimplePoint) DistanceLine(line *geometry.Line) float64
DistanceLine ...
func (*SimplePoint) DistancePoint ¶ added in v1.1.1
func (g *SimplePoint) DistancePoint(point geometry.Point) float64
DistancePoint ...
func (*SimplePoint) DistancePoly ¶ added in v1.1.1
func (g *SimplePoint) DistancePoly(poly *geometry.Poly) float64
DistancePoly ...
func (*SimplePoint) DistanceRect ¶ added in v1.1.1
func (g *SimplePoint) DistanceRect(rect geometry.Rect) float64
DistanceRect ...
func (*SimplePoint) ForEach ¶ added in v1.1.1
func (g *SimplePoint) ForEach(iter func(geom Object) bool) bool
ForEach ...
func (*SimplePoint) Intersects ¶ added in v1.1.1
func (g *SimplePoint) Intersects(obj Object) bool
Intersects ...
func (*SimplePoint) IntersectsLine ¶ added in v1.1.1
func (g *SimplePoint) IntersectsLine(line *geometry.Line) bool
IntersectsLine ...
func (*SimplePoint) IntersectsPoint ¶ added in v1.1.1
func (g *SimplePoint) IntersectsPoint(point geometry.Point) bool
IntersectsPoint ...
func (*SimplePoint) IntersectsPoly ¶ added in v1.1.1
func (g *SimplePoint) IntersectsPoly(poly *geometry.Poly) bool
IntersectsPoly ...
func (*SimplePoint) IntersectsRect ¶ added in v1.1.1
func (g *SimplePoint) IntersectsRect(rect geometry.Rect) bool
IntersectsRect ...
func (*SimplePoint) MarshalJSON ¶ added in v1.1.1
func (g *SimplePoint) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*SimplePoint) Within ¶ added in v1.1.1
func (g *SimplePoint) Within(obj Object) bool
Within ...
func (*SimplePoint) WithinLine ¶ added in v1.1.1
func (g *SimplePoint) WithinLine(line *geometry.Line) bool
WithinLine ...
func (*SimplePoint) WithinPoint ¶ added in v1.1.1
func (g *SimplePoint) WithinPoint(point geometry.Point) bool
WithinPoint ...
func (*SimplePoint) WithinPoly ¶ added in v1.1.1
func (g *SimplePoint) WithinPoly(poly *geometry.Poly) bool
WithinPoly ...
func (*SimplePoint) WithinRect ¶ added in v1.1.1
func (g *SimplePoint) WithinRect(rect geometry.Rect) bool
WithinRect ...
type Spatial ¶
type Spatial interface { WithinRect(rect geometry.Rect) bool WithinPoint(point geometry.Point) bool WithinLine(line *geometry.Line) bool WithinPoly(poly *geometry.Poly) bool IntersectsRect(rect geometry.Rect) bool IntersectsPoint(point geometry.Point) bool IntersectsLine(line *geometry.Line) bool IntersectsPoly(poly *geometry.Poly) bool DistanceRect(rect geometry.Rect) float64 DistancePoint(point geometry.Point) float64 DistanceLine(line *geometry.Line) float64 DistancePoly(poly *geometry.Poly) float64 }
Spatial ...