Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Finder ¶
type Finder[T constraints.Unsigned] struct { // contains filtered or unexported fields }
Finder is a collection polygons with associated integer ids The ids do not have to be unique (multiple polygons can share an id) Searching for a polygon containing a point is optimized by creating an RTree of bounding boxes, and then searching candidates within matching bounding boxes
func NewFinder ¶
func NewFinder[T constraints.Unsigned]() *Finder[T]
NewFinder returns a Finder for finding a containing polygon
func (*Finder[T]) Search ¶
func (s *Finder[T]) Dump() {
t := s.tree
for i, r := range t.Children() {
fmt.Printf("%2d %v\n", i, r)
if i > 10 {
break
}
}
}
Search returns the id of the polygon that contains the given point If polygons are searchable, it returns the id of the closest polygon and the distance away
If not found and no search index, it returns -1
type PPoints ¶
type PPoints []Pair
func (PPoints) ContainsPoint ¶
ContainsPoint returns true if the point is within the polygon
type PolyPoints ¶
type PolyPoints []PolyPoint
func (PolyPoints) IndexPoint ¶
func (pp PolyPoints) IndexPoint(i int) Point
func (PolyPoints) Len ¶
func (pp PolyPoints) Len() int
func (PolyPoints) Size ¶
func (pp PolyPoints) Size() int
Click to show internal directories.
Click to hide internal directories.