How does a geospatial index work?

Scott Hyndman picture Scott Hyndman · Jan 2, 2011 · Viewed 12.1k times · Source

I'm wondering how a geospatial index, such as the one used by MongoDB, works. Can anyone explain what data structure/algorithm is used internally? What time complexity does a search run in?

Links to resources would be great too.

Answer

codekaizen picture codekaizen · Jan 2, 2011

Depending on the data type and usage pattern, either an R-Tree or variant (R*, R+) or a quadtree or perhaps even a kd-tree.