diff --git a/index/example/serialize.cpp b/index/example/serialize.cpp new file mode 100644 index 000000000..504667a26 --- /dev/null +++ b/index/example/serialize.cpp @@ -0,0 +1,57 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// WARNING! This code is not fully functional! + +#include +#include + +#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL +#include + +#include +#include + +#include + +namespace boost { namespace serialization { + + + +}} // namespace boost::serialization + +int main() +{ + namespace bg = boost::geometry; + namespace bgi = bg::index; + + typedef bg::model::point P; + typedef bg::model::box

B; + typedef bgi::rtree > RT; + //typedef bgi::rtree > RT; + //typedef bgi::rtree > RT; + + RT tree; + + //insert values + { + for ( double x = 0 ; x < 100 ; x += 10 ) + for ( double y = 0 ; y < 100 ; y += 10 ) + tree.insert(B(P(x, y), P(x+1, y+1))); + } + + // save + { + std::ofstream ofs("filename", std::ios::binary); + boost::archive::binary_oarchive oa(ofs); + oa << tree; + } + + return 0; +}