volkerp / goquadtree

A simple quad-tree implementation in golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

A quad-tree is a geometrical data structure which offers fast axis aligned range queries (i.e. bounding-box queries) on sets of rectangles and points.

goquadtree is a simple 2D implementation in golang to be used as a golang package.

Depending on size and distribution of data a query may be in orders of magnitudes faster than a linear search.

From the included benchmarks:

BenchmarkRectsQuadtree               100          11309510 ns/op
BenchmarkRectsLinear                   5         407917200 ns/op
BenchmarkPointsQuadtree            50000             51042 ns/op
BenchmarkPointsLinear                  5         407603000 ns/op

Usage

The included tests and benchmarks give an example on how to use the package.

About

A simple quad-tree implementation in golang


Languages

Language:Go 100.0%