Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
Spatial C++ Library is a generic header-only C++ library providing multi-dimensional in-memory containers, iterators and functionals. It is a general purpose library with good overall performance that makes it simple to search for nearest neighors, orthogonal ranges, or perform ordering of objects in any number of dimensions.
Spatial's design borrows heavily from the STL, and strives to follow it's elegant interface; therefore Spatial's containers, iterators and functionals integrate well with the STL. Additionally, Spatial implements self-balancing k-d tree-based containers, capable of object insertion in logarithmic amortized time and removal in fractional amortized time. Given that the tree is always mostly balanced, this prevents worst-case computational time on most spatial operation.
Spatial was created with tracking analysis and real-time positioning in mind, but its good overall performance and its set of algorithms should make it as simple for anyone to do spatial analysis in their application as using STL's
A brief overview of Spatial's features is provided below:
std::ptrdiff_t(and sometimes 1 extra
std::size_t) of overhead per node
Spatial provides what is generally needed to get you started on simple spatial analysis. Check out Quick Starting Guide to get you started on using Spatial.
ZIP packages are available at the Project Page on Sourceforge.
Packages on the Project Download Page on Sourceforge include the entire content of the source. Documentation files are only included in the
If you have a Git client and which to use this instead of the packages, you can clone the repository using the following command:
The above will only give you readonly access. If you wish to become a full-time contributor, check out Contributing.
Spatial C++ Library's currently lacks of a proper documentation and set of examples. However the current library's API is considered stable since there are currently no foreseen development in plan that should cause it to change. Work is in progress to put the documentation on par with the source.
Spatial C++ Library is estimated by its author to be production-ready. The library is consistently unit tested, with unit tests covering more than 90% of it's current source code, so it should behave as expected.
Spatial's unit test suite should compile without error or warning (even on highest warning levels) and execute without errors on the following compilers:
Spatial has not been tested on other compilers or other architectures. Any feedback in this regard is greatly appreciated.
Spatial C++ library was inspired from libkdtree++, and aims at providing a library that retains all the great benefits of libkdtree++ while broadening its horizons. It is through the informative feedback of its maintainers and its community that the design principles for this library have emerged.
Spatial, however, is a complete rewrite and shares none of its sources in common with libkdtree++.
Spatial C++ Library is provided under the term of the Boost license. Alternatively, see the file
COPYING provided with your copy of the library.
You can ask for support on the general mailing list of the library: email@example.com@firstname.lastname@example.org@m.ists.nosp@m..email@example.com@firstname.lastname@example.org.