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) Members() string
- func (g *Circle) Meters() float64
- func (g *Circle) NumPoints() int
- func (g *Circle) Polygon() 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) Members() string
- 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) Members() string
- 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) Members() string
- 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) Members() string
- 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) Members() string
- 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) Members() string
- 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) IsSimple() bool
- func (g *Point) JSON() string
- func (g *Point) MarshalJSON() ([]byte, error)
- func (g *Point) Members() string
- 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) HasExtra() 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) Members() string
- 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) Members() string
- func (g *Rect) NumPoints() int
- func (g *Rect) Polygon() Object
- 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) Members() string
- 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 ¶
View Source
var DefaultParseOptions = &ParseOptions{ IndexChildren: 64, IndexGeometry: 64, IndexGeometryKind: geometry.QuadTree, RequireValid: false, AllowSimplePoints: false, DisableCircleType: false, AllowRects: false, }
Functions ¶
Types ¶
type Circle ¶
type Circle struct {
// contains filtered or unexported fields
}
func (*Circle) AppendJSON ¶
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
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{}
func (EmptySpatial) DistanceLine ¶
func (s EmptySpatial) DistanceLine(line *geometry.Line) float64
func (EmptySpatial) DistancePoint ¶
func (s EmptySpatial) DistancePoint(point geometry.Point) float64
func (EmptySpatial) DistancePoly ¶
func (s EmptySpatial) DistancePoly(poly *geometry.Poly) float64
func (EmptySpatial) DistanceRect ¶
func (s EmptySpatial) DistanceRect(rect geometry.Rect) float64
func (EmptySpatial) IntersectsLine ¶
func (s EmptySpatial) IntersectsLine(line *geometry.Line) bool
func (EmptySpatial) IntersectsPoint ¶
func (s EmptySpatial) IntersectsPoint(point geometry.Point) bool
func (EmptySpatial) IntersectsPoly ¶
func (s EmptySpatial) IntersectsPoly(poly *geometry.Poly) bool
func (EmptySpatial) IntersectsRect ¶
func (s EmptySpatial) IntersectsRect(rect geometry.Rect) bool
func (EmptySpatial) WithinLine ¶
func (s EmptySpatial) WithinLine(line *geometry.Line) bool
func (EmptySpatial) WithinPoint ¶
func (s EmptySpatial) WithinPoint(point geometry.Point) bool
func (EmptySpatial) WithinPoly ¶
func (s EmptySpatial) WithinPoly(poly *geometry.Poly) bool
func (EmptySpatial) WithinRect ¶
func (s EmptySpatial) WithinRect(rect geometry.Rect) bool
type Feature ¶
type Feature struct {
// contains filtered or unexported fields
}
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) AppendJSON ¶
func (*Feature) Intersects ¶
func (*Feature) MarshalJSON ¶ added in v1.1.0
type FeatureCollection ¶
type FeatureCollection struct {
// contains filtered or unexported fields
}
func NewFeatureCollection ¶
func NewFeatureCollection(features []Object) *FeatureCollection
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 ¶
func (*FeatureCollection) IntersectsLine ¶
func (*FeatureCollection) IntersectsPoint ¶
func (*FeatureCollection) IntersectsPoly ¶
func (*FeatureCollection) IntersectsRect ¶
func (*FeatureCollection) JSON ¶
func (g *FeatureCollection) JSON() string
func (*FeatureCollection) MarshalJSON ¶ added in v1.1.0
func (g *FeatureCollection) MarshalJSON() ([]byte, error)
func (*FeatureCollection) Members ¶ added in v1.4.0
func (g *FeatureCollection) Members() string
func (*FeatureCollection) String ¶
func (g *FeatureCollection) String() string
func (*FeatureCollection) WithinLine ¶
func (*FeatureCollection) WithinPoint ¶
func (*FeatureCollection) WithinPoly ¶
func (*FeatureCollection) WithinRect ¶
type GeometryCollection ¶
type GeometryCollection struct {
// contains filtered or unexported fields
}
func NewGeometryCollection ¶
func NewGeometryCollection(geometries []Object) *GeometryCollection
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 ¶
func (*GeometryCollection) IntersectsLine ¶
func (*GeometryCollection) IntersectsPoint ¶
func (*GeometryCollection) IntersectsPoly ¶
func (*GeometryCollection) IntersectsRect ¶
func (*GeometryCollection) JSON ¶
func (g *GeometryCollection) JSON() string
func (*GeometryCollection) MarshalJSON ¶ added in v1.1.0
func (g *GeometryCollection) MarshalJSON() ([]byte, error)
func (*GeometryCollection) Members ¶ added in v1.4.0
func (g *GeometryCollection) Members() string
func (*GeometryCollection) String ¶
func (g *GeometryCollection) String() string
func (*GeometryCollection) WithinLine ¶
func (*GeometryCollection) WithinPoint ¶
func (*GeometryCollection) WithinPoly ¶
func (*GeometryCollection) WithinRect ¶
type LineString ¶
type LineString struct {
// contains filtered or unexported fields
}
func NewLineString ¶
func NewLineString(line *geometry.Line) *LineString
func (*LineString) AppendJSON ¶
func (g *LineString) AppendJSON(dst []byte) []byte
func (*LineString) Base ¶
func (g *LineString) Base() *geometry.Line
func (*LineString) Center ¶
func (g *LineString) Center() geometry.Point
func (*LineString) Contains ¶
func (g *LineString) Contains(obj Object) bool
func (*LineString) Distance ¶
func (g *LineString) Distance(obj Object) float64
func (*LineString) DistanceLine ¶
func (g *LineString) DistanceLine(line *geometry.Line) float64
func (*LineString) DistancePoint ¶
func (g *LineString) DistancePoint(point geometry.Point) float64
func (*LineString) DistancePoly ¶
func (g *LineString) DistancePoly(poly *geometry.Poly) float64
func (*LineString) DistanceRect ¶
func (g *LineString) DistanceRect(rect geometry.Rect) float64
DistanceRect ..
func (*LineString) Empty ¶
func (g *LineString) Empty() bool
func (*LineString) Intersects ¶
func (g *LineString) Intersects(obj Object) bool
func (*LineString) IntersectsLine ¶
func (g *LineString) IntersectsLine(line *geometry.Line) bool
func (*LineString) IntersectsPoint ¶
func (g *LineString) IntersectsPoint(point geometry.Point) bool
func (*LineString) IntersectsPoly ¶
func (g *LineString) IntersectsPoly(poly *geometry.Poly) bool
func (*LineString) IntersectsRect ¶
func (g *LineString) IntersectsRect(rect geometry.Rect) bool
func (*LineString) JSON ¶
func (g *LineString) JSON() string
func (*LineString) MarshalJSON ¶ added in v1.1.0
func (g *LineString) MarshalJSON() ([]byte, error)
func (*LineString) Members ¶ added in v1.4.0
func (g *LineString) Members() string
func (*LineString) NumPoints ¶
func (g *LineString) NumPoints() int
func (*LineString) Rect ¶
func (g *LineString) Rect() geometry.Rect
func (*LineString) Spatial ¶
func (g *LineString) Spatial() Spatial
func (*LineString) String ¶
func (g *LineString) String() string
func (*LineString) Valid ¶
func (g *LineString) Valid() bool
func (*LineString) Within ¶
func (g *LineString) Within(obj Object) bool
func (*LineString) WithinLine ¶
func (g *LineString) WithinLine(line *geometry.Line) bool
func (*LineString) WithinPoint ¶
func (g *LineString) WithinPoint(point geometry.Point) bool
func (*LineString) WithinPoly ¶
func (g *LineString) WithinPoly(poly *geometry.Poly) bool
func (*LineString) WithinRect ¶
func (g *LineString) WithinRect(rect geometry.Rect) bool
type MultiLineString ¶
type MultiLineString struct {
// contains filtered or unexported fields
}
func NewMultiLineString ¶
func NewMultiLineString(lines []*geometry.Line) *MultiLineString
func (*MultiLineString) AppendJSON ¶
func (g *MultiLineString) AppendJSON(dst []byte) []byte
func (*MultiLineString) DistanceLine ¶
func (*MultiLineString) DistancePoint ¶
func (*MultiLineString) DistancePoly ¶
func (*MultiLineString) DistanceRect ¶
func (*MultiLineString) Intersects ¶
func (*MultiLineString) IntersectsLine ¶
func (*MultiLineString) IntersectsPoint ¶
func (*MultiLineString) IntersectsPoly ¶
func (*MultiLineString) IntersectsRect ¶
func (*MultiLineString) JSON ¶
func (g *MultiLineString) JSON() string
func (*MultiLineString) MarshalJSON ¶ added in v1.1.0
func (g *MultiLineString) MarshalJSON() ([]byte, error)
func (*MultiLineString) Members ¶ added in v1.4.0
func (g *MultiLineString) Members() string
func (*MultiLineString) String ¶
func (g *MultiLineString) String() string
func (*MultiLineString) Valid ¶
func (g *MultiLineString) Valid() bool
func (*MultiLineString) WithinLine ¶
func (*MultiLineString) WithinPoint ¶
func (*MultiLineString) WithinPoly ¶
func (*MultiLineString) WithinRect ¶
type MultiPoint ¶
type MultiPoint struct {
// contains filtered or unexported fields
}
func NewMultiPoint ¶
func NewMultiPoint(points []geometry.Point) *MultiPoint
func (*MultiPoint) AppendJSON ¶
func (g *MultiPoint) AppendJSON(dst []byte) []byte
func (*MultiPoint) DistanceLine ¶
func (*MultiPoint) DistancePoint ¶
func (*MultiPoint) DistancePoly ¶
func (*MultiPoint) DistanceRect ¶
func (*MultiPoint) Intersects ¶
func (*MultiPoint) IntersectsLine ¶
func (*MultiPoint) IntersectsPoint ¶
func (*MultiPoint) IntersectsPoly ¶
func (*MultiPoint) IntersectsRect ¶
func (*MultiPoint) JSON ¶
func (g *MultiPoint) JSON() string
func (*MultiPoint) MarshalJSON ¶ added in v1.1.0
func (g *MultiPoint) MarshalJSON() ([]byte, error)
func (*MultiPoint) Members ¶ added in v1.4.0
func (g *MultiPoint) Members() string
func (*MultiPoint) String ¶
func (g *MultiPoint) String() string
func (*MultiPoint) WithinLine ¶
func (*MultiPoint) WithinPoint ¶
func (*MultiPoint) WithinPoly ¶
func (*MultiPoint) WithinRect ¶
type MultiPolygon ¶
type MultiPolygon struct {
// contains filtered or unexported fields
}
func NewMultiPolygon ¶
func NewMultiPolygon(polys []*geometry.Poly) *MultiPolygon
func (*MultiPolygon) AppendJSON ¶
func (g *MultiPolygon) AppendJSON(dst []byte) []byte
func (*MultiPolygon) DistanceLine ¶
func (*MultiPolygon) DistancePoint ¶
func (*MultiPolygon) DistancePoly ¶
func (*MultiPolygon) DistanceRect ¶
func (*MultiPolygon) Intersects ¶
func (*MultiPolygon) IntersectsLine ¶
func (*MultiPolygon) IntersectsPoint ¶
func (*MultiPolygon) IntersectsPoly ¶
func (*MultiPolygon) IntersectsRect ¶
func (*MultiPolygon) JSON ¶
func (g *MultiPolygon) JSON() string
func (*MultiPolygon) MarshalJSON ¶ added in v1.1.0
func (g *MultiPolygon) MarshalJSON() ([]byte, error)
func (*MultiPolygon) Members ¶ added in v1.4.0
func (g *MultiPolygon) Members() string
func (*MultiPolygon) String ¶
func (g *MultiPolygon) String() string
func (*MultiPolygon) Valid ¶
func (g *MultiPolygon) Valid() bool
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) Members() string }
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 // AllowRects options will force to parse and return the Rect type when a // geojson polygon only consists of a perfect rectangle, where there are // exactly 5 points with the first point being the min x/y and the // following point winding counter clockwise creating a closed rectangle. AllowRects bool }
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func (*Point) AppendJSON ¶
func (*Point) Intersects ¶
func (*Point) IsSimple ¶ added in v1.3.6
IsSimple returns true if the Point can be converted to a SimplePoint
func (*Point) MarshalJSON ¶ added in v1.1.0
type Polygon ¶
type Polygon struct {
// contains filtered or unexported fields
}
func NewPolygon ¶
func (*Polygon) AppendJSON ¶
func (*Polygon) Intersects ¶
func (*Polygon) MarshalJSON ¶ added in v1.1.0
type Rect ¶
type Rect struct {
// contains filtered or unexported fields
}
func (*Rect) AppendJSON ¶
func (*Rect) Intersects ¶
func (*Rect) MarshalJSON ¶ added in v1.1.0
type SimplePoint ¶ added in v1.1.1
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
func (*SimplePoint) Base ¶ added in v1.1.1
func (g *SimplePoint) Base() geometry.Point
func (*SimplePoint) Center ¶ added in v1.1.1
func (g *SimplePoint) Center() geometry.Point
func (*SimplePoint) Contains ¶ added in v1.1.1
func (g *SimplePoint) Contains(obj Object) bool
func (*SimplePoint) Distance ¶ added in v1.1.1
func (g *SimplePoint) Distance(obj Object) float64
func (*SimplePoint) DistanceLine ¶ added in v1.1.1
func (g *SimplePoint) DistanceLine(line *geometry.Line) float64
func (*SimplePoint) DistancePoint ¶ added in v1.1.1
func (g *SimplePoint) DistancePoint(point geometry.Point) float64
func (*SimplePoint) DistancePoly ¶ added in v1.1.1
func (g *SimplePoint) DistancePoly(poly *geometry.Poly) float64
func (*SimplePoint) DistanceRect ¶ added in v1.1.1
func (g *SimplePoint) DistanceRect(rect geometry.Rect) float64
func (*SimplePoint) Empty ¶ added in v1.1.1
func (g *SimplePoint) Empty() bool
func (*SimplePoint) ForEach ¶ added in v1.1.1
func (g *SimplePoint) ForEach(iter func(geom Object) bool) bool
func (*SimplePoint) Intersects ¶ added in v1.1.1
func (g *SimplePoint) Intersects(obj Object) bool
func (*SimplePoint) IntersectsLine ¶ added in v1.1.1
func (g *SimplePoint) IntersectsLine(line *geometry.Line) bool
func (*SimplePoint) IntersectsPoint ¶ added in v1.1.1
func (g *SimplePoint) IntersectsPoint(point geometry.Point) bool
func (*SimplePoint) IntersectsPoly ¶ added in v1.1.1
func (g *SimplePoint) IntersectsPoly(poly *geometry.Poly) bool
func (*SimplePoint) IntersectsRect ¶ added in v1.1.1
func (g *SimplePoint) IntersectsRect(rect geometry.Rect) bool
func (*SimplePoint) JSON ¶ added in v1.1.1
func (g *SimplePoint) JSON() string
func (*SimplePoint) MarshalJSON ¶ added in v1.1.1
func (g *SimplePoint) MarshalJSON() ([]byte, error)
func (*SimplePoint) Members ¶ added in v1.4.0
func (g *SimplePoint) Members() string
func (*SimplePoint) NumPoints ¶ added in v1.1.1
func (g *SimplePoint) NumPoints() int
func (*SimplePoint) Rect ¶ added in v1.1.1
func (g *SimplePoint) Rect() geometry.Rect
func (*SimplePoint) Spatial ¶ added in v1.1.1
func (g *SimplePoint) Spatial() Spatial
func (*SimplePoint) String ¶ added in v1.1.1
func (g *SimplePoint) String() string
func (*SimplePoint) Valid ¶ added in v1.1.1
func (g *SimplePoint) Valid() bool
func (*SimplePoint) Within ¶ added in v1.1.1
func (g *SimplePoint) Within(obj Object) bool
func (*SimplePoint) WithinLine ¶ added in v1.1.1
func (g *SimplePoint) WithinLine(line *geometry.Line) bool
func (*SimplePoint) WithinPoint ¶ added in v1.1.1
func (g *SimplePoint) WithinPoint(point geometry.Point) bool
func (*SimplePoint) WithinPoly ¶ added in v1.1.1
func (g *SimplePoint) WithinPoly(poly *geometry.Poly) bool
func (*SimplePoint) WithinRect ¶ added in v1.1.1
func (g *SimplePoint) WithinRect(rect geometry.Rect) bool
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 }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.