qtree

package
v0.0.0-...-0008b12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2016 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package qtree implements a very simple QuadTree for spatial searching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuadTree

type QuadTree struct {
	// contains filtered or unexported fields
}

func New

func New(capacity uint64, xmin, xmax, ymin, ymax float64) (*QuadTree, error)

New returns a usable QuadTree with a capacity at each node of capacity. It covers the extent defined by xmin, xmax, ymin, ymax

func (*QuadTree) Insert

func (q *QuadTree) Insert(i uint64, x, y float64) bool

Insert adds a point to the QuadTree. The point consists of an x, y coordinate and an id, which is assumed to be unique.

func (*QuadTree) Query

func (q *QuadTree) Query(xmin, xmax, ymin, ymax float64) []uint64

Query returns a list of unique ids of points that lie within pages that intersect the minimum bounding rectangle defined by xmin, xmax, ymin, ymax. Note that some points will not intersect the MBR exactly, and that the returned slice is to be considered 'unordered'.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL