Skip to content
A tree datastructure to store s2 cells and perform fast point in polygons lookup
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
testdata
.drone.yml
.gitignore
LICENSE
README.md
tree.go
tree_test.go

README.md

Build Status

insidetree

This datastructure is specialized in indexing S2 cells to perform stab queries (Point in Polygons).

For explanations about s2 and the tree used in this package look at this great blogpost

It's an alternative of using an interval tree like in this other project exposed in this blogpost.

tree := NewTree()

// index you cells using Index()
tree.Index(cell, "Red building")

// test for cell of any levels 
insideCell := s2.CellIDFromLatLng(s2.LatLngFromDegrees(46.83808, -71.28046))
results := tree.Stab(insideCell)
// results[0] == "Red Building"
You can’t perform that action at this time.