Documentation ¶
Overview ¶
Package poly provides polygon detection methods.
Index ¶
- type Point
- type Polygon
- func (shape Polygon) Inside(exterior Polygon, holes []Polygon) bool
- func (p Polygon) InsideRect(rect Rect) bool
- func (shape Polygon) Intersects(exterior Polygon, holes []Polygon) bool
- func (p Polygon) IntersectsRect(rect Rect) bool
- func (shape Polygon) LineStringIntersects(exterior Polygon, holes []Polygon) bool
- func (shape Polygon) LineStringIntersectsLineString(exterior Polygon) bool
- func (p Polygon) Rect() Rect
- func (p Polygon) String() string
- type Rect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Point ¶
type Point struct {
X, Y, Z float64
}
Point is simple 2D point
func (Point) Inside ¶
Inside returns true if point is inside of exterior and not in a hole. The validity of the exterior and holes must be done elsewhere and are assumed valid.
A valid exterior is a near-linear ring. A valid hole is one that is full contained inside the exterior. A valid hole may not share the same segment line as the exterior.
func (Point) InsideRect ¶
InsideRect detects point is inside of another rect
func (Point) Intersects ¶
Intersects detects if a point intersects another polygon
func (Point) IntersectsLineString ¶
IntersectsLineString detect if a point intersects a linestring
type Polygon ¶
type Polygon []Point
Polygon is series of points that make up a polygon
func (Polygon) InsideRect ¶
InsideRect detects polygon is inside of another rect
func (Polygon) Intersects ¶
Intersects detects if a polygon intersects another polygon
func (Polygon) IntersectsRect ¶
IntersectsRect detects polygon is inside of another rect
func (Polygon) LineStringIntersects ¶
LineStringIntersects detects if a polygon intersects a linestring assume shape is a linestring
func (Polygon) LineStringIntersectsLineString ¶
LineStringIntersectsLineString detects if a linestring intersects a linestring assume shape and exterior are actually linestrings
type Rect ¶
type Rect struct {
Min, Max Point
}
Rect is rectangle
func (Rect) InsideRect ¶
InsideRect detects rect is inside of another rect
func (Rect) Intersects ¶
Intersects detects if a rect intersects another polygon
func (Rect) IntersectsRect ¶
IntersectsRect detects if two bboxes intersect.