...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Macro to register a multi_linestring.
The macro BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING registers a multi_linestring such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified type. The multi_linestring may contain template parameters, which must be specified then.
#define BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING(MultiLineString)
Name |
Description |
---|---|
MultiLineString |
multi_linestring type to be registered |
#include <boost/geometry/geometries/register/multi_linestring.hpp>
Show the use of the macro BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING
#include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/geometry/geometries/register/multi_linestring.hpp> using linestring_type = boost::geometry::model::linestring < boost::tuple<float, float> >; BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING(std::deque<linestring_type>) int main() { // Normal usage of std:: std::deque<linestring_type> lines(2); boost::geometry::read_wkt("LINESTRING(0 0,1 1)", lines[0]); boost::geometry::read_wkt("LINESTRING(2 2,3 3)", lines[1]); // Usage of Boost.Geometry std::cout << "LENGTH: " << boost::geometry::length(lines) << std::endl; return 0; }
Output:
LENGTH: 2.82843