diff --git a/circle.yml b/circle.yml index 20ec47d86..75052ad9f 100644 --- a/circle.yml +++ b/circle.yml @@ -3,7 +3,7 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # # Copyright Antony Polukhin 2014. -# Copyright Adam Wulkiewicz 2015-2016. +# Copyright Adam Wulkiewicz 2015-2018. general: branches: @@ -17,7 +17,7 @@ machine: # define tests list, if parallelism is enabled they are run in parallel TESTS: test index/test TESTS0: test/core test/concepts test/geometries test/arithmetic test/algorithms test/formulas test/iterators - TESTS1: test/strategies test/policies test/io test/util test/views index/test + TESTS1: test/srs test/strategies test/policies test/io test/util test/views index/test # this is not fully bulletproof, ideally one should check # if the current branch originates in master or develop @@ -88,7 +88,7 @@ dependencies: # download and install the latest lcov # do not use the old one from sources - - wget http://downloads.sourceforge.net/ltp/lcov-1.12.tar.gz + - curl -fLO https://sourceforge.net/projects/ltp/files/Coverage%20Analysis/LCOV-1.12/lcov-1.12.tar.gz || curl -fLO https://downloads.sourceforge.net/project/ltp/Coverage%20Analysis/LCOV-1.12/lcov-1.12.tar.gz || wget http://sourceforge.mirrorservice.org/l/project/lt/ltp/Coverage%20Analysis/LCOV-1.12/lcov-1.12.tar.gz || wget -O lcov-1.12.tar.gz http://launchpad.net/ubuntu/+archive/primary/+files/lcov_1.12.orig.tar.gz - tar xvzf lcov-1.12.tar.gz - cd lcov-1.12 && sudo make install diff --git a/doc/about_documentation.qbk b/doc/about_documentation.qbk index e2b277851..e3e01fcbb 100644 --- a/doc/about_documentation.qbk +++ b/doc/about_documentation.qbk @@ -66,7 +66,7 @@ In the example above a QuickBook include statement is used. But any QuickBook co \[area_with_strategy_output\] \[heading Available Strategies\] -\[link geometry.reference.strategies.strategy_area_surveyor Surveyor (cartesian)\] +\[link geometry.reference.strategies.strategy_area_cartesian Cartesian\] } */ ] diff --git a/doc/concept/point.qbk b/doc/concept/point.qbk index 070aa81f6..746ce82ed 100644 --- a/doc/concept/point.qbk +++ b/doc/concept/point.qbk @@ -38,6 +38,7 @@ The Point Concept is defined as following: * [link geometry.reference.models.model_d2_point_xy model::d2::point_xy] * a lat long point (currently in an extension) * [link geometry.reference.adapted.c_array C array] +* [link geometry.reference.adapted.std_array C++ array container] * [link geometry.reference.adapted.boost_array Boost.Array] * [link geometry.reference.adapted.boost_fusion Boost.Fusion] * [link geometry.reference.adapted.boost_polygon Boost.Polygon] diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index aab8e217b..4f80583ac 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -55,6 +55,7 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ tparam_box_or_segment="Any type fulfilling a Box Concept or a Segment Concept" \ tparam_calculation="numeric type for calculation (e.g. high precision); if [*void] then it is extracted automatically from the coordinate type and (if necessary) promoted to floating point" \ tparam_radius="numeric type for radius (of sphere, earth)" \ + tparam_radius_or_sphere="numeric type for radius (of sphere, earth) or sphere model" \ tparam_container="container type, for example std::vector, std::deque" \ tparam_dimension_required="Dimension, this template parameter is required. Should contain \\[0 .. n-1\\] for an n-dimensional geometry" \ tparam_functor="Function or class with operator()" \ @@ -206,6 +207,7 @@ INPUT = . .. ../../../../boost/geometry/core \ ../../../../boost/geometry/io/svg \ ../../../../boost/geometry/policies \ ../../../../boost/geometry/policies/relate \ + ../../../../boost/geometry/srs \ ../../../../boost/geometry/strategies \ ../../../../boost/geometry/strategies/concepts \ ../../../../boost/geometry/strategies/agnostic \ diff --git a/doc/doxy/doxygen_input/groups/groups.hpp b/doc/doxy/doxygen_input/groups/groups.hpp index 9889ebd76..385b4382c 100644 --- a/doc/doxy/doxygen_input/groups/groups.hpp +++ b/doc/doxy/doxygen_input/groups/groups.hpp @@ -2,6 +2,10 @@ // // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // 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) @@ -26,6 +30,7 @@ \defgroup covered_by covered_by: detect if a geometry is inside or on the border of another geometry, a.o. point-in-polygon (border included) \defgroup crosses crosses: detect if two geometries crosses each other \defgroup cs coordinate systems +\defgroup densify densify: add points to geometry, keeping shape \defgroup difference difference: difference of two geometries \defgroup disjoint disjoint: detect if geometries are not spatially related \defgroup distance distance: calculate distance between two geometries @@ -62,6 +67,7 @@ \defgroup selected selection: check if a geometry is "selected" by a point \defgroup set set: set geometries \defgroup simplify simplify: remove points from a geometry, keeping shape (simplification or generalization) +\defgroup srs srs: Spatial Reference System definition \defgroup strategies strategies: strategies \defgroup svg svg: Stream SVG (Scalable Vector Graphics) \defgroup sym_difference sym_difference: sym_difference of two geometries diff --git a/doc/html/index.html b/doc/html/index.html index d8afcf098..890c44e8c 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -83,6 +83,7 @@
Iterators
Models
Spatial Indexes
+
SRS
Strategies
Views
@@ -137,7 +138,7 @@ - +

Last revised: February 26, 2017 at 00:30:21 GMT

Last revised: March 02, 2018 at 22:11:06 GMT


diff --git a/doc/imports.qbk b/doc/imports.qbk index 6c4863add..284061189 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -5,6 +5,9 @@ Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Copyright (c) 2009-2012 Bruno Lalande, Paris, France. + Copyright (c) 2018, Oracle and/or its affiliates. + Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + 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) @@ -27,6 +30,8 @@ [import src/examples/algorithms/convert.cpp] [import src/examples/algorithms/convex_hull.cpp] [import src/examples/algorithms/correct.cpp] +[import src/examples/algorithms/densify.cpp] +[import src/examples/algorithms/densify_strategy.cpp] [import src/examples/algorithms/distance.cpp] [import src/examples/algorithms/difference.cpp] [import src/examples/algorithms/envelope.cpp] @@ -97,6 +102,7 @@ [import src/examples/geometries/segment.cpp] [import src/examples/geometries/adapted/c_array.cpp] +[import src/examples/geometries/adapted/std_array.cpp] [import src/examples/geometries/adapted/boost_array.cpp] [import src/examples/geometries/adapted/boost_fusion.cpp] [import src/examples/geometries/adapted/boost_polygon_box.cpp] diff --git a/doc/make_qbk.py b/doc/make_qbk.py index cace58ff8..82705f0a9 100755 --- a/doc/make_qbk.py +++ b/doc/make_qbk.py @@ -5,6 +5,9 @@ # Copyright (c) 2008-2012 Bruno Lalande, Paris, France. # Copyright (c) 2009-2012 Mateusz Loskot (mateusz@loskot.net), London, UK # Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland +# +# Copyright (c) 2018, Oracle and/or its affiliates. +# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle # # Use, modification and distribution is subject to the Boost Software License, # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -75,6 +78,9 @@ def class_to_quickbook(section): def class_to_quickbook2(classname, section): run_command(cmd % ("classboost_1_1geometry_1_1" + classname, section)) +def srs_class_to_quickbook(section): + run_command(cmd % ("classboost_1_1geometry_1_1srs_1_1" + section.replace("_", "__"), "srs_" + section)) + def strategy_to_quickbook(section): p = section.find("::") ns = section[:p] @@ -91,7 +97,7 @@ call_doxygen() algorithms = ["append", "assign", "make", "clear" , "area", "buffer", "centroid", "convert", "correct", "covered_by" - , "convex_hull", "crosses", "difference", "disjoint", "distance" + , "convex_hull", "crosses", "densify", "difference", "disjoint", "distance" , "envelope", "equals", "expand", "for_each", "is_empty" , "is_simple", "is_valid", "intersection", "intersects", "length" , "num_geometries", "num_interior_rings", "num_points" @@ -119,14 +125,9 @@ models = ["point", "linestring", "box" , "polygon", "segment", "ring" , "multi_linestring", "multi_point", "multi_polygon", "referring_segment"] +srs = ["spheroid"] -strategies = ["distance::pythagoras", "distance::pythagoras_box_box" - , "distance::pythagoras_point_box", "distance::haversine" - , "distance::cross_track", "distance::cross_track_point_box" - , "distance::projected_point" - , "within::winding", "within::franklin", "within::crossings_multiply" - , "area::surveyor", "area::spherical" - #, "area::geographic" +strategies = ["area::cartesian", "area::spherical", "area::geographic" , "buffer::point_circle", "buffer::point_square" , "buffer::join_round", "buffer::join_miter" , "buffer::end_round", "buffer::end_flat" @@ -134,8 +135,15 @@ strategies = ["distance::pythagoras", "distance::pythagoras_box_box" , "buffer::side_straight" , "centroid::bashein_detmer", "centroid::average" , "convex_hull::graham_andrew" + , "densify::cartesian", "densify::geographic", "densify::spherical" + , "distance::pythagoras", "distance::pythagoras_box_box" + , "distance::pythagoras_point_box", "distance::haversine" + , "distance::cross_track", "distance::cross_track_point_box" + , "distance::projected_point" + , "within::winding", "within::franklin", "within::crossings_multiply" , "simplify::douglas_peucker" - , "side::side_by_triangle", "side::side_by_cross_track", "side::spherical_side_formula" + , "side::side_by_triangle", "side::side_by_cross_track" + , "side::spherical_side_formula", "side::geographic" , "transform::inverse_transformer", "transform::map_transformer" , "transform::rotate_transformer", "transform::scale_transformer" , "transform::translate_transformer", "transform::matrix_transformer" @@ -167,6 +175,9 @@ for i in iterators: for i in models: model_to_quickbook(i) +for i in srs: + srs_class_to_quickbook(i) + for i in strategies: strategy_to_quickbook(i) diff --git a/doc/quickref.xml b/doc/quickref.xml index 755fdd255..af8d1ef33 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -10,8 +10,8 @@ Copyright (c) 2009-2015 Bruno Lalande, Paris, France. Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. - This file was modified by Oracle on 2014, 2015, 2017. - Modifications copyright (c) 2014-2017, Oracle and/or its affiliates. + This file was modified by Oracle on 2014, 2015, 2017, 2018. + Modifications copyright (c) 2014-2018, Oracle and/or its affiliates. Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -114,6 +114,7 @@ Boost.Polygon's point_data Boost.Tuple C arrays + C++11 array containers @@ -389,6 +390,10 @@ + Densify + + densify + Distance distance @@ -410,17 +415,16 @@ for each (point, segment) + + Intersection intersection - - Length length - - + Num_ (counting) num_interior_rings @@ -428,8 +432,6 @@ num_points num_segments - - Perimeter perimeter @@ -439,12 +441,12 @@ relate relation + + Reverse reverse - - Simplify simplify @@ -520,9 +522,9 @@ Area - strategy::area::surveyor + strategy::area::cartesian strategy::area::spherical - + strategy::area::geographic @@ -554,6 +556,14 @@ strategy::convex_hull::graham_andrew + + Densify + + strategy::densify::cartesian + strategy::densify::geographic + strategy::densify::spherical + + Distance @@ -566,16 +576,17 @@ strategy::distance::haversine + + Side strategy::side::side_by_triangle strategy::side::side_by_cross_track strategy::side::spherical_side_formula + strategy::side::geographic - - Simplify @@ -593,7 +604,9 @@ strategy::transform::rotate_transformer - + + + Within strategy::winding diff --git a/doc/reference.qbk b/doc/reference.qbk index 699712399..98ee4cac6 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -6,8 +6,8 @@ Copyright (c) 2009-2017 Bruno Lalande, Paris, France. Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland. - This file was modified by Oracle on 2014, 2017. - Modifications copyright (c) 2014-2017, Oracle and/or its affiliates. + This file was modified by Oracle on 2014, 2017, 2018. + Modifications copyright (c) 2014-2018, Oracle and/or its affiliates. Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -45,6 +45,7 @@ [section:adapted Adapted models] [include reference/geometries/adapted/c_array.qbk] +[include reference/geometries/adapted/std_array.qbk] [include reference/geometries/adapted/boost_array.qbk] [include reference/geometries/adapted/boost_fusion.qbk] [include reference/geometries/adapted/boost_tuple.qbk] @@ -102,6 +103,10 @@ [include generated/crosses.qbk] [endsect] +[section:densify densify] +[include generated/densify.qbk] +[endsect] + [section:difference difference] [include generated/difference.qbk] [endsect] @@ -330,18 +335,14 @@ [endsect] +[section:srs SRS] +[include generated/srs_spheroid.qbk] +[endsect] [section:strategies Strategies] -[include generated/distance_pythagoras.qbk] -[include generated/distance_pythagoras_box_box.qbk] -[include generated/distance_pythagoras_point_box.qbk] -[include generated/distance_haversine.qbk] -[include generated/distance_projected_point.qbk] -[include generated/distance_cross_track.qbk] -[include generated/distance_cross_track_point_box.qbk] -[include generated/area_surveyor.qbk] +[include generated/area_cartesian.qbk] [include generated/area_spherical.qbk] -[/include generated/area_geographic.qbk] +[include generated/area_geographic.qbk] [include generated/buffer_join_round.qbk] [include generated/buffer_join_miter.qbk] [include generated/buffer_end_round.qbk] @@ -354,9 +355,20 @@ [include generated/centroid_average.qbk] [include generated/centroid_bashein_detmer.qbk] [include generated/convex_hull_graham_andrew.qbk] +[include generated/densify_cartesian.qbk] +[include generated/densify_geographic.qbk] +[include generated/densify_spherical.qbk] +[include generated/distance_pythagoras.qbk] +[include generated/distance_pythagoras_box_box.qbk] +[include generated/distance_pythagoras_point_box.qbk] +[include generated/distance_haversine.qbk] +[include generated/distance_projected_point.qbk] +[include generated/distance_cross_track.qbk] +[include generated/distance_cross_track_point_box.qbk] [include generated/side_side_by_triangle.qbk] [include generated/side_side_by_cross_track.qbk] [include generated/side_spherical_side_formula.qbk] +[include generated/side_geographic.qbk] [include generated/simplify_douglas_peucker.qbk] [include generated/transform_inverse_transformer.qbk] [include generated/transform_map_transformer.qbk] diff --git a/doc/reference/algorithms/densify.qbk b/doc/reference/algorithms/densify.qbk new file mode 100644 index 000000000..676e59a13 --- /dev/null +++ b/doc/reference/algorithms/densify.qbk @@ -0,0 +1,25 @@ +[/============================================================================ + Boost.Geometry + + Copyright (c) 2018, Oracle and/or its affiliates. + Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + + 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) +=============================================================================/] + +[def __this_function__ densify] + +[heading_conformance_no_ogc __this_function__] +[note PostGIS contains an algorithm ST_Segmentize with the same functionality. + See the [@http://www.postgis.org/docs/ST_Segmentize.html PostGIS documentation]. +] + +[heading Behavior] +The algorithm divides segments of a geometry if they are longer than passed +distance into smaller segments. + +[note The units of the distance depends on strategy. In order to change the +default behavior a user has to create a strategy and pass it explicitly into +the algorithm.] diff --git a/doc/reference/geometries/adapted/boost_array.qbk b/doc/reference/geometries/adapted/boost_array.qbk index c2a95998b..54dcc1708 100644 --- a/doc/reference/geometries/adapted/boost_array.qbk +++ b/doc/reference/geometries/adapted/boost_array.qbk @@ -20,7 +20,7 @@ A boost::array is (optionally) adapted to the Boost.Geometry point concept. It can therefore be used in all Boost.Geometry algorithms. A boost::array can be the point type used by the models linestring, polygon, segment, -box, and ring +box, and ring. [heading Model of] [link geometry.reference.concepts.concept_point Point Concept] diff --git a/doc/reference/geometries/adapted/boost_tuple.qbk b/doc/reference/geometries/adapted/boost_tuple.qbk index a49124382..1fcb19a8e 100644 --- a/doc/reference/geometries/adapted/boost_tuple.qbk +++ b/doc/reference/geometries/adapted/boost_tuple.qbk @@ -29,7 +29,7 @@ tuples with 10 elements (though most algorithms do not support so many dimensions). A tuple can be the point type used by the models linestring, polygon, segment, -box, and ring +box, and ring. [heading Model of] [link geometry.reference.concepts.concept_point Point Concept] diff --git a/doc/reference/geometries/adapted/std_array.qbk b/doc/reference/geometries/adapted/std_array.qbk new file mode 100644 index 000000000..c3b4b960f --- /dev/null +++ b/doc/reference/geometries/adapted/std_array.qbk @@ -0,0 +1,38 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2012 Bruno Lalande, Paris, France. + Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:std_array C++11 Array Container] + +C++11 array containers are adapted to the Boost.Geometry point concept + +[heading Description] + +A C++11 std::array is (optionally) adapted to the Boost.Geometry +point concept. It can therefore be used in all Boost.Geometry algorithms. + +A std::array can be the point type used by the models linestring, polygon, segment, +box, and ring. + +[heading Model of] +[link geometry.reference.concepts.concept_point Point Concept] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[std_array] +[std_array_output] + +[endsect] + diff --git a/doc/release_notes.qbk b/doc/release_notes.qbk index a144628c8..3938957c2 100644 --- a/doc/release_notes.qbk +++ b/doc/release_notes.qbk @@ -6,8 +6,8 @@ Copyright (c) 2009-2017 Mateusz Loskot , London, UK. Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland. - This file was modified by Oracle on 2015, 2017. - Modifications copyright (c) 2015-2017, Oracle and/or its affiliates. + This file was modified by Oracle on 2015, 2017, 2018. + Modifications copyright (c) 2015-2018, Oracle and/or its affiliates. Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -18,6 +18,37 @@ [section:release_notes Release Notes] +[/=================] +[heading Boost 1.67] +[/=================] + +[*Improvements] + +* New map projection and SRS transformation representations (undocumented for now due to potential interface changes). +* New densify() algorithm. +* No longer using std::iterator (thanks to Daniela Engert). +* No longer using allocator directly in the rtree. Replaced with boost::container::allocator_traits (thanks to Daniela Engert). +* Default rtree allocator changed to boost::container::new_allocator to still support move semantics emulation in C++03 with boost::container::allocator_traits. +* Area strategies interface changed. This is potentially a breaking change. +* Radius or Sphere can be passed into spherical strategies. +* Added Point-Box and Box-Box spherical and geographic distance() strategies. +* Simplify (multi)polygons will discard output rings of 2 points or (for closed polygons) 3 points, but it tries to avoid creating those +* Simplify (multi)polygons will omit empty interior rings or polygons from output + +[*Solved issues] + +* [@https://svn.boost.org/trac10/ticket/13381 13381] Compile error with matrix_transformer in Visual C++ 2015 +* [@https://svn.boost.org/trac10/ticket/13436 13436] Incorrectness in boost::geometry::model::polygon documentation + +[*Bugfixes] + +* Add missing strategy resolving in length() algorithm, affecting Variant support. +* Simplify (multi)polygons now simplifies closing point + +[*Changes in behavior] + +* Simplify (multi)polygons now usually rotates input rings before simplifying to select a non collinear point on its convex hull. This improves output. + [/=================] [heading Boost 1.66] [/=================] @@ -152,7 +183,7 @@ * [@https://svn.boost.org/trac/boost/ticket/11725 11725] union_ fails to create holes * [@https://svn.boost.org/trac/boost/ticket/11789 11789] Assertion failure or invalid result of set operations for spherical_equatorial coordinate system. * [@https://svn.boost.org/trac/boost/ticket/11917 11917] Andoyer distance strategy returns 0 for antipodal points (default geographic distance). -* [@https://svn.boost.org/trac/boost/ticket/11928 11928] Improvement of the accuracy of surveyor area strategy. +* [@https://svn.boost.org/trac/boost/ticket/11928 11928] Improvement of the accuracy of surveyor (cartesian) area strategy. * [@https://svn.boost.org/trac/boost/ticket/11966 11966] Compilation error in svg() for box and non-int coordinate type. * [@https://svn.boost.org/trac/boost/ticket/11984 11984] union_() generates self-intersecting polygon * [@https://svn.boost.org/trac/boost/ticket/11987 11987] rtree::remove() not compiling for geographic CS. diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index 38c39dbd1..9b62521e1 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -4,10 +4,11 @@ # Copyright (c) 2008-2015 Bruno Lalande, Paris, France. # Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -# This file was modified by Oracle on 2014, 2015. -# Modifications copyright (c) 2014-2015, Oracle and/or its affiliates. +# This file was modified by Oracle on 2014, 2015, 2018. +# Modifications copyright (c) 2014-2018, Oracle and/or its affiliates. # Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle +# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle # Use, modification and distribution is subject to the Boost Software License, # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -40,6 +41,8 @@ exe convert : convert.cpp ; exe convex_hull : convex_hull.cpp ; exe correct : correct.cpp ; +exe densify : densify.cpp ; +exe densify_strategy : densify_strategy.cpp ; exe difference : difference.cpp ; exe distance : distance.cpp ; diff --git a/doc/src/examples/algorithms/area_with_strategy.cpp b/doc/src/examples/algorithms/area_with_strategy.cpp index a0171304e..8d7803d8b 100644 --- a/doc/src/examples/algorithms/area_with_strategy.cpp +++ b/doc/src/examples/algorithms/area_with_strategy.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // 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) @@ -20,16 +24,27 @@ namespace bg = boost::geometry; /*< Convenient namespace alias >*/ int main() { - // Calculate the area of a cartesian polygon - bg::model::polygon > poly; - bg::read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly); - double area = bg::area(poly); + // Create spherical polygon + bg::model::polygon > > sph_poly; + bg::read_wkt("POLYGON((0 0,0 1,1 0,0 0))", sph_poly); + + // Create spherical strategy with mean Earth radius in meters + bg::strategy::area::spherical<> sph_strategy(6371008.8); + + // Calculate the area of a spherical polygon + double area = bg::area(sph_poly, sph_strategy); std::cout << "Area: " << area << std::endl; - // Calculate the area of a spherical polygon (for latitude: 0 at equator) - bg::model::polygon > > sph_poly; - bg::read_wkt("POLYGON((0 0,0 45,45 0,0 0))", sph_poly); - area = bg::area(sph_poly); + // Create geographic polygon + bg::model::polygon > > geo_poly; + bg::read_wkt("POLYGON((0 0,0 1,1 0,0 0))", geo_poly); + + // Create geographic strategy with WGS84 spheroid + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + bg::strategy::area::geographic<> geo_strategy(spheroid); + + // Calculate the area of a geographic polygon + area = bg::area(geo_poly, geo_strategy); std::cout << "Area: " << area << std::endl; return 0; @@ -42,8 +57,8 @@ int main() /*` Output: [pre -Area: 16 -Area: 0.339837 +Area: 6.18249e+09 +Area: 6.15479e+09 ] */ //] diff --git a/doc/src/examples/algorithms/densify.cpp b/doc/src/examples/algorithms/densify.cpp new file mode 100644 index 000000000..68f7426c6 --- /dev/null +++ b/doc/src/examples/algorithms/densify.cpp @@ -0,0 +1,47 @@ +// Boost.Geometry +// QuickBook Example + +// Copyright (c) 2018, Oracle and/or its affiliates +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// 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) + +//[densify +//` Shows how to densify a polygon + +#include + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + polygon_type poly; + boost::geometry::read_wkt( + "POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,4 1,4 4,1 4,1 1))", poly); + + polygon_type res; + + boost::geometry::densify(poly, res, 6.0); + + std::cout << "densified: " << boost::geometry::wkt(res) << std::endl; + + return 0; +} + +//] + +//[densify_output +/*` +Output: +[pre +densified: POLYGON((0 0,0 5,0 10,5 10,10 10,10 5,10 0,5 0,0 0),(1 1,4 1,4 4,1 4,1 1)) +] +*/ +//] diff --git a/doc/src/examples/algorithms/densify_strategy.cpp b/doc/src/examples/algorithms/densify_strategy.cpp new file mode 100644 index 000000000..eb9934995 --- /dev/null +++ b/doc/src/examples/algorithms/densify_strategy.cpp @@ -0,0 +1,50 @@ +// Boost.Geometry +// QuickBook Example + +// Copyright (c) 2018, Oracle and/or its affiliates +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// 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) + +//[densify_strategy +//` Shows how to densify a linestring in geographic coordinate system + +#include + +#include +#include +#include + +int main() +{ + namespace bg = boost::geometry; + typedef bg::model::point > point_type; + typedef bg::model::linestring linestring_type; + + linestring_type ls; + bg::read_wkt("LINESTRING(0 0,1 1)", ls); + + linestring_type res; + + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + bg::strategy::densify::geographic<> strategy(spheroid); + + boost::geometry::densify(ls, res, 50000.0, strategy); + + std::cout << "densified: " << boost::geometry::wkt(res) << std::endl; + + return 0; +} + +//] + +//[densify_strategy_output +/*` +Output: +[pre +densified: LINESTRING(0 0,0.249972 0.250011,0.499954 0.500017,0.749954 0.750013,1 1) +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/Jamfile.v2 b/doc/src/examples/geometries/adapted/Jamfile.v2 index dd40a2494..359a42511 100644 --- a/doc/src/examples/geometries/adapted/Jamfile.v2 +++ b/doc/src/examples/geometries/adapted/Jamfile.v2 @@ -21,5 +21,6 @@ exe boost_polygon_point : boost_polygon_point.cpp ; exe boost_polygon_polygon : boost_polygon_polygon.cpp ; exe boost_polygon_ring : boost_polygon_ring.cpp ; exe boost_tuple : boost_tuple.cpp ; +exe std_array : std_array.cpp ; build-project boost_range ; diff --git a/doc/src/examples/geometries/adapted/std_array.cpp b/doc/src/examples/geometries/adapted/std_array.cpp new file mode 100644 index 000000000..043cf6494 --- /dev/null +++ b/doc/src/examples/geometries/adapted/std_array.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#ifdef BOOST_NO_CXX11_HDR_ARRAY + +int main() +{ + return 0; +} + +#else //this example needs C++11 std::array + +//[std_array +//` Shows how to use a C++11 std::array using Boost.Geometry's distance, set and assign_values algorithms + +#include + +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_STD_ARRAY_CS(cs::cartesian) + +int main() +{ + std::array a = { {1, 2} }; + std::array b = { {2, 3} }; + std::cout << boost::geometry::distance(a, b) << std::endl; + + boost::geometry::set<0>(a, 1.1f); + boost::geometry::set<1>(a, 2.2f); + 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); + + return 0; +} + +//] + +#endif //BOOST_NO_CXX11_HDR_ARRAY + +//[std_array_output +/*` +Output: +[pre +1.41421 +1.20416 +1.55563 +] +*/ +//] diff --git a/example/c08_custom_non_std_example.cpp b/example/c08_custom_non_std_example.cpp index be5eed1bd..0a545a3de 100644 --- a/example/c08_custom_non_std_example.cpp +++ b/example/c08_custom_non_std_example.cpp @@ -14,7 +14,6 @@ #include -#include #include #include #include diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp index f8b9c27c4..49bf0878b 100644 --- a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp +++ b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp @@ -72,9 +72,13 @@ namespace std template <> class back_insert_iterator - : public std::iterator { public: + typedef std::output_iterator_tag iterator_category; + typedef void value_type; + typedef void difference_type; + typedef void pointer; + typedef void reference; typedef wxPointPointerPair container_type; diff --git a/extensions/test/algorithms/dissolve.cpp b/extensions/test/algorithms/dissolve.cpp index 197f433b9..cd46b216b 100644 --- a/extensions/test/algorithms/dissolve.cpp +++ b/extensions/test/algorithms/dissolve.cpp @@ -87,6 +87,12 @@ namespace std::string const dissolve_16 = "POLYGON((1 3,4 5,7 3,4 1,1 3),(2 2,4 4,6 2,6 4,4 2,2 4,2 2))"; + // Contains two types of turns + std::string const dissolve_17 = "POLYGON((0 1,0 5,3 5,3 2,2 3,4 3,4 0,5 1,0 1))"; + + // Same but with one more, creating a positive turn too + std::string const dissolve_18 = "POLYGON((0 1,0 5,3 5,3 2,2 3,4 3,4 0,6 2,6 1,0 1))"; + // Non intersection, but with duplicate std::string const dissolve_d1 = "POLYGON((0 0,0 4,4 0,4 0,0 0))"; @@ -108,6 +114,13 @@ namespace // Hole: self-intersecting hole std::string const dissolve_h4 = "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 3,3 2.5,1 3.5,1.5 3.5,1 1))"; + // Star having an extra thingy + std::string const dissolve_star_a = "POLYGON((20.1493053436279300 3.3291947841644287,13.9365568161010740 3.7241046428680420,18.7846546173095700 1.0315386056900024,18.7846546173095700 0.9956377148628235,17.9586830139160160 4.6934285163879395,15.1575593948364260 1.2828447818756104,20.1493053436279300 3.3291947841644287))"; + // Star with larger extra thingy + std::string const dissolve_star_b = "POLYGON((20.1493053436279300 3.3291947841644287,13.9365568161010740 3.7241046428680420,18.7846546173095700 1.0315386056900024,18.7846546173095700 0.500000000000000,17.9586830139160160 4.6934285163879395,15.1575593948364260 1.2828447818756104,20.1493053436279300 3.3291947841644287))"; + // Star without extra thingy + std::string const dissolve_star_c = "POLYGON((20.1493053436279300 3.3291947841644287,13.9365568161010740 3.7241046428680420,18.7846546173095700 1.0315386056900024,17.9586830139160160 4.6934285163879395,15.1575593948364260 1.2828447818756104,20.1493053436279300 3.3291947841644287))"; + std::string const multi_three_triangles = "MULTIPOLYGON(((1 1,5 5,8 0,1 1)),((4 2,0 8,5 9,4 2)),((5 3,4 8,10 4,5 3)))"; std::string const multi_simplex_two = "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)))"; std::string const multi_simplex_three = "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)))"; @@ -186,20 +199,24 @@ struct map_visitor void visit_turns(int phase, Turns const& turns) { typedef typename boost::range_value::type turn_type; - std:size_t index = 0; + std::size_t index = 0; BOOST_FOREACH(turn_type const& turn, turns) { switch (phase) { - case 1 : // after self_turns - m_mapper.map(turn.point, "fill:rgb(255,128,0);" - "stroke:rgb(0,0,0);stroke-width:1", 4); + case 2 : // after self_turns and enrich + if (turn.discarded) + { + m_mapper.map(turn.point, "fill:rgb(255,128,0);", 2); + } + else + { + m_mapper.map(turn.point, "fill:rgb(255,128,0);" + "stroke:rgb(0,0,0);stroke-width:1", 4); + } break; - case 3 : // after enrich/traverse for union - label_turn(index, turn, -5, "fill:rgb(0,0,128);"); - break; - case 5 : // after enrich/traverse for intersection - label_turn(index, turn, 5, "fill:rgb(0,0,0);"); + case 3 : // after enrich/traverse + label_turn(index, turn, -2, "fill:rgb(0,0,128);"); break; } index++; @@ -218,6 +235,21 @@ struct map_visitor bg::detail::overlay::traverse_error_type ) {} + template + void visit_generated_rings(Rings const& rings) + { + typedef typename boost::range_value::type ring_type; + BOOST_FOREACH(ring_type const& ring, rings) + { + double const area = bg::area(ring); + std::string const color = area < 0 ? "rgb(255,0,0)" : "rgb(0,0,255)"; + std::string const style = "stroke:" + color + + ";stroke-width:0.1;fill-opacity:0.1;fill:" + color; + m_mapper.map(ring, style); + } + } + + private : template @@ -227,22 +259,16 @@ private : bool result = false; if (! turn.discarded) { - if (turn.operations[index].enriched.next_ip_index != -1) - { - os << "->" << turn.operations[index].enriched.next_ip_index; - if (turn.operations[index].enriched.next_ip_index != -1) - { - result = true; - } - } - else - { - os << "->" << turn.operations[index].enriched.travels_to_ip_index; - if (turn.operations[index].enriched.travels_to_ip_index != -1) - { - result = true; - } - } + os << "->" << turn.operations[index].enriched.get_next_turn_index(); + result = true; + } + if (turn.operations[index].enriched.prefer_start) + { + os << "$"; + } + if (! turn.operations[index].enriched.startable) + { + os << "@"; } return result; @@ -252,7 +278,7 @@ private : void label_turn(std::size_t index, Turn const& turn, int y_offset, std::string const& color) { std::ostringstream out; - out << index << " "; + out << index; if (turn.cluster_id != -1) { out << " c=" << turn.cluster_id << " "; @@ -260,10 +286,6 @@ private : bool lab1 = label_operation(turn, 0, out); out << " / "; bool lab2 = label_operation(turn, 1, out); - if (turn.switch_source) - { - out << "#"; - } if (turn.discarded) { out << "!"; @@ -293,7 +315,7 @@ private : #endif -//! Unittest settings: validity, tolerance +//! Unittest settings struct ut_settings { double percentage; @@ -328,7 +350,8 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, //std::cout << bg::area(geometry) << std::endl; - std::vector dissolved1; + typedef bg::model::multi_polygon multi_polygon; + multi_polygon dissolved1; // Check dispatch::dissolve { @@ -368,42 +391,34 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, mapper.add(geometry); mapper.map(geometry, "fill-opacity:0.5;fill:rgb(153,204,0);" - "stroke:rgb(153,204,0);stroke-width:3;fill-rule:nonzero"); + "stroke:rgb(153,204,0);stroke-width:2;fill-rule:nonzero;"); map_visitor visitor(mapper); #endif bg::dispatch::dissolve < - typename bg::tag::type, - typename bg::tag::type, Geometry, - GeometryOut + GeometryOut, + false >::apply(geometry, robust_policy, std::back_inserter(dissolved1), strategy, visitor); #if defined(TEST_WITH_SVG) BOOST_FOREACH(GeometryOut& dissolved, dissolved1) { - mapper.map(dissolved, "fill:none;stroke-opacity:0.4;stroke:rgb(255,0,255);stroke-width:8;"); + mapper.map(dissolved, "fill-opacity:0.1;fill:rgb(255,0,0);" + "stroke-opacity:0.4;stroke:rgb(255,0,255);stroke-width:3;" + "fill-rule:nonzero;"); } #endif } - // Check dissolve_inserter - std::vector dissolved2; - bg::dissolve_inserter(geometry, std::back_inserter(dissolved2)); - - // Check dissolve and validity, assuming GeometryOut is a single polygon - typedef bg::model::multi_polygon multi_polygon; - multi_polygon dissolved3; - bg::dissolve(geometry, dissolved3); - if (settings.test_validity) { std::string message; - bool const valid = bg::is_valid(dissolved3, message); + bool const valid = bg::is_valid(dissolved1, message); BOOST_CHECK_MESSAGE(valid, "dissolve: " << caseid << " geometry is not valid: " << message); @@ -414,20 +429,12 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, { bg::unique(dissolved); } - BOOST_FOREACH(GeometryOut& dissolved, dissolved2) - { - bg::unique(dissolved); - } - BOOST_FOREACH(GeometryOut& dissolved, dissolved3) - { - bg::unique(dissolved); - } typename bg::default_area_result::type length_or_area = 0; std::size_t holes = 0; std::size_t count = 0; - BOOST_FOREACH(GeometryOut& dissolved, dissolved2) + BOOST_FOREACH(GeometryOut& dissolved, dissolved1) { length_or_area += is_line ? bg::length(dissolved) : bg::area(dissolved); @@ -453,8 +460,26 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, BOOST_CHECK_EQUAL(holes, expected_hole_count); BOOST_CHECK_CLOSE(length_or_area, expected_area, settings.percentage); + // Check dissolve_inserter + std::vector dissolved2; + bg::dissolve_inserter(geometry, std::back_inserter(dissolved2)); + + // Check dissolve and validity, assuming GeometryOut is a single polygon + multi_polygon dissolved3; + bg::dissolve(geometry, dissolved3); + + BOOST_FOREACH(GeometryOut& dissolved, dissolved2) + { + bg::unique(dissolved); + } + BOOST_FOREACH(GeometryOut& dissolved, dissolved3) + { + bg::unique(dissolved); + } + BOOST_CHECK_EQUAL(dissolved1.size(), dissolved2.size()); BOOST_CHECK_EQUAL(dissolved1.size(), dissolved3.size()); + if (dissolved1.size() == dissolved2.size() && dissolved1.size() == dissolved3.size()) { @@ -471,7 +496,7 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, template -void test_one(std::string const& caseid, std::string const& wkt, +void test_one(std::string caseid, std::string const& wkt, double expected_area, std::size_t expected_clip_count, std::size_t expected_hole_count, @@ -490,6 +515,16 @@ void test_one(std::string const& caseid, std::string const& wkt, expected_clip_count, expected_hole_count, expected_point_count, settings); + // Verify if reversed version is indeed identical (it should, because each + // ring is now corrected within dissolve itself + bg::reverse(geometry); + + caseid += "_rev"; + test_dissolve(caseid, geometry, + expected_area, + expected_clip_count, expected_hole_count, expected_point_count, + settings); + #ifdef BOOST_GEOMETRY_TEST_MULTI_PERMUTATIONS // Test different combinations of a multi-polygon @@ -535,19 +570,19 @@ void test_one(std::string const& caseid, std::string const& wkt, ut_settings settings; \ (test_one) ( #caseid, caseid, area, clips, holes, points, settings); } -template +template void test_all(ut_settings const& settings_for_sensitive_cases) { - typedef bg::model::ring

ring; - typedef bg::model::polygon

polygon; + typedef bg::model::ring ring; + typedef bg::model::polygon polygon; typedef bg::model::multi_polygon multi_polygon; - TEST_DISSOLVE(dissolve_1, 8.0, 1, 0, 6); + TEST_DISSOLVE(dissolve_1, 8.0, 1, 0, 4); TEST_DISSOLVE(dissolve_2, 7.9296875, 1, 1, 12); TEST_DISSOLVE(dissolve_3, 4.0, 2, 0, 8); TEST_DISSOLVE(dissolve_4, 8.0, 2, 0, 8); TEST_DISSOLVE(dissolve_5, 12.0, 2, 0, 8); - TEST_DISSOLVE(dissolve_6, 16.0, 1, 0, 6); + TEST_DISSOLVE(dissolve_6, 16.0, 1, 0, 5); TEST_DISSOLVE(dissolve_7, 50.48056402439, 1, 0, 7); TEST_DISSOLVE(dissolve_8, 25.6158412, 1, 0, 11); @@ -563,22 +598,27 @@ void test_all(ut_settings const& settings_for_sensitive_cases) TEST_DISSOLVE(dissolve_14, 4.0, 3, 0, 13); TEST_DISSOLVE(dissolve_15, 4.0, 3, 0, 13); -#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS - TEST_DISSOLVE(dissolve_16, 99999.0, 9, 99, 999); -#endif + TEST_DISSOLVE(dissolve_16, 8.2667, 8, 0, 38); + + TEST_DISSOLVE(dissolve_17, 14.5, 2, 0, 11); + TEST_DISSOLVE(dissolve_18, 15.0, 3, 0, 15); TEST_DISSOLVE(dissolve_d1, 8.0, 1, 0, 4); - TEST_DISSOLVE(dissolve_d2, 16.0, 1, 0, 10); + TEST_DISSOLVE(dissolve_d2, 16.0, 1, 0, 5); - TEST_DISSOLVE(dissolve_h1_a, 16.0, 1, 0, 6); - TEST_DISSOLVE(dissolve_h1_b, 14.0, 1, 1, 10); - TEST_DISSOLVE(dissolve_h2, 16.25, 1, 0, 8); - TEST_DISSOLVE(dissolve_h3, 16.0, 1, 0, 5); // no generated hole (yet) - TEST_DISSOLVE(dissolve_h4, 14.484848, 1, 1, 9); + TEST_DISSOLVE(dissolve_h1_a, 14.0, 1, 1, 9); + TEST_DISSOLVE(dissolve_h1_b, 14.0, 1, 1, 9); + TEST_DISSOLVE(dissolve_h2, 12.5, 2, 0, 13); + TEST_DISSOLVE(dissolve_h3, 10.75, 1, 1, 14); + TEST_DISSOLVE(dissolve_h4, 14.3447, 1, 3, 17); + + TEST_DISSOLVE(dissolve_star_a, 7.38821, 2, 0, 15); + TEST_DISSOLVE(dissolve_star_b, 7.28259, 2, 0, 15); + TEST_DISSOLVE(dissolve_star_c, 7.399696, 1, 0, 11); TEST_DISSOLVE(dissolve_mail_2017_09_24_a, 0.5, 2, 0, 8); - TEST_DISSOLVE(dissolve_mail_2017_09_24_b, 16.0, 1, 0, 6); + TEST_DISSOLVE(dissolve_mail_2017_09_24_b, 16.0, 1, 0, 5); TEST_DISSOLVE(dissolve_mail_2017_09_24_c, 0.5, 2, 0, 8); TEST_DISSOLVE(dissolve_mail_2017_09_24_d, 0.5, 1, 0, 4); TEST_DISSOLVE(dissolve_mail_2017_09_24_e, 0.001801138128, 5, 0, 69); @@ -588,7 +628,7 @@ void test_all(ut_settings const& settings_for_sensitive_cases) TEST_DISSOLVE(dissolve_mail_2017_09_24_h, 0.5, 1, 0, 4); TEST_DISSOLVE(dissolve_mail_2017_10_26_a, 7.0, 1, 1, 12); - TEST_DISSOLVE(dissolve_mail_2017_10_26_b, 16.0, 1, 0, 7); + TEST_DISSOLVE(dissolve_mail_2017_10_26_b, 16.0, 1, 0, 5); TEST_DISSOLVE(dissolve_mail_2017_10_26_c, 6.0, 1, 0, 6); TEST_DISSOLVE(dissolve_mail_2017_10_30_a, 0.0001241171, 2, 0, 9); @@ -601,31 +641,27 @@ void test_all(ut_settings const& settings_for_sensitive_cases) TEST_MULTI(multi_simplex_four, 20.7581, 1, 0, 18); TEST_MULTI(multi_disjoint, 24.0, 4, 0, 16); TEST_MULTI(multi_new_interior, 19.5206, 1, 1, 18); - TEST_MULTI(ggl_list_20110307_javier_01_a, 6400.0, 2, 0, 14); + TEST_MULTI(ggl_list_20110307_javier_01_a, 6400.0, 2, 0, 11); - TEST_DISSOLVE(ggl_list_20110307_javier_01_b, 3993600.0, 1, 2, 19); + TEST_DISSOLVE(ggl_list_20110307_javier_01_b, 3993600.0, 1, 2, 16); TEST_DISSOLVE_WITH(dissolve_ticket17, 0.00920834633689, 1, 1, 228, settings_for_sensitive_cases); TEST_DISSOLVE_WITH(dissolve_reallife, 91756.916526794434, 1, 0, 25, settings_for_sensitive_cases); -#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS - // To fix this, and ggl_list_denis, it is necessary to follow in both - // positive AND negative direction, which is not supported yet. - TEST_DISSOLVE(gitter_2013_04_a, 99999.0, 9, 99, 999); -#endif + TEST_DISSOLVE(gitter_2013_04_a, 3043.9181, 3, 0, 21); TEST_DISSOLVE(gitter_2013_04_b, 31210.429356259738, 1, 0, 11); -#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS - TEST_DISSOLVE(ggl_list_denis, 99999.0, 9, 99, 999); -#endif + TEST_DISSOLVE(ggl_list_denis, 21123.3281, 2, 0, 22); } int test_main(int, char* []) { - test_all >(ut_settings(0.01)); - test_all >(ut_settings()); + test_all, true >(ut_settings(0.01)); + test_all, true >(ut_settings()); + // Counter clockwise input does not work correctly in all cases, it is + // partly a problem of the test itself return 0; } diff --git a/extensions/test/gis/Jamfile.v2 b/extensions/test/gis/Jamfile.v2 index ac76bde76..bc67517dd 100644 --- a/extensions/test/gis/Jamfile.v2 +++ b/extensions/test/gis/Jamfile.v2 @@ -5,11 +5,14 @@ # Copyright (c) 2009-2012 Mateusz Loskot, London, UK. # Copyright (c) 2015 Adam Wulkiewicz, Lodz, Poland. # +# This file was modified by Oracle on 2017. +# Modifications copyright (c) 2017, Oracle and/or its affiliates. +# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle +# # 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) build-project io ; build-project latlong ; -build-project projections ; diff --git a/extensions/test/gis/projections/Jamfile.v2 b/extensions/test/gis/projections/Jamfile.v2 deleted file mode 100644 index 8e68c39a3..000000000 --- a/extensions/test/gis/projections/Jamfile.v2 +++ /dev/null @@ -1,18 +0,0 @@ -# Boost.Geometry (aka GGL, Generic Geometry Library) -# -# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -# Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -# Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -# -# 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) - -test-suite boost-geometry-extensions-gis-projections - : - [ run projection.cpp ] - [ run projections.cpp ] - [ run projections_combined.cpp ] - [ run projections_static.cpp ] - [ run projection_epsg.cpp ] - ; diff --git a/extensions/test/gis/projections/projections_combined.cpp b/extensions/test/gis/projections/projections_combined.cpp deleted file mode 100644 index 7e77722ad..000000000 --- a/extensions/test/gis/projections/projections_combined.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) -// Unit Test - -// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. - -// 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) - - -#if defined(_MSC_VER) -#pragma warning( disable : 4305 ) // truncation double -> float -#endif // defined(_MSC_VER) - -#include - -#include -#include - -#include -#include -#include - - -#include -#include - -#include -#include -#include -#include - - -template