1 // Boost.Geometry (aka GGL, Generic Geometry Library) 2 // QuickBook Example 3 4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. 5 6 // Use, modification and distribution is subject to the Boost Software License, 7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 8 // http://www.boost.org/LICENSE_1_0.txt) 9 10 //[dimension 11 //` Examine the number of coordinates making up the points in a linestring type 12 13 #include <iostream> 14 15 #include <boost/geometry.hpp> 16 #include <boost/geometry/geometries/linestring.hpp> 17 #include <boost/geometry/geometries/adapted/boost_tuple.hpp> 18 19 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); 20 main()21int main() 22 { 23 int dim = boost::geometry::dimension 24 < 25 boost::geometry::model::linestring 26 < 27 boost::tuple<float, float, float> 28 > 29 >::value; 30 31 std::cout << "dimensions: " << dim << std::endl; 32 33 return 0; 34 } 35 36 //] 37 38 39 //[dimension_output 40 /*` 41 Output: 42 [pre 43 dimensions: 3 44 ] 45 */ 46 //] 47