diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp index 857eebb34..32ae0db9d 100644 --- a/doc/src/examples/algorithms/assign.cpp +++ b/doc/src/examples/algorithms/assign.cpp @@ -30,7 +30,7 @@ int main() box b; boost::geometry::assign_values(p1, 1, 1); boost::geometry::assign_values(b, 1, 1, 2, 2); - + // Assign a box to a polygon (target = source) polygon p; boost::geometry::assign(p, b); @@ -38,7 +38,7 @@ int main() // Assign a point to another point type (conversion of point-type) boost::tuple p2; boost::geometry::assign(p2, p1); - + using boost::geometry::dsv; std::cout << "box: " << dsv(b) << std::endl diff --git a/doc/src/examples/algorithms/comparable_distance.cpp b/doc/src/examples/algorithms/comparable_distance.cpp index 87b5100ce..8ac50167c 100644 --- a/doc/src/examples/algorithms/comparable_distance.cpp +++ b/doc/src/examples/algorithms/comparable_distance.cpp @@ -21,9 +21,9 @@ int main() { typedef boost::geometry::model::d2::point_xy point_type; - + point_type p(1.4, 2.6); - + std::vector v; for (double x = 0.0; x <= 4.0; x++) { @@ -32,7 +32,7 @@ int main() v.push_back(point_type(x, y)); } } - + point_type min_p; double min_d = boost::numeric::bounds::highest(); BOOST_FOREACH(point_type const& pv, v) @@ -44,8 +44,8 @@ int main() min_p = pv; } } - - std::cout + + std::cout << "Closest: " << boost::geometry::dsv(min_p) << std::endl << "At: " << boost::geometry::distance(p, min_p) << std::endl; diff --git a/doc/src/examples/algorithms/convert.cpp b/doc/src/examples/algorithms/convert.cpp index 6d43fd4d8..1f4570507 100644 --- a/doc/src/examples/algorithms/convert.cpp +++ b/doc/src/examples/algorithms/convert.cpp @@ -28,7 +28,7 @@ int main() point p1(1, 1); box bx = boost::geometry::make(1, 1, 2, 2); - + // Assign a box to a polygon (conversion box->poly) polygon poly; boost::geometry::convert(bx, poly); @@ -36,7 +36,7 @@ int main() // Convert a point to another point type (conversion of point-type) boost::tuple p2; boost::geometry::convert(p1, p2); // source -> target - + using boost::geometry::dsv; std::cout << "box: " << dsv(bx) << std::endl diff --git a/doc/src/examples/algorithms/convex_hull.cpp b/doc/src/examples/algorithms/convex_hull.cpp index 2d9394f73..cfa658cc0 100644 --- a/doc/src/examples/algorithms/convex_hull.cpp +++ b/doc/src/examples/algorithms/convex_hull.cpp @@ -30,7 +30,7 @@ int main() polygon hull; boost::geometry::convex_hull(poly, hull); - + using boost::geometry::dsv; std::cout << "polygon: " << dsv(poly) << std::endl diff --git a/doc/src/examples/algorithms/create_svg_overlay.hpp b/doc/src/examples/algorithms/create_svg_overlay.hpp index 53d81d6d6..fd281bdf2 100644 --- a/doc/src/examples/algorithms/create_svg_overlay.hpp +++ b/doc/src/examples/algorithms/create_svg_overlay.hpp @@ -49,7 +49,7 @@ void create_svg(std::string const& filename, Geometry const& a, Geometry const& boost::ignore_unused_variable_warning(a); boost::ignore_unused_variable_warning(b); boost::ignore_unused_variable_warning(range); -#endif +#endif } // NOTE: convert manually from svg to png using Inkscape ctrl-shift-E diff --git a/doc/src/examples/algorithms/distance.cpp b/doc/src/examples/algorithms/distance.cpp index 89a629641..91f2a6e85 100644 --- a/doc/src/examples/algorithms/distance.cpp +++ b/doc/src/examples/algorithms/distance.cpp @@ -44,7 +44,7 @@ int main() mp.push_back(point_type(0,0)); mp.push_back(point_type(3,3)); - std::cout + std::cout << "Point-Poly: " << boost::geometry::distance(p, poly) << std::endl << "Point-Line: " << boost::geometry::distance(p, line) << std::endl << "Point-MultiPoint: " << boost::geometry::distance(p, mp) << std::endl; diff --git a/doc/src/examples/algorithms/equals.cpp b/doc/src/examples/algorithms/equals.cpp index fe2836a48..461a111e8 100644 --- a/doc/src/examples/algorithms/equals.cpp +++ b/doc/src/examples/algorithms/equals.cpp @@ -30,19 +30,19 @@ int main() boost::geometry::exterior_ring(poly1) = tuple_list_of(0, 0)(0, 5)(5, 5)(5, 0)(0, 0); boost::geometry::exterior_ring(poly2) = tuple_list_of(5, 0)(0, 0)(0, 5)(5, 5)(5, 0); - std::cout - << "polygons are spatially " + std::cout + << "polygons are spatially " << (boost::geometry::equals(poly1, poly2) ? "equal" : "not equal") << std::endl; - + boost::geometry::model::box box; boost::geometry::assign_values(box, 0, 0, 5, 5); - - std::cout - << "polygon and box are spatially " + + std::cout + << "polygon and box are spatially " << (boost::geometry::equals(box, poly2) ? "equal" : "not equal") << std::endl; - + return 0; } diff --git a/doc/src/examples/algorithms/transform.cpp b/doc/src/examples/algorithms/transform.cpp index 97aea3c3d..a50845b2c 100644 --- a/doc/src/examples/algorithms/transform.cpp +++ b/doc/src/examples/algorithms/transform.cpp @@ -20,18 +20,18 @@ int main() // Select a point near the pole (theta=5.0, phi=15.0) bg::model::point > p1(15.0, 5.0); - + // Transform from degree to radian. Default strategy is automatically selected, // it will convert from degree to radian bg::model::point > p2; bg::transform(p1, p2); - - // Transform from degree (lon-lat) to 3D (x,y,z). Default strategy is automatically selected, + + // Transform from degree (lon-lat) to 3D (x,y,z). Default strategy is automatically selected, // it will consider points on a unit sphere bg::model::point p3; bg::transform(p1, p3); - - std::cout + + std::cout << "p1: " << bg::dsv(p1) << std::endl << "p2: " << bg::dsv(p2) << std::endl << "p3: " << bg::dsv(p3) << std::endl; diff --git a/doc/src/examples/algorithms/transform_with_strategy.cpp b/doc/src/examples/algorithms/transform_with_strategy.cpp index d55e5e2d1..62a12dc5f 100644 --- a/doc/src/examples/algorithms/transform_with_strategy.cpp +++ b/doc/src/examples/algorithms/transform_with_strategy.cpp @@ -18,7 +18,7 @@ int main() { namespace trans = boost::geometry::strategy::transform; using boost::geometry::dsv; - + typedef boost::geometry::model::point point_type; point_type p1(1.0, 1.0); @@ -37,8 +37,8 @@ int main() point_type p4; trans::rotate_transformer rotate(90.0); boost::geometry::transform(p1, p4, rotate); - - std::cout + + std::cout << "p1: " << dsv(p1) << std::endl << "p2: " << dsv(p2) << std::endl << "p3: " << dsv(p3) << std::endl diff --git a/doc/src/examples/core/closure.cpp b/doc/src/examples/core/closure.cpp index 62c6c1895..6f76378e7 100644 --- a/doc/src/examples/core/closure.cpp +++ b/doc/src/examples/core/closure.cpp @@ -22,10 +22,10 @@ int main() typedef boost::geometry::model::polygon polygon_type; boost::geometry::closure_selector clos = boost::geometry::closure::value; - + std::cout << "closure: " << clos << std::endl << "(open = " << boost::geometry::open - << ", closed = " << boost::geometry::closed + << ", closed = " << boost::geometry::closed << ") "<< std::endl; return 0; diff --git a/doc/src/examples/core/coordinate_dimension.cpp b/doc/src/examples/core/coordinate_dimension.cpp index 05881d274..166416860 100644 --- a/doc/src/examples/core/coordinate_dimension.cpp +++ b/doc/src/examples/core/coordinate_dimension.cpp @@ -27,7 +27,7 @@ int main() boost::tuple > >::value; - + std::cout << "dimensions: " << dim << std::endl; return 0; diff --git a/doc/src/examples/core/coordinate_system.cpp b/doc/src/examples/core/coordinate_system.cpp index 63db3a5dc..8f9879c46 100644 --- a/doc/src/examples/core/coordinate_system.cpp +++ b/doc/src/examples/core/coordinate_system.cpp @@ -23,7 +23,7 @@ int main() typedef boost::geometry::model::polygon polygon_type; typedef boost::geometry::coordinate_system::type system; - + std::cout << "system: " << typeid(system).name() << std::endl; return 0; diff --git a/doc/src/examples/core/coordinate_type.cpp b/doc/src/examples/core/coordinate_type.cpp index dd043bddb..2447e596c 100644 --- a/doc/src/examples/core/coordinate_type.cpp +++ b/doc/src/examples/core/coordinate_type.cpp @@ -23,7 +23,7 @@ int main() typedef boost::geometry::model::polygon polygon_type; typedef boost::geometry::coordinate_type::type ctype; - + std::cout << "type: " << typeid(ctype).name() << std::endl; return 0; diff --git a/doc/src/examples/core/degree_radian.cpp b/doc/src/examples/core/degree_radian.cpp index aed6bbead..4fa375656 100644 --- a/doc/src/examples/core/degree_radian.cpp +++ b/doc/src/examples/core/degree_radian.cpp @@ -19,12 +19,12 @@ int main() { typedef model::point > degree_point; typedef model::point > radian_point; - + degree_point d(4.893, 52.373); radian_point r(0.041, 0.8527); double dist = distance(d, r); - std::cout + std::cout << "distance:" << std::endl << dist << " over unit sphere" << std::endl << dist * 3959 << " over a spherical earth, in miles" << std::endl; diff --git a/doc/src/examples/core/interior_type.cpp b/doc/src/examples/core/interior_type.cpp index 61096bf47..029d86670 100644 --- a/doc/src/examples/core/interior_type.cpp +++ b/doc/src/examples/core/interior_type.cpp @@ -23,11 +23,11 @@ BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) int main() { // Define a polygon storing points in a deque and storing interior rings - // in a list (note that std::list is not supported by most algorithms + // in a list (note that std::list is not supported by most algorithms // because not supporting a random access iterator) typedef boost::geometry::model::polygon < - boost::array, + boost::array, true, true, std::deque, std::list > polygon; diff --git a/doc/src/examples/core/point_order.cpp b/doc/src/examples/core/point_order.cpp index 2f8b7058e..62b28c388 100644 --- a/doc/src/examples/core/point_order.cpp +++ b/doc/src/examples/core/point_order.cpp @@ -22,7 +22,7 @@ int main() typedef boost::geometry::model::polygon polygon_type; boost::geometry::order_selector order = boost::geometry::point_order::value; - + std::cout << "order: " << order << std::endl << "(clockwise = " << boost::geometry::clockwise << ", counterclockwise = " << boost::geometry::counterclockwise diff --git a/doc/src/examples/core/ring_type.cpp b/doc/src/examples/core/ring_type.cpp index 9e19bd421..781f4456c 100644 --- a/doc/src/examples/core/ring_type.cpp +++ b/doc/src/examples/core/ring_type.cpp @@ -24,19 +24,19 @@ int main() typedef boost::geometry::ring_type::type ring_type; typedef boost::geometry::interior_type::type int_type; - + std::cout << typeid(ring_type).name() << std::endl; std::cout << typeid(int_type).name() << std::endl; - - // So int_type defines a collection of rings, + + // So int_type defines a collection of rings, // which is a Boost.Range compatible range // The type of an element of the collection is the very same ring type again. // We show that. typedef boost::range_value::type int_ring_type; - - std::cout + + std::cout << std::boolalpha - << boost::is_same::value + << boost::is_same::value << std::endl; return 0; diff --git a/doc/src/examples/core/rings.cpp b/doc/src/examples/core/rings.cpp index 81f1ded65..8d483d184 100644 --- a/doc/src/examples/core/rings.cpp +++ b/doc/src/examples/core/rings.cpp @@ -9,7 +9,7 @@ //[rings /*` -Shows how to access the exterior ring (one) +Shows how to access the exterior ring (one) and interior rings (zero or more) of a polygon. Also shows the related ring_type and interior_type. */ @@ -27,17 +27,17 @@ int main() typedef boost::geometry::model::polygon polygon_type; polygon_type poly; - + typedef boost::geometry::ring_type::type ring_type; ring_type& ring = boost::geometry::exterior_ring(poly); - + // For a ring of model::polygon, you can call "push_back". // (internally, it is done using a traits::push_back class) ring.push_back(point(0, 0)); ring.push_back(point(0, 5)); ring.push_back(point(5, 4)); ring.push_back(point(0, 0)); - + ring_type inner; inner.push_back(point(1, 1)); inner.push_back(point(2, 1)); @@ -49,16 +49,16 @@ int main() interiors.push_back(inner); std::cout << boost::geometry::dsv(poly) << std::endl; - - // So int_type defines a collection of rings, + + // So int_type defines a collection of rings, // which is a Boost.Range compatible range // The type of an element of the collection is the very same ring type again. // We show that. typedef boost::range_value::type int_ring_type; - - std::cout + + std::cout << std::boolalpha - << boost::is_same::value + << boost::is_same::value << std::endl; return 0; diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp index 13bf4ff79..2cd245089 100644 --- a/doc/src/examples/core/tag.cpp +++ b/doc/src/examples/core/tag.cpp @@ -31,9 +31,9 @@ template <> struct dispatch { // Use the Boost.Geometry free function "get" // working on all supported point types - std::cout << "Hello POINT, you are located at: " - << boost::geometry::get<0>(p) << ", " - << boost::geometry::get<1>(p) + std::cout << "Hello POINT, you are located at: " + << boost::geometry::get<0>(p) << ", " + << boost::geometry::get<1>(p) << std::endl; } }; @@ -44,10 +44,10 @@ template <> struct dispatch template static inline void apply(Polygon const& p) { - // Use the Boost.Geometry manipulator "dsv" + // Use the Boost.Geometry manipulator "dsv" // working on all supported geometries - std::cout << "Hello POLYGON, you look like: " - << boost::geometry::dsv(p) + std::cout << "Hello POLYGON, you look like: " + << boost::geometry::dsv(p) << std::endl; } }; @@ -60,7 +60,7 @@ template <> struct dispatch { // Use the Boost.Range free function "size" because all // multigeometries comply to Boost.Range - std::cout << "Hello MULTIPOLYGON, you contain: " + std::cout << "Hello MULTIPOLYGON, you contain: " << boost::size(m) << " polygon(s)" << std::endl; } @@ -84,7 +84,7 @@ int main() // Declare and fill a polygon and a multipolygon polygon_type poly; boost::geometry::exterior_ring(poly) = boost::assign::tuple_list_of(0, 0)(0, 10)(10, 5)(0, 0); - + boost::geometry::model::multi_polygon multi; multi.push_back(poly); diff --git a/doc/src/examples/core/tag_cast.cpp b/doc/src/examples/core/tag_cast.cpp index 2e85f3d34..ff4a7c82f 100644 --- a/doc/src/examples/core/tag_cast.cpp +++ b/doc/src/examples/core/tag_cast.cpp @@ -25,7 +25,7 @@ int main() typedef geo::tag::type tag; typedef geo::tag_cast::type base_tag; - + std::cout << "tag: " << typeid(tag).name() << std::endl << "base tag: " << typeid(base_tag).name() << std::endl; diff --git a/doc/src/examples/geometries/adapted/boost_array.cpp b/doc/src/examples/geometries/adapted/boost_array.cpp index 846c0be7b..88a0ad75d 100644 --- a/doc/src/examples/geometries/adapted/boost_array.cpp +++ b/doc/src/examples/geometries/adapted/boost_array.cpp @@ -23,14 +23,14 @@ int main() boost::array a = { {1, 2} }; boost::array b = { {2, 3} }; std::cout << boost::geometry::distance(a, b) << std::endl; - + boost::geometry::set<0>(a, 1.1); boost::geometry::set<1>(a, 2.2); std::cout << boost::geometry::distance(a, b) << std::endl; boost::geometry::assign_values(b, 2.2, 3.3); std::cout << boost::geometry::distance(a, b) << std::endl; - + boost::geometry::model::linestring > line; line.push_back(b); diff --git a/doc/src/examples/geometries/adapted/boost_fusion.cpp b/doc/src/examples/geometries/adapted/boost_fusion.cpp index 89f044699..0bb00a5a2 100644 --- a/doc/src/examples/geometries/adapted/boost_fusion.cpp +++ b/doc/src/examples/geometries/adapted/boost_fusion.cpp @@ -29,20 +29,20 @@ BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(cs::cartesian) int main() { sample_point a, b, c; - + // Set coordinates the Boost.Geometry way (one of the ways) boost::geometry::assign_values(a, 3, 2, 1); - + // Set coordinates the Boost.Fusion way boost::fusion::at_c<0>(b) = 6; boost::fusion::at_c<1>(b) = 5; boost::fusion::at_c<2>(b) = 4; - + // Set coordinates the native way c.x = 9; c.y = 8; c.z = 7; - + std::cout << "Distance a-b: " << boost::geometry::distance(a, b) << std::endl; std::cout << "Distance a-c: " << boost::geometry::distance(a, c) << std::endl; diff --git a/doc/src/examples/geometries/adapted/boost_polygon.cpp b/doc/src/examples/geometries/adapted/boost_polygon.cpp index 3f71990fa..b56a13d45 100644 --- a/doc/src/examples/geometries/adapted/boost_polygon.cpp +++ b/doc/src/examples/geometries/adapted/boost_polygon.cpp @@ -17,9 +17,9 @@ int main() { boost::polygon::point_data a(1, 2), b(3, 4); - std::cout << "Distance (using Boost.Geometry): " + std::cout << "Distance (using Boost.Geometry): " << boost::geometry::distance(a, b) << std::endl; - std::cout << "Distance (using Boost.Polygon): " + std::cout << "Distance (using Boost.Polygon): " << boost::polygon::euclidean_distance(a, b) << std::endl; return 0; diff --git a/doc/src/examples/geometries/adapted/boost_range/filtered.cpp b/doc/src/examples/geometries/adapted/boost_range/filtered.cpp index ffc394a5e..174c0425b 100644 --- a/doc/src/examples/geometries/adapted/boost_range/filtered.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/filtered.cpp @@ -40,9 +40,9 @@ int main() line.push_back(xy(6, 2)); line.push_back(xy(7, 1)); line.push_back(xy(8, 0)); - + using boost::adaptors::filtered; - std::cout + std::cout << boost::geometry::length(line) << std::endl << boost::geometry::length(line | filtered(not_two())) << std::endl << boost::geometry::dsv(line | filtered(not_two())) << std::endl; diff --git a/doc/src/examples/geometries/adapted/boost_range/reversed.cpp b/doc/src/examples/geometries/adapted/boost_range/reversed.cpp index a73343850..44e8068c7 100644 --- a/doc/src/examples/geometries/adapted/boost_range/reversed.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/reversed.cpp @@ -23,9 +23,9 @@ int main() boost::geometry::model::linestring line; line.push_back(xy(0, 0)); line.push_back(xy(1, 1)); - - std::cout - << boost::geometry::dsv(line | boost::adaptors::reversed) + + std::cout + << boost::geometry::dsv(line | boost::adaptors::reversed) << std::endl; return 0; diff --git a/doc/src/examples/geometries/adapted/boost_range/sliced.cpp b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp index b07d6d584..bdfd74c62 100644 --- a/doc/src/examples/geometries/adapted/boost_range/sliced.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp @@ -23,7 +23,7 @@ int main() { using namespace boost::assign; - + typedef boost::geometry::model::d2::point_xy xy; boost::geometry::model::linestring line; line += xy(0, 0); @@ -31,8 +31,8 @@ int main() line += xy(2, 2); line += xy(3, 3); line += xy(4, 4); - - std::cout + + std::cout << boost::geometry::dsv(line | boost::adaptors::sliced(1, 3)) << std::endl; return 0; diff --git a/doc/src/examples/geometries/adapted/boost_range/strided.cpp b/doc/src/examples/geometries/adapted/boost_range/strided.cpp index 95a130acb..8b9dc6865 100644 --- a/doc/src/examples/geometries/adapted/boost_range/strided.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/strided.cpp @@ -24,7 +24,7 @@ int main() { using namespace boost::assign; using boost::adaptors::strided; - + typedef boost::geometry::model::d2::point_xy xy; boost::geometry::model::ring ring; ring += xy(0, 0); @@ -35,8 +35,8 @@ int main() ring += xy(2, 0); boost::geometry::correct(ring); - - std::cout + + std::cout << "Normal : " << boost::geometry::dsv(ring) << std::endl << "Strided: " << boost::geometry::dsv(ring | strided(2)) << std::endl; diff --git a/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp b/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp index 9f138b00c..6df47dee1 100644 --- a/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp @@ -32,7 +32,7 @@ int main() { using namespace boost::assign; using boost::adaptors::uniqued; - + boost::geometry::model::ring ring; ring += xy(0, 0); ring += xy(0, 1); @@ -43,8 +43,8 @@ int main() ring += xy(2, 2); ring += xy(2, 0); ring += xy(0, 0); - - std::cout + + std::cout << "Normal: " << boost::geometry::dsv(ring) << std::endl << "Unique: " << boost::geometry::dsv(ring | uniqued) << std::endl; diff --git a/doc/src/examples/geometries/adapted/boost_tuple.cpp b/doc/src/examples/geometries/adapted/boost_tuple.cpp index 747df8881..6c6599c5e 100644 --- a/doc/src/examples/geometries/adapted/boost_tuple.cpp +++ b/doc/src/examples/geometries/adapted/boost_tuple.cpp @@ -11,7 +11,7 @@ /*` Shows how to use Boost.Tuple points in Boost.Geometry -Working with Boost.Tuples in Boost.Geometry is straightforward and shown in +Working with Boost.Tuples in Boost.Geometry is straightforward and shown in various other examples as well. */ @@ -31,11 +31,11 @@ int main() poly.outer().push_back(boost::make_tuple(6.0, 4.0)); poly.outer().push_back(boost::make_tuple(5.0, 1.0)); poly.outer().push_back(boost::make_tuple(1.0, 2.0)); - + std::cout << "Area: " << boost::geometry::area(poly) << std::endl; - std::cout << "Contains (1.5, 2.5): " + std::cout << "Contains (1.5, 2.5): " << std::boolalpha - << boost::geometry::within(boost::make_tuple(1.5, 2.5), poly) + << boost::geometry::within(boost::make_tuple(1.5, 2.5), poly) << std::endl; return 0; diff --git a/doc/src/examples/geometries/adapted/c_array.cpp b/doc/src/examples/geometries/adapted/c_array.cpp index 335346b89..95f403303 100644 --- a/doc/src/examples/geometries/adapted/c_array.cpp +++ b/doc/src/examples/geometries/adapted/c_array.cpp @@ -14,7 +14,7 @@ #include #include -BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) int main() { @@ -22,7 +22,7 @@ int main() int b[3] = {2, 3, 4}; std::cout << boost::geometry::distance(a, b) << std::endl; - + return 0; } diff --git a/doc/src/examples/geometries/register/linestring.cpp b/doc/src/examples/geometries/register/linestring.cpp index ce4d97d7b..ab5f5998a 100644 --- a/doc/src/examples/geometries/register/linestring.cpp +++ b/doc/src/examples/geometries/register/linestring.cpp @@ -18,7 +18,7 @@ typedef boost::geometry::model::d2::point_xy point_2d; -BOOST_GEOMETRY_REGISTER_LINESTRING(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING(std::vector) int main() { @@ -27,16 +27,16 @@ int main() line.push_back(point_2d(1, 1)); line.push_back(point_2d(2, 2)); line.push_back(point_2d(3, 1)); - + // Usage of Boost.Geometry's length and wkt functions - std::cout << "Length: " + std::cout << "Length: " << boost::geometry::length(line) << std::endl; - - std::cout << "WKT: " + + std::cout << "WKT: " << boost::geometry::wkt(line) << std::endl; - + return 0; } diff --git a/doc/src/examples/geometries/register/linestring_templated.cpp b/doc/src/examples/geometries/register/linestring_templated.cpp index 064f78eee..5722b581d 100644 --- a/doc/src/examples/geometries/register/linestring_templated.cpp +++ b/doc/src/examples/geometries/register/linestring_templated.cpp @@ -18,18 +18,18 @@ #include // Adapt any deque to Boost.Geometry Linestring Concept -BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) int main() { std::deque > line(2); boost::geometry::assign_values(line[0], 1, 1); boost::geometry::assign_values(line[1], 2, 2); - + // Boost.Geometry algorithms work on any deque now std::cout << "Length: " << boost::geometry::length(line) << std::endl; std::cout << "Line: " << boost::geometry::dsv(line) << std::endl; - + return 0; } diff --git a/doc/src/examples/geometries/register/multi_linestring.cpp b/doc/src/examples/geometries/register/multi_linestring.cpp index 9ed40da73..a8e80ce91 100644 --- a/doc/src/examples/geometries/register/multi_linestring.cpp +++ b/doc/src/examples/geometries/register/multi_linestring.cpp @@ -19,7 +19,7 @@ typedef boost::geometry::model::linestring < - boost::tuple + boost::tuple > linestring_type; BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) @@ -31,10 +31,10 @@ int main() std::deque 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; } diff --git a/doc/src/examples/geometries/register/multi_point.cpp b/doc/src/examples/geometries/register/multi_point.cpp index e854da2b0..dc8b90702 100644 --- a/doc/src/examples/geometries/register/multi_point.cpp +++ b/doc/src/examples/geometries/register/multi_point.cpp @@ -27,10 +27,10 @@ int main() std::deque multi_point; multi_point.push_back(point_type(1, 1)); multi_point.push_back(point_type(3, 2)); - + // Usage of Boost.Geometry std::cout << "WKT: " << boost::geometry::wkt(multi_point) << std::endl; - + return 0; } diff --git a/doc/src/examples/geometries/register/multi_point_templated.cpp b/doc/src/examples/geometries/register/multi_point_templated.cpp index bba16bbbd..6046f8cda 100644 --- a/doc/src/examples/geometries/register/multi_point_templated.cpp +++ b/doc/src/examples/geometries/register/multi_point_templated.cpp @@ -27,10 +27,10 @@ int main() std::deque > multi_point; multi_point.push_back(boost::tuple(1, 1)); multi_point.push_back(boost::tuple(3, 2)); - + // Usage of Boost.Geometry std::cout << "WKT: " << boost::geometry::wkt(multi_point) << std::endl; - + return 0; } diff --git a/doc/src/examples/geometries/register/multi_polygon.cpp b/doc/src/examples/geometries/register/multi_polygon.cpp index f21f3cf95..9c0f34228 100644 --- a/doc/src/examples/geometries/register/multi_polygon.cpp +++ b/doc/src/examples/geometries/register/multi_polygon.cpp @@ -19,7 +19,7 @@ typedef boost::geometry::model::polygon < - boost::tuple + boost::tuple > polygon_type; BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) @@ -31,10 +31,10 @@ int main() std::vector polygons(2); boost::geometry::read_wkt("POLYGON((0 0,0 1,1 1,1 0,0 0))", polygons[0]); boost::geometry::read_wkt("POLYGON((3 0,3 1,4 1,4 0,3 0))", polygons[1]); - + // Usage of Boost.Geometry std::cout << "AREA: " << boost::geometry::area(polygons) << std::endl; - + return 0; } diff --git a/doc/src/examples/geometries/register/ring.cpp b/doc/src/examples/geometries/register/ring.cpp index 4d7ca2a0a..58f35a447 100644 --- a/doc/src/examples/geometries/register/ring.cpp +++ b/doc/src/examples/geometries/register/ring.cpp @@ -27,13 +27,13 @@ int main() ring.push_back(point_2d(1, 1)); ring.push_back(point_2d(2, 2)); ring.push_back(point_2d(2, 1)); - - + + // Usage of Boost.Geometry boost::geometry::correct(ring); std::cout << "Area: " << boost::geometry::area(ring) << std::endl; std::cout << "WKT: " << boost::geometry::wkt(ring) << std::endl; - + return 0; } diff --git a/doc/src/examples/geometries/register/ring_templated.cpp b/doc/src/examples/geometries/register/ring_templated.cpp index 0a27c99ca..a3223421a 100644 --- a/doc/src/examples/geometries/register/ring_templated.cpp +++ b/doc/src/examples/geometries/register/ring_templated.cpp @@ -18,7 +18,7 @@ #include // Adapt any deque to Boost.Geometry Ring Concept -BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::deque) +BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::deque) int main() { @@ -26,12 +26,12 @@ int main() boost::geometry::assign_values(ring[0], 0, 0); boost::geometry::assign_values(ring[2], 4, 1); boost::geometry::assign_values(ring[1], 1, 4); - + // Boost.Geometry algorithms work on any deque now boost::geometry::correct(ring); std::cout << "Area: " << boost::geometry::area(ring) << std::endl; std::cout << "Contents: " << boost::geometry::wkt(ring) << std::endl; - + return 0; } diff --git a/doc/src/examples/io/svg.cpp b/doc/src/examples/io/svg.cpp index 1a423b8c2..37fb171cc 100644 --- a/doc/src/examples/io/svg.cpp +++ b/doc/src/examples/io/svg.cpp @@ -36,7 +36,7 @@ int main() // Declare a stream and an SVG mapper std::ofstream svg("my_map.svg"); boost::geometry::svg_mapper mapper(svg, 400, 400); - + // Add geometries such that all these geometries fit on the map mapper.add(a); mapper.add(b); @@ -46,7 +46,7 @@ int main() mapper.map(a, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:2", 5); mapper.map(b, "fill-opacity:0.3;fill:rgb(51,51,153);stroke:rgb(51,51,153);stroke-width:2"); mapper.map(c, "opacity:0.4;fill:none;stroke:rgb(212,0,0);stroke-width:5"); - + // Destructor of map will be called - adding // Destructor of stream will be called, closing the file diff --git a/doc/src/examples/quick_start.cpp b/doc/src/examples/quick_start.cpp index 9a739efab..f77c8909b 100644 --- a/doc/src/examples/quick_start.cpp +++ b/doc/src/examples/quick_start.cpp @@ -114,7 +114,7 @@ int main(void) double d = distance(a, b); std::cout << "Distance a-b is: " << d << std::endl; //] - + //[quickstart_point_in_polygon double points[][2] = {{2.0, 1.3}, {4.1, 3.0}, {5.3, 2.6}, {2.9, 0.7}, {2.0, 1.3}}; model::polygon > poly; @@ -122,7 +122,7 @@ int main(void) boost::tuple p = boost::make_tuple(3.7, 2.0); std::cout << "Point p is in polygon? " << std::boolalpha << within(p, poly) << std::endl; //] - + //[quickstart_area std::cout << "Area: " << area(poly) << std::endl; //] @@ -131,16 +131,16 @@ int main(void) double d2 = distance(a, p); std::cout << "Distance a-p is: " << d2 << std::endl; //] - + //[quick_start_spherical typedef boost::geometry::model::point < double, 2, boost::geometry::cs::spherical_equatorial > spherical_point; - + spherical_point amsterdam(4.90, 52.37); spherical_point paris(2.35, 48.86); - + double const earth_radius = 3959; // miles std::cout << "Distance in miles: " << distance(amsterdam, paris) * earth_radius << std::endl; //] @@ -161,7 +161,7 @@ int main(void) assign_values(r2, 200, 300, 220, 320); } //] - + return 0; } diff --git a/doc/src/examples/views/box_view.cpp b/doc/src/examples/views/box_view.cpp index e95b54ecb..e968a867c 100644 --- a/doc/src/examples/views/box_view.cpp +++ b/doc/src/examples/views/box_view.cpp @@ -21,15 +21,15 @@ int main() < boost::geometry::model::point > box_type; - + // Define the Boost.Range compatible type: - typedef boost::geometry::box_view box_view; - + typedef boost::geometry::box_view box_view; + box_type box; boost::geometry::assign_values(box, 0, 0, 4, 4); - + box_view view(box); - + // Iterating in clockwise direction over the points of this box for (boost::range_iterator::type it = boost::begin(view); it != boost::end(view); ++it) @@ -37,10 +37,10 @@ int main() std::cout << " " << boost::geometry::dsv(*it); } std::cout << std::endl; - + // Note that a box_view is tagged as a ring, so supports area etc. std::cout << "Area: " << boost::geometry::area(view) << std::endl; - + return 0; } diff --git a/doc/src/examples/views/segment_view.cpp b/doc/src/examples/views/segment_view.cpp index 5337189f9..56f21d1f4 100644 --- a/doc/src/examples/views/segment_view.cpp +++ b/doc/src/examples/views/segment_view.cpp @@ -21,14 +21,14 @@ int main() < boost::geometry::model::point > segment_type; - - typedef boost::geometry::segment_view segment_view; - + + typedef boost::geometry::segment_view segment_view; + segment_type segment; boost::geometry::assign_values(segment, 0, 0, 1, 1); - + segment_view view(segment); - + // Iterating over the points of this segment for (boost::range_iterator::type it = boost::begin(view); it != boost::end(view); ++it) @@ -36,10 +36,10 @@ int main() std::cout << " " << boost::geometry::dsv(*it); } std::cout << std::endl; - + // Note that a segment_view is tagged as a linestring, so supports length etc. std::cout << "Length: " << boost::geometry::length(view) << std::endl; - + return 0; } diff --git a/example/01_point_example.cpp b/example/01_point_example.cpp index 4feee82c6..1bc155070 100644 --- a/example/01_point_example.cpp +++ b/example/01_point_example.cpp @@ -70,7 +70,7 @@ int main() double d1 = distance(pt1, pt2); double d2 = distance(pt3, pt4); double d3 = distance(pt5, pt6); - std::cout << "Distances: " + std::cout << "Distances: " << d1 << " and " << d2 << " and " << d3 << std::endl; // (in case you didn't note, distances can be calculated diff --git a/example/07_a_graph_route_example.cpp b/example/07_a_graph_route_example.cpp index 5b476ffb5..7bd4c6774 100644 --- a/example/07_a_graph_route_example.cpp +++ b/example/07_a_graph_route_example.cpp @@ -304,12 +304,12 @@ int main() double const km = 1000.0; std::cout << "distances, all in KM" << std::endl << std::fixed << std::setprecision(0); - + // To calculate distance, declare and construct a strategy with average earth radius boost::geometry::strategy::distance::haversine haversine(6372795.0); // Main functionality: calculate shortest routes from/to all cities - + // For the first one, the complete route is stored as a linestring bool first = true; @@ -385,7 +385,7 @@ int main() mapper.text(city.get<0>(), city.get<1>(), "fill:rgb(0,0,0);font-family:Arial;font-size:10px", 5, 5); } -#endif +#endif return 0; } diff --git a/example/07_b_graph_route_example.cpp b/example/07_b_graph_route_example.cpp index 5490dc5fb..5dedbf801 100644 --- a/example/07_b_graph_route_example.cpp +++ b/example/07_b_graph_route_example.cpp @@ -294,7 +294,7 @@ int main() // To calculate distance, declare and construct a strategy with average earth radius boost::geometry::strategy::distance::haversine haversine(6372795.0); - + // Main functionality: calculate shortest routes from/to all cities // For the first one, the complete route is stored as a linestring @@ -371,7 +371,7 @@ int main() mapper.text(city.get<0>(), city.get<1>(), "fill:rgb(0,0,0);font-family:Arial;font-size:10px", 5, 5); } -#endif +#endif return 0; } diff --git a/example/c10_custom_cs_example.cpp b/example/c10_custom_cs_example.cpp index 6676955d7..098916cd6 100644 --- a/example/c10_custom_cs_example.cpp +++ b/example/c10_custom_cs_example.cpp @@ -8,7 +8,7 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// Example: Custom coordinate system example +// Example: Custom coordinate system example #include @@ -45,8 +45,8 @@ struct cs_tag > }}} // namespaces -// NOTE: if the next steps would not be here, -// compiling a distance function call with martian coordinates +// NOTE: if the next steps would not be here, +// compiling a distance function call with martian coordinates // would result in a MPL assertion // 4: so register a distance strategy as its default strategy @@ -62,21 +62,21 @@ struct default_strategy }}}}} // namespaces // 5: not worked out. To implement a specific distance strategy for Mars, -// e.g. with the Mars radius given by default, +// e.g. with the Mars radius given by default, // you will have to implement (/register) several other metafunctions: -// tag, return_type, similar_type, comparable_type, +// tag, return_type, similar_type, comparable_type, // and structs: // get_similar, get_comparable, result_from_distance -// See e.g. .../boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp +// See e.g. .../boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp int main() { typedef boost::geometry::model::point < - double, 2, martian + double, 2, martian > mars_point; - // Declare two points + // Declare two points // (Source: http://nssdc.gsfc.nasa.gov/planetary/mars_mileage_guide.html) // (Other sources: Wiki and Google give slightly different coordinates, resulting // in other distance, 20 km off) @@ -87,11 +87,11 @@ int main() // Using the Mars mean radius // (Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html) - std::cout << "Distance between Viking1 and Pathfinder landing sites: " + std::cout << "Distance between Viking1 and Pathfinder landing sites: " << d * 3389.5 << " km" << std::endl; // We would get 832.616 here, same order as the 835 (rounded on 5 km) listed - // on the mentioned site + // on the mentioned site #ifdef OPTIONALLY_ELLIPSOIDAL // Optionally the distance can be calculated more accurate by an Ellipsoidal approach, diff --git a/example/c11_custom_cs_transform_example.cpp b/example/c11_custom_cs_transform_example.cpp index 896ee069a..84c94eb06 100644 --- a/example/c11_custom_cs_transform_example.cpp +++ b/example/c11_custom_cs_transform_example.cpp @@ -30,7 +30,7 @@ template<> struct cs_tag { typedef cartesian_tag type; }; }}} // namespaces -// 3: sample implementation of a shift +// 3: sample implementation of a shift // to convert coordinate system "cart" to "cart_shirted5" struct shift { @@ -46,7 +46,7 @@ struct shift // 4: register the default strategy to transform any cart point to any cart_shifted5 point -namespace boost { namespace geometry { namespace strategy { namespace transform { namespace services +namespace boost { namespace geometry { namespace strategy { namespace transform { namespace services { template @@ -75,14 +75,14 @@ typedef boost::geometry::model::point point1; typedef boost::geometry::model::point point2; // 7: register the distance strategy -namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services +namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services { template <> struct tag { typedef strategy_tag_distance_point_point type; }; - + template struct return_type { @@ -103,27 +103,27 @@ namespace boost { namespace geometry { namespace strategy { namespace distance { int main() { point1 p1_a(0, 0), p1_b(5, 5); - point2 p2_a(2, 2), p2_b(6, 6); + point2 p2_a(2, 2), p2_b(6, 6); // Distances run for points on the same coordinate system. // This is possible by default because they are cartesian coordinate systems. - double d1 = boost::geometry::distance(p1_a, p1_b); - double d2 = boost::geometry::distance(p2_a, p2_b); + double d1 = boost::geometry::distance(p1_a, p1_b); + double d2 = boost::geometry::distance(p2_a, p2_b); std::cout << d1 << " " << d2 << std::endl; // Transform from a to b: boost::geometry::model::point p1_shifted; - boost::geometry::transform(p1_a, p1_shifted); + boost::geometry::transform(p1_a, p1_shifted); // Of course this can be calculated now, same CS - double d3 = boost::geometry::distance(p1_shifted, p2_a); + double d3 = boost::geometry::distance(p1_shifted, p2_a); - // Calculate distance between them. Note that inside distance the + // Calculate distance between them. Note that inside distance the // transformation is called. - double d4 = boost::geometry::distance(p1_a, p2_a); + double d4 = boost::geometry::distance(p1_a, p2_a); // The result should be the same. std::cout << d3 << " " << d4 << std::endl; diff --git a/example/ml02_distance_strategy.cpp b/example/ml02_distance_strategy.cpp index 3baf60e44..1e2989016 100644 --- a/example/ml02_distance_strategy.cpp +++ b/example/ml02_distance_strategy.cpp @@ -32,5 +32,5 @@ int main() strategy2_type strategy2; strategy2_type::calculation_type d2 = strategy2.apply(p1, p2); - return 0; + return 0; }