Documentation ¶
Index ¶
- func BoundsFromCenter(lat, lon, meters float64) (latMin, lonMin, latMax, lonMax float64)
- func SegmentIntersectsCircle(start, end, center Position, meters float64) bool
- type BBox
- type Feature
- func (g Feature) Bytes() []byte
- func (g Feature) CalculatedBBox() BBox
- func (g Feature) CalculatedPoint() Position
- func (g Feature) Clipped(bbox BBox) Object
- func (g Feature) Geohash(precision int) (string, error)
- func (g Feature) Intersects(o Object) bool
- func (g Feature) IntersectsBBox(bbox BBox) bool
- func (g Feature) IntersectsCircle(center Position, meters float64) bool
- func (g Feature) IsBBoxDefined() bool
- func (g Feature) IsGeometry() bool
- func (g Feature) JSON() string
- func (g Feature) MarshalJSON() ([]byte, error)
- func (g Feature) Nearby(center Position, meters float64) bool
- func (g Feature) PositionCount() int
- func (g Feature) String() string
- func (g Feature) Weight() int
- func (g Feature) Within(o Object) bool
- func (g Feature) WithinBBox(bbox BBox) bool
- func (g Feature) WithinCircle(center Position, meters float64) bool
- type FeatureCollection
- func (g FeatureCollection) Bytes() []byte
- func (g FeatureCollection) CalculatedBBox() BBox
- func (g FeatureCollection) CalculatedPoint() Position
- func (g FeatureCollection) Clipped(bbox BBox) Object
- func (g FeatureCollection) Geohash(precision int) (string, error)
- func (g FeatureCollection) Intersects(o Object) bool
- func (g FeatureCollection) IntersectsBBox(bbox BBox) bool
- func (g FeatureCollection) IntersectsCircle(center Position, meters float64) bool
- func (g FeatureCollection) IsBBoxDefined() bool
- func (g FeatureCollection) IsGeometry() bool
- func (g FeatureCollection) JSON() string
- func (g FeatureCollection) MarshalJSON() ([]byte, error)
- func (g FeatureCollection) Nearby(center Position, meters float64) bool
- func (g FeatureCollection) PositionCount() int
- func (g FeatureCollection) String() string
- func (g FeatureCollection) Weight() int
- func (g FeatureCollection) Within(o Object) bool
- func (g FeatureCollection) WithinBBox(bbox BBox) bool
- func (g FeatureCollection) WithinCircle(center Position, meters float64) bool
- type GeometryCollection
- func (g GeometryCollection) Bytes() []byte
- func (g GeometryCollection) CalculatedBBox() BBox
- func (g GeometryCollection) CalculatedPoint() Position
- func (g GeometryCollection) Clipped(bbox BBox) Object
- func (g GeometryCollection) Geohash(precision int) (string, error)
- func (g GeometryCollection) Intersects(o Object) bool
- func (g GeometryCollection) IntersectsBBox(bbox BBox) bool
- func (g GeometryCollection) IntersectsCircle(center Position, meters float64) bool
- func (g GeometryCollection) IsBBoxDefined() bool
- func (g GeometryCollection) IsGeometry() bool
- func (g GeometryCollection) JSON() string
- func (g GeometryCollection) MarshalJSON() ([]byte, error)
- func (g GeometryCollection) Nearby(center Position, meters float64) bool
- func (g GeometryCollection) PositionCount() int
- func (g GeometryCollection) String() string
- func (g GeometryCollection) Weight() int
- func (g GeometryCollection) Within(o Object) bool
- func (g GeometryCollection) WithinBBox(bbox BBox) bool
- func (g GeometryCollection) WithinCircle(center Position, meters float64) bool
- type LineString
- func (g LineString) CalculatedBBox() BBox
- func (g LineString) CalculatedPoint() Position
- func (g LineString) Clipped(bbox BBox) Object
- func (g LineString) Geohash(precision int) (string, error)
- func (g LineString) Intersects(o Object) bool
- func (g LineString) IntersectsBBox(bbox BBox) bool
- func (g LineString) IntersectsCircle(center Position, meters float64) bool
- func (g LineString) IsBBoxDefined() bool
- func (g LineString) IsGeometry() bool
- func (g LineString) JSON() string
- func (g LineString) MarshalJSON() ([]byte, error)
- func (g LineString) Nearby(center Position, meters float64) bool
- func (g LineString) PositionCount() int
- func (g LineString) String() string
- func (g LineString) Weight() int
- func (g LineString) Within(o Object) bool
- func (g LineString) WithinBBox(bbox BBox) bool
- func (g LineString) WithinCircle(center Position, meters float64) bool
- type MultiLineString
- func (g MultiLineString) CalculatedBBox() BBox
- func (g MultiLineString) CalculatedPoint() Position
- func (g MultiLineString) Clipped(bbox BBox) Object
- func (g MultiLineString) Geohash(precision int) (string, error)
- func (g MultiLineString) Intersects(o Object) bool
- func (g MultiLineString) IntersectsBBox(bbox BBox) bool
- func (g MultiLineString) IntersectsCircle(center Position, meters float64) bool
- func (g MultiLineString) IsBBoxDefined() bool
- func (g MultiLineString) IsGeometry() bool
- func (g MultiLineString) JSON() string
- func (g MultiLineString) MarshalJSON() ([]byte, error)
- func (g MultiLineString) Nearby(center Position, meters float64) bool
- func (g MultiLineString) PositionCount() int
- func (g MultiLineString) String() string
- func (g MultiLineString) Weight() int
- func (g MultiLineString) Within(o Object) bool
- func (g MultiLineString) WithinBBox(bbox BBox) bool
- func (g MultiLineString) WithinCircle(center Position, meters float64) bool
- type MultiPoint
- func (g MultiPoint) CalculatedBBox() BBox
- func (g MultiPoint) CalculatedPoint() Position
- func (g MultiPoint) Clipped(bbox BBox) Object
- func (g MultiPoint) Geohash(precision int) (string, error)
- func (g MultiPoint) Intersects(o Object) bool
- func (g MultiPoint) IntersectsBBox(bbox BBox) bool
- func (g MultiPoint) IntersectsCircle(center Position, meters float64) bool
- func (g MultiPoint) IsBBoxDefined() bool
- func (g MultiPoint) IsGeometry() bool
- func (g MultiPoint) JSON() string
- func (g MultiPoint) MarshalJSON() ([]byte, error)
- func (g MultiPoint) Nearby(center Position, meters float64) bool
- func (g MultiPoint) PositionCount() int
- func (g MultiPoint) String() string
- func (g MultiPoint) Weight() int
- func (g MultiPoint) Within(o Object) bool
- func (g MultiPoint) WithinBBox(bbox BBox) bool
- func (g MultiPoint) WithinCircle(center Position, meters float64) bool
- type MultiPolygon
- func (g MultiPolygon) CalculatedBBox() BBox
- func (g MultiPolygon) CalculatedPoint() Position
- func (g MultiPolygon) Clipped(bbox BBox) Object
- func (g MultiPolygon) Geohash(precision int) (string, error)
- func (g MultiPolygon) Intersects(o Object) bool
- func (g MultiPolygon) IntersectsBBox(bbox BBox) bool
- func (g MultiPolygon) IntersectsCircle(center Position, meters float64) bool
- func (g MultiPolygon) IsBBoxDefined() bool
- func (g MultiPolygon) IsGeometry() bool
- func (g MultiPolygon) JSON() string
- func (g MultiPolygon) MarshalJSON() ([]byte, error)
- func (g MultiPolygon) Nearby(center Position, meters float64) bool
- func (g MultiPolygon) PositionCount() int
- func (g MultiPolygon) String() string
- func (g MultiPolygon) Weight() int
- func (g MultiPolygon) Within(o Object) bool
- func (g MultiPolygon) WithinBBox(bbox BBox) bool
- func (g MultiPolygon) WithinCircle(center Position, meters float64) bool
- type Object
- type Point
- func (g Point) CalculatedBBox() BBox
- func (g Point) CalculatedPoint() Position
- func (g Point) Clipped(bbox BBox) Object
- func (g Point) Geohash(precision int) (string, error)
- func (g Point) Intersects(o Object) bool
- func (g Point) IntersectsBBox(bbox BBox) bool
- func (g Point) IntersectsCircle(center Position, meters float64) bool
- func (g Point) IsBBoxDefined() bool
- func (g Point) IsGeometry() bool
- func (g Point) JSON() string
- func (g Point) MarshalJSON() ([]byte, error)
- func (g Point) Nearby(center Position, meters float64) bool
- func (g Point) PositionCount() int
- func (g Point) String() string
- func (g Point) Weight() int
- func (g Point) Within(o Object) bool
- func (g Point) WithinBBox(bbox BBox) bool
- func (g Point) WithinCircle(center Position, meters float64) bool
- type Polygon
- func (g Polygon) CalculatedBBox() BBox
- func (g Polygon) CalculatedPoint() Position
- func (g Polygon) Clipped(bbox BBox) Object
- func (g Polygon) Geohash(precision int) (string, error)
- func (g Polygon) Intersects(o Object) bool
- func (g Polygon) IntersectsBBox(bbox BBox) bool
- func (g Polygon) IntersectsCircle(center Position, meters float64) bool
- func (g Polygon) IsBBoxDefined() bool
- func (g Polygon) IsGeometry() bool
- func (g Polygon) JSON() string
- func (g Polygon) MarshalJSON() ([]byte, error)
- func (g Polygon) Nearby(center Position, meters float64) bool
- func (g Polygon) PositionCount() int
- func (g Polygon) String() string
- func (g Polygon) Weight() int
- func (g Polygon) Within(o Object) bool
- func (g Polygon) WithinBBox(bbox BBox) bool
- func (g Polygon) WithinCircle(center Position, meters float64) bool
- type Position
- type SimplePoint
- func (g SimplePoint) CalculatedBBox() BBox
- func (g SimplePoint) CalculatedPoint() Position
- func (g SimplePoint) Clipped(bbox BBox) Object
- func (g SimplePoint) Geohash(precision int) (string, error)
- func (g SimplePoint) Intersects(o Object) bool
- func (g SimplePoint) IntersectsBBox(bbox BBox) bool
- func (g SimplePoint) IntersectsCircle(center Position, meters float64) bool
- func (g SimplePoint) IsBBoxDefined() bool
- func (g SimplePoint) IsGeometry() bool
- func (g SimplePoint) JSON() string
- func (g SimplePoint) MarshalJSON() ([]byte, error)
- func (g SimplePoint) Nearby(center Position, meters float64) bool
- func (g SimplePoint) PositionCount() int
- func (g SimplePoint) String() string
- func (g SimplePoint) Weight() int
- func (g SimplePoint) Within(o Object) bool
- func (g SimplePoint) WithinBBox(bbox BBox) bool
- func (g SimplePoint) WithinCircle(center Position, meters float64) bool
- type String
- func (s String) Bytes() []byte
- func (s String) CalculatedBBox() BBox
- func (s String) CalculatedPoint() Position
- func (s String) Clipped(bbox BBox) Object
- func (s String) Geohash(precision int) (string, error)
- func (s String) Intersects(o Object) bool
- func (s String) IntersectsBBox(bbox BBox) bool
- func (s String) IntersectsCircle(center Position, meters float64) bool
- func (s String) IsBBoxDefined() bool
- func (s String) IsGeometry() bool
- func (s String) JSON() string
- func (s String) MarshalJSON() ([]byte, error)
- func (s String) Nearby(center Position, meters float64) bool
- func (s String) PositionCount() int
- func (s String) String() string
- func (s String) Weight() int
- func (s String) Within(o Object) bool
- func (s String) WithinBBox(bbox BBox) bool
- func (s String) WithinCircle(center Position, meters float64) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoundsFromCenter ¶
BoundsFromCenter calculates the bounding box surrounding a circle.
func SegmentIntersectsCircle ¶
Types ¶
type BBox ¶
BBox is a bounding box
func BBoxesFromCenter ¶
BBoxesFromCenter calculates the bounding box surrounding a circle.
func (BBox) ExternalJSON ¶
ExternalJSON is the simple json representation of the bounding box used for external applications.
type Feature ¶
Feature is a geojson object with the type "Feature"
func (Feature) CalculatedBBox ¶
CalculatedBBox is exterior bbox containing the object.
func (Feature) CalculatedPoint ¶
CalculatedPoint is a point representation of the object.
func (Feature) Intersects ¶
Intersects detects if the object intersects another object.
func (Feature) IntersectsBBox ¶
IntersectsBBox detects if the object intersects a bbox.
func (Feature) IntersectsCircle ¶
IntersectsCircle detects if the object intersects a circle.
func (Feature) IsBBoxDefined ¶
IsBBoxDefined returns true if the object has a defined bbox.
func (Feature) IsGeometry ¶
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (Feature) JSON ¶
JSON is the json representation of the object. This might not be exactly the same as the original.
func (Feature) MarshalJSON ¶
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (Feature) PositionCount ¶
PositionCount return the number of coordinates.
func (Feature) String ¶
String returns a string representation of the object. This might be JSON or something else.
func (Feature) WithinBBox ¶
WithinBBox detects if the object is fully contained inside a bbox.
type FeatureCollection ¶
type FeatureCollection struct { Features []Object BBox *BBox // contains filtered or unexported fields }
FeatureCollection is a geojson object with the type "FeatureCollection"
func (FeatureCollection) Bytes ¶
func (g FeatureCollection) Bytes() []byte
Bytes is the bytes representation of the object.
func (FeatureCollection) CalculatedBBox ¶
func (g FeatureCollection) CalculatedBBox() BBox
CalculatedBBox is exterior bbox containing the object.
func (FeatureCollection) CalculatedPoint ¶
func (g FeatureCollection) CalculatedPoint() Position
CalculatedPoint is a point representation of the object.
func (FeatureCollection) Clipped ¶
func (g FeatureCollection) Clipped(bbox BBox) Object
Clip returns the object obtained by clipping this object by a bbox.
func (FeatureCollection) Geohash ¶
func (g FeatureCollection) Geohash(precision int) (string, error)
Geohash converts the object to a geohash value.
func (FeatureCollection) Intersects ¶
func (g FeatureCollection) Intersects(o Object) bool
Intersects detects if the object intersects another object.
func (FeatureCollection) IntersectsBBox ¶
func (g FeatureCollection) IntersectsBBox(bbox BBox) bool
IntersectsBBox detects if the object intersects a bbox.
func (FeatureCollection) IntersectsCircle ¶
func (g FeatureCollection) IntersectsCircle(center Position, meters float64) bool
IntersectsCircle detects if the object intersects a circle.
func (FeatureCollection) IsBBoxDefined ¶
func (g FeatureCollection) IsBBoxDefined() bool
IsBBoxDefined returns true if the object has a defined bbox.
func (FeatureCollection) IsGeometry ¶
func (g FeatureCollection) IsGeometry() bool
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (FeatureCollection) JSON ¶
func (g FeatureCollection) JSON() string
JSON is the json representation of the object. This might not be exactly the same as the original.
func (FeatureCollection) MarshalJSON ¶
func (g FeatureCollection) MarshalJSON() ([]byte, error)
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (FeatureCollection) Nearby ¶
func (g FeatureCollection) Nearby(center Position, meters float64) bool
Nearby detects if the object is nearby a position.
func (FeatureCollection) PositionCount ¶
func (g FeatureCollection) PositionCount() int
PositionCount return the number of coordinates.
func (FeatureCollection) String ¶
func (g FeatureCollection) String() string
String returns a string representation of the object. This might be JSON or something else.
func (FeatureCollection) Weight ¶
func (g FeatureCollection) Weight() int
Weight returns the in-memory size of the object.
func (FeatureCollection) Within ¶
func (g FeatureCollection) Within(o Object) bool
Within detects if the object is fully contained inside another object.
func (FeatureCollection) WithinBBox ¶
func (g FeatureCollection) WithinBBox(bbox BBox) bool
WithinBBox detects if the object is fully contained inside a bbox.
func (FeatureCollection) WithinCircle ¶
func (g FeatureCollection) WithinCircle(center Position, meters float64) bool
WithinCircle detects if the object is fully contained inside a circle.
type GeometryCollection ¶
type GeometryCollection struct { Geometries []Object BBox *BBox // contains filtered or unexported fields }
GeometryCollection is a geojson object with the type "GeometryCollection"
func (GeometryCollection) Bytes ¶
func (g GeometryCollection) Bytes() []byte
Bytes is the bytes representation of the object.
func (GeometryCollection) CalculatedBBox ¶
func (g GeometryCollection) CalculatedBBox() BBox
CalculatedBBox is exterior bbox containing the object.
func (GeometryCollection) CalculatedPoint ¶
func (g GeometryCollection) CalculatedPoint() Position
CalculatedPoint is a point representation of the object.
func (GeometryCollection) Clipped ¶
func (g GeometryCollection) Clipped(bbox BBox) Object
Clip returns the object of the same type as this object, clipped by a bbox.
func (GeometryCollection) Geohash ¶
func (g GeometryCollection) Geohash(precision int) (string, error)
Geohash converts the object to a geohash value.
func (GeometryCollection) Intersects ¶
func (g GeometryCollection) Intersects(o Object) bool
Intersects detects if the object intersects another object.
func (GeometryCollection) IntersectsBBox ¶
func (g GeometryCollection) IntersectsBBox(bbox BBox) bool
IntersectsBBox detects if the object intersects a bbox.
func (GeometryCollection) IntersectsCircle ¶
func (g GeometryCollection) IntersectsCircle(center Position, meters float64) bool
IntersectsCircle detects if the object intersects a circle.
func (GeometryCollection) IsBBoxDefined ¶
func (g GeometryCollection) IsBBoxDefined() bool
IsBBoxDefined returns true if the object has a defined bbox.
func (GeometryCollection) IsGeometry ¶
func (g GeometryCollection) IsGeometry() bool
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (GeometryCollection) JSON ¶
func (g GeometryCollection) JSON() string
JSON is the json representation of the object. This might not be exactly the same as the original.
func (GeometryCollection) MarshalJSON ¶
func (g GeometryCollection) MarshalJSON() ([]byte, error)
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (GeometryCollection) Nearby ¶
func (g GeometryCollection) Nearby(center Position, meters float64) bool
Nearby detects if the object is nearby a position.
func (GeometryCollection) PositionCount ¶
func (g GeometryCollection) PositionCount() int
PositionCount return the number of coordinates.
func (GeometryCollection) String ¶
func (g GeometryCollection) String() string
String returns a string representation of the object. This might be JSON or something else.
func (GeometryCollection) Weight ¶
func (g GeometryCollection) Weight() int
Weight returns the in-memory size of the object.
func (GeometryCollection) Within ¶
func (g GeometryCollection) Within(o Object) bool
Within detects if the object is fully contained inside another object.
func (GeometryCollection) WithinBBox ¶
func (g GeometryCollection) WithinBBox(bbox BBox) bool
WithinBBox detects if the object is fully contained inside a bbox.
func (GeometryCollection) WithinCircle ¶
func (g GeometryCollection) WithinCircle(center Position, meters float64) bool
WithinCircle detects if the object is fully contained inside a circle.
type LineString ¶
type LineString struct { Coordinates []Position BBox *BBox // contains filtered or unexported fields }
LineString is a geojson object with the type "LineString"
func (LineString) CalculatedBBox ¶
func (g LineString) CalculatedBBox() BBox
CalculatedBBox is exterior bbox containing the object.
func (LineString) CalculatedPoint ¶
func (g LineString) CalculatedPoint() Position
CalculatedPoint is a point representation of the object.
func (LineString) Clipped ¶
func (g LineString) Clipped(bbox BBox) Object
Clip returns the object obtained by clipping this object by a bbox.
func (LineString) Geohash ¶
func (g LineString) Geohash(precision int) (string, error)
Geohash converts the object to a geohash value.
func (LineString) Intersects ¶
func (g LineString) Intersects(o Object) bool
Intersects detects if the object intersects another object.
func (LineString) IntersectsBBox ¶
func (g LineString) IntersectsBBox(bbox BBox) bool
IntersectsBBox detects if the object intersects a bbox.
func (LineString) IntersectsCircle ¶
func (g LineString) IntersectsCircle(center Position, meters float64) bool
IntersectsCircle detects if the object intersects a circle.
func (LineString) IsBBoxDefined ¶
func (g LineString) IsBBoxDefined() bool
IsBBoxDefined returns true if the object has a defined bbox.
func (LineString) IsGeometry ¶
func (g LineString) IsGeometry() bool
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (LineString) JSON ¶
func (g LineString) JSON() string
JSON is the json representation of the object. This might not be exactly the same as the original.
func (LineString) MarshalJSON ¶
func (g LineString) MarshalJSON() ([]byte, error)
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (LineString) Nearby ¶
func (g LineString) Nearby(center Position, meters float64) bool
Nearby detects if the object is nearby a position.
func (LineString) PositionCount ¶
func (g LineString) PositionCount() int
PositionCount return the number of coordinates.
func (LineString) String ¶
func (g LineString) String() string
String returns a string representation of the object. This might be JSON or something else.
func (LineString) Weight ¶
func (g LineString) Weight() int
Weight returns the in-memory size of the object.
func (LineString) Within ¶
func (g LineString) Within(o Object) bool
Within detects if the object is fully contained inside another object.
func (LineString) WithinBBox ¶
func (g LineString) WithinBBox(bbox BBox) bool
WithinBBox detects if the object is fully contained inside a bbox.
func (LineString) WithinCircle ¶
func (g LineString) WithinCircle(center Position, meters float64) bool
WithinCircle detects if the object is fully contained inside a circle.
type MultiLineString ¶
type MultiLineString struct { Coordinates [][]Position BBox *BBox // contains filtered or unexported fields }
MultiLineString is a geojson object with the type "MultiLineString"
func (MultiLineString) CalculatedBBox ¶
func (g MultiLineString) CalculatedBBox() BBox
CalculatedBBox is exterior bbox containing the object.
func (MultiLineString) CalculatedPoint ¶
func (g MultiLineString) CalculatedPoint() Position
CalculatedPoint is a point representation of the object.
func (MultiLineString) Clipped ¶
func (g MultiLineString) Clipped(bbox BBox) Object
Clip returns the object obtained by clipping this object by a bbox.
func (MultiLineString) Geohash ¶
func (g MultiLineString) Geohash(precision int) (string, error)
Geohash converts the object to a geohash value.
func (MultiLineString) Intersects ¶
func (g MultiLineString) Intersects(o Object) bool
Intersects detects if the object intersects another object.
func (MultiLineString) IntersectsBBox ¶
func (g MultiLineString) IntersectsBBox(bbox BBox) bool
IntersectsBBox detects if the object intersects a bbox.
func (MultiLineString) IntersectsCircle ¶
func (g MultiLineString) IntersectsCircle(center Position, meters float64) bool
IntersectsCircle detects if the object intersects a circle.
func (MultiLineString) IsBBoxDefined ¶
func (g MultiLineString) IsBBoxDefined() bool
IsBBoxDefined returns true if the object has a defined bbox.
func (MultiLineString) IsGeometry ¶
func (g MultiLineString) IsGeometry() bool
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (MultiLineString) JSON ¶
func (g MultiLineString) JSON() string
JSON is the json representation of the object. This might not be exactly the same as the original.
func (MultiLineString) MarshalJSON ¶
func (g MultiLineString) MarshalJSON() ([]byte, error)
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (MultiLineString) Nearby ¶
func (g MultiLineString) Nearby(center Position, meters float64) bool
Nearby detects if the object is nearby a position.
func (MultiLineString) PositionCount ¶
func (g MultiLineString) PositionCount() int
PositionCount return the number of coordinates.
func (MultiLineString) String ¶
func (g MultiLineString) String() string
String returns a string representation of the object. This might be JSON or something else.
func (MultiLineString) Weight ¶
func (g MultiLineString) Weight() int
Weight returns the in-memory size of the object.
func (MultiLineString) Within ¶
func (g MultiLineString) Within(o Object) bool
Within detects if the object is fully contained inside another object.
func (MultiLineString) WithinBBox ¶
func (g MultiLineString) WithinBBox(bbox BBox) bool
WithinBBox detects if the object is fully contained inside a bbox.
func (MultiLineString) WithinCircle ¶
func (g MultiLineString) WithinCircle(center Position, meters float64) bool
WithinCircle detects if the object is fully contained inside a circle.
type MultiPoint ¶
type MultiPoint struct { Coordinates []Position BBox *BBox // contains filtered or unexported fields }
MultiPoint is a geojson object with the type "MultiPoint"
func (MultiPoint) CalculatedBBox ¶
func (g MultiPoint) CalculatedBBox() BBox
CalculatedBBox is exterior bbox containing the object.
func (MultiPoint) CalculatedPoint ¶
func (g MultiPoint) CalculatedPoint() Position
CalculatedPoint is a point representation of the object.
func (MultiPoint) Clipped ¶
func (g MultiPoint) Clipped(bbox BBox) Object
Clip returns the object obtained by clipping this object by a bbox.
func (MultiPoint) Geohash ¶
func (g MultiPoint) Geohash(precision int) (string, error)
Geohash converts the object to a geohash value.
func (MultiPoint) Intersects ¶
func (g MultiPoint) Intersects(o Object) bool
Intersects detects if the object intersects another object.
func (MultiPoint) IntersectsBBox ¶
func (g MultiPoint) IntersectsBBox(bbox BBox) bool
IntersectsBBox detects if the object intersects a bbox.
func (MultiPoint) IntersectsCircle ¶
func (g MultiPoint) IntersectsCircle(center Position, meters float64) bool
IntersectsCircle detects if the object intersects a circle.
func (MultiPoint) IsBBoxDefined ¶
func (g MultiPoint) IsBBoxDefined() bool
IsBBoxDefined returns true if the object has a defined bbox.
func (MultiPoint) IsGeometry ¶
func (g MultiPoint) IsGeometry() bool
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (MultiPoint) JSON ¶
func (g MultiPoint) JSON() string
JSON is the json representation of the object. This might not be exactly the same as the original.
func (MultiPoint) MarshalJSON ¶
func (g MultiPoint) MarshalJSON() ([]byte, error)
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (MultiPoint) Nearby ¶
func (g MultiPoint) Nearby(center Position, meters float64) bool
Nearby detects if the object is nearby a position.
func (MultiPoint) PositionCount ¶
func (g MultiPoint) PositionCount() int
PositionCount return the number of coordinates.
func (MultiPoint) String ¶
func (g MultiPoint) String() string
String returns a string representation of the object. This might be JSON or something else.
func (MultiPoint) Weight ¶
func (g MultiPoint) Weight() int
Weight returns the in-memory size of the object.
func (MultiPoint) Within ¶
func (g MultiPoint) Within(o Object) bool
Within detects if the object is fully contained inside another object.
func (MultiPoint) WithinBBox ¶
func (g MultiPoint) WithinBBox(bbox BBox) bool
WithinBBox detects if the object is fully contained inside a bbox.
func (MultiPoint) WithinCircle ¶
func (g MultiPoint) WithinCircle(center Position, meters float64) bool
WithinCircle detects if the object is fully contained inside a circle.
type MultiPolygon ¶
type MultiPolygon struct { Coordinates [][][]Position BBox *BBox // contains filtered or unexported fields }
MultiPolygon is a geojson object with the type "MultiPolygon"
func (MultiPolygon) CalculatedBBox ¶
func (g MultiPolygon) CalculatedBBox() BBox
CalculatedBBox is exterior bbox containing the object.
func (MultiPolygon) CalculatedPoint ¶
func (g MultiPolygon) CalculatedPoint() Position
CalculatedPoint is a point representation of the object.
func (MultiPolygon) Clipped ¶
func (g MultiPolygon) Clipped(bbox BBox) Object
Clip returns the object obtained by clipping this object by a bbox.
func (MultiPolygon) Geohash ¶
func (g MultiPolygon) Geohash(precision int) (string, error)
Geohash converts the object to a geohash value.
func (MultiPolygon) Intersects ¶
func (g MultiPolygon) Intersects(o Object) bool
Intersects detects if the object intersects another object.
func (MultiPolygon) IntersectsBBox ¶
func (g MultiPolygon) IntersectsBBox(bbox BBox) bool
IntersectsBBox detects if the object intersects a bbox.
func (MultiPolygon) IntersectsCircle ¶
func (g MultiPolygon) IntersectsCircle(center Position, meters float64) bool
IntersectsCircle detects if the object intersects a circle.
func (MultiPolygon) IsBBoxDefined ¶
func (g MultiPolygon) IsBBoxDefined() bool
IsBBoxDefined returns true if the object has a defined bbox.
func (MultiPolygon) IsGeometry ¶
func (g MultiPolygon) IsGeometry() bool
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (MultiPolygon) JSON ¶
func (g MultiPolygon) JSON() string
JSON is the json representation of the object. This might not be exactly the same as the original.
func (MultiPolygon) MarshalJSON ¶
func (g MultiPolygon) MarshalJSON() ([]byte, error)
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (MultiPolygon) Nearby ¶
func (g MultiPolygon) Nearby(center Position, meters float64) bool
Nearby detects if the object is nearby a position.
func (MultiPolygon) PositionCount ¶
func (g MultiPolygon) PositionCount() int
PositionCount return the number of coordinates.
func (MultiPolygon) String ¶
func (g MultiPolygon) String() string
String returns a string representation of the object. This might be JSON or something else.
func (MultiPolygon) Weight ¶
func (g MultiPolygon) Weight() int
Weight returns the in-memory size of the object.
func (MultiPolygon) Within ¶
func (g MultiPolygon) Within(o Object) bool
Within detects if the object is fully contained inside another object.
func (MultiPolygon) WithinBBox ¶
func (g MultiPolygon) WithinBBox(bbox BBox) bool
WithinBBox detects if the object is fully contained inside a bbox.
func (MultiPolygon) WithinCircle ¶
func (g MultiPolygon) WithinCircle(center Position, meters float64) bool
WithinCircle detects if the object is fully contained inside a circle.
type Object ¶
type Object interface { // WithinBBox detects if the object is fully contained inside a bbox. WithinBBox(bbox BBox) bool // IntersectsBBox detects if the object intersects a bbox. IntersectsBBox(bbox BBox) bool // Within detects if the object is fully contained inside another object. Within(o Object) bool // Intersects detects if the object intersects another object. Intersects(o Object) bool // WithinCircle detects if the object is fully contained inside a circle. WithinCircle(center Position, meters float64) bool // IntersectsCircle detects if the object intersects a circle. IntersectsCircle(center Position, meters float64) bool // Nearby detects if the object is nearby a position. Nearby(center Position, meters float64) bool // CalculatedBBox is exterior bbox containing the object. CalculatedBBox() BBox // CalculatedPoint is a point representation of the object. CalculatedPoint() Position // JSON is the json representation of the object. This might not be exactly the same as the original. JSON() string // String returns a string representation of the object. This may be JSON or something else. String() string // PositionCount return the number of coordinates. PositionCount() int // Weight returns the in-memory size of the object. Weight() int // MarshalJSON allows the object to be encoded in json.Marshal calls. MarshalJSON() ([]byte, error) // Geohash converts the object to a geohash value. Geohash(precision int) (string, error) // IsBBoxDefined returns true if the object has a defined bbox. IsBBoxDefined() bool // IsGeometry return true if the object is a geojson geometry object. false if it something else. IsGeometry() bool // Clip returns the object obtained by clipping this object by a bbox. Clipped(bbox BBox) Object // contains filtered or unexported methods }
Object is a geojson object
func ObjectJSON ¶
ObjectJSON parses geojson and returns an Object
type Point ¶
Point is a geojson object with the type "Point"
func (Point) CalculatedBBox ¶
CalculatedBBox is exterior bbox containing the object.
func (Point) CalculatedPoint ¶
CalculatedPoint is a point representation of the object.
func (Point) Intersects ¶
Intersects detects if the object intersects another object.
func (Point) IntersectsBBox ¶
IntersectsBBox detects if the object intersects a bbox.
func (Point) IntersectsCircle ¶
IntersectsCircle detects if the object intersects a circle.
func (Point) IsBBoxDefined ¶
IsBBoxDefined returns true if the object has a defined bbox.
func (Point) IsGeometry ¶
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (Point) JSON ¶
JSON is the json representation of the object. This might not be exactly the same as the original.
func (Point) MarshalJSON ¶
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (Point) PositionCount ¶
PositionCount return the number of coordinates.
func (Point) String ¶
String returns a string representation of the object. This might be JSON or something else.
func (Point) WithinBBox ¶
WithinBBox detects if the object is fully contained inside a bbox.
type Polygon ¶
type Polygon struct { Coordinates [][]Position BBox *BBox // contains filtered or unexported fields }
Polygon is a geojson object with the type "Polygon"
func CirclePolygon ¶
CirclePolygon returns a Polygon around the radius.
func (Polygon) CalculatedBBox ¶
CalculatedBBox is exterior bbox containing the object.
func (Polygon) CalculatedPoint ¶
CalculatedPoint is a point representation of the object.
func (Polygon) Intersects ¶
Intersects detects if the object intersects another object.
func (Polygon) IntersectsBBox ¶
IntersectsBBox detects if the object intersects a bbox.
func (Polygon) IntersectsCircle ¶
IntersectsCircle detects if the object intersects a circle.
func (Polygon) IsBBoxDefined ¶
IsBBoxDefined returns true if the object has a defined bbox.
func (Polygon) IsGeometry ¶
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (Polygon) JSON ¶
JSON is the json representation of the object. This might not be exactly the same as the original.
func (Polygon) MarshalJSON ¶
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (Polygon) PositionCount ¶
PositionCount return the number of coordinates.
func (Polygon) String ¶
String returns a string representation of the object. This might be JSON or something else.
func (Polygon) WithinBBox ¶
WithinBBox detects if the object is fully contained inside a bbox.
type Position ¶
Position is a simple point
func ClipRing ¶
Sutherland-Hodgman Polygon Clipping https://www.cs.helsinki.fi/group/goa/viewing/leikkaus/intro2.html
func ClipSegment ¶
Cohen-Sutherland Line Clipping https://www.cs.helsinki.fi/group/goa/viewing/leikkaus/lineClip.html
func (Position) Destination ¶
Destination calculates a new position based on the distance and bearing.
func (Position) DistanceTo ¶
DistanceTo calculates the distance to a position
func (Position) ExternalJSON ¶
ExternalJSON is the simple json representation of the position used for external applications.
type SimplePoint ¶
type SimplePoint struct {
X, Y float64
}
SimplePoint is a geojson object with the type "Point" and where there coordinate is 2D and there is no bbox.
func (SimplePoint) CalculatedBBox ¶
func (g SimplePoint) CalculatedBBox() BBox
CalculatedBBox is exterior bbox containing the object.
func (SimplePoint) CalculatedPoint ¶
func (g SimplePoint) CalculatedPoint() Position
CalculatedPoint is a point representation of the object.
func (SimplePoint) Clipped ¶
func (g SimplePoint) Clipped(bbox BBox) Object
Clip returns the object obtained by clipping this object by a bbox.
func (SimplePoint) Geohash ¶
func (g SimplePoint) Geohash(precision int) (string, error)
Geohash converts the object to a geohash value.
func (SimplePoint) Intersects ¶
func (g SimplePoint) Intersects(o Object) bool
Intersects detects if the object intersects another object.
func (SimplePoint) IntersectsBBox ¶
func (g SimplePoint) IntersectsBBox(bbox BBox) bool
IntersectsBBox detects if the object intersects a bbox.
func (SimplePoint) IntersectsCircle ¶
func (g SimplePoint) IntersectsCircle(center Position, meters float64) bool
IntersectsCircle detects if the object intersects a circle.
func (SimplePoint) IsBBoxDefined ¶
func (g SimplePoint) IsBBoxDefined() bool
IsBBoxDefined returns true if the object has a defined bbox.
func (SimplePoint) IsGeometry ¶
func (g SimplePoint) IsGeometry() bool
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (SimplePoint) JSON ¶
func (g SimplePoint) JSON() string
JSON is the json representation of the object. This might not be exactly the same as the original.
func (SimplePoint) MarshalJSON ¶
func (g SimplePoint) MarshalJSON() ([]byte, error)
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (SimplePoint) Nearby ¶
func (g SimplePoint) Nearby(center Position, meters float64) bool
Nearby detects if the object is nearby a position.
func (SimplePoint) PositionCount ¶
func (g SimplePoint) PositionCount() int
PositionCount return the number of coordinates.
func (SimplePoint) String ¶
func (g SimplePoint) String() string
String returns a string representation of the object. This might be JSON or something else.
func (SimplePoint) Weight ¶
func (g SimplePoint) Weight() int
Weight returns the in-memory size of the object.
func (SimplePoint) Within ¶
func (g SimplePoint) Within(o Object) bool
Within detects if the object is fully contained inside another object.
func (SimplePoint) WithinBBox ¶
func (g SimplePoint) WithinBBox(bbox BBox) bool
WithinBBox detects if the object is fully contained inside a bbox.
func (SimplePoint) WithinCircle ¶
func (g SimplePoint) WithinCircle(center Position, meters float64) bool
WithinCircle detects if the object is fully contained inside a circle.
type String ¶
type String string
String is a not a geojson object, but just a string
func (String) CalculatedBBox ¶
CalculatedBBox is exterior bbox containing the object.
func (String) CalculatedPoint ¶
CalculatedPoint is a point representation of the object.
func (String) Intersects ¶
Intersects detects if the object intersects another object.
func (String) IntersectsBBox ¶
IntersectsBBox detects if the object intersects a bbox.
func (String) IntersectsCircle ¶
func (String) IsBBoxDefined ¶
IsBBoxDefined returns true if the object has a defined bbox.
func (String) IsGeometry ¶
IsGeometry return true if the object is a geojson geometry object. false if it something else.
func (String) JSON ¶
JSON is the json representation of the object. This might not be exactly the same as the original.
func (String) MarshalJSON ¶
MarshalJSON allows the object to be encoded in json.Marshal calls.
func (String) PositionCount ¶
PositionCount return the number of coordinates.
func (String) String ¶
String returns a string representation of the object. This might be JSON or something else.
func (String) WithinBBox ¶
WithinBBox detects if the object is fully contained inside a bbox.