GithubHelp home page GithubHelp logo

boostorg / geometry Goto Github PK

View Code? Open in Web Editor NEW
420.0 37.0 214.0 47.41 MB

Boost.Geometry - Generic Geometry Library | Requires C++14 since Boost 1.75

Home Page: http://boost.org/libs/geometry

License: Boost Software License 1.0

C++ 99.88% HTML 0.01% Shell 0.01% CMake 0.10%
boost generic-geometry-library geometry computational-geometry geometric-algorithms cplusplus ogc spatial-analysis spatial-index cxx14 cplusplus-14

geometry's Introduction

Boost.Geometry

Boost.Geometry, part of collection of the Boost C++ Libraries, defines concepts, primitives and algorithms for solving geometry problems. Boost.Geometry is a C++14 header-only library.

Licence Documentation Wiki Mailing List Chat

Test results

Branch Build Coverage Regression Documentation
develop circleci
minimal
coveralls
codecov
geometry index extensions documentation
master circleci
minimal
coveralls
codecov
geometry index documentation

Directories

  • doc - QuickBook documentation sources
  • example - Boost.Geometry examples
  • extensions - examples and tests for the extensions - develop branch
  • include - the sourcecode of Boost.Geometry
  • index - examples and tests for the Spatial Index
  • meta - library metadata
  • test - Boost.Geometry unit tests

geometry's People

Contributors

adl1995 avatar awulkiew avatar ayushgupta138 avatar barendgehrels avatar beman avatar brunolalande avatar danielae avatar digu-007 avatar georgthegreat avatar glenfe avatar grafikrobot avatar jeremy-murphy avatar jhunold avatar jonasdmentia avatar jzmaddock avatar meastp avatar mkaravel avatar mkurdej avatar mlang avatar mloskot avatar norbertwenzel avatar plopresti avatar sdebionne avatar stefan301 avatar sudo-panda avatar talaj avatar tinko92 avatar vissarion avatar vprus avatar zerebubuth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geometry's Issues

Conversion warnings in VS2017

TL;DR:
Visual studio complains about "possible loss of data" in some internal functions related to region_id, because variables of type signed_size_type are assigned to variables of type int. In particular, the internal representation seems to be signed_size_type, but the interface exposes it as int

Explanation

When compiling the cinder library (https://github.com/cinder/Cinder) with VS2017 - 15.3.2 and the latest boost version provided by vcpkg (1.65), I get quite a few conversion warnings from boost/geometry, with most of them being related to region_id.
It seems that the region_id member variables (I found at least two classes with that member so far) are of type signed_size_type, wheras local variables and function parameters/return types are usually just ints (E.g. see here:
https://github.com/boostorg/geometry/blob/develop/include/boost/geometry/algorithms/detail/overlay/aggregate_operations.hpp#L148-L165)

I can make a PR, that silences those particular warnings, however,

  • I don't know if the prefered solution would be to either
    • use static_casts (just tell the compiler to shut up)
    • change the internal representation to int
    • changethe interface representation to signed_size_type (which would probably have "ripple effects"
  • I'm not sure if that PR would be complete (the same problem might be in other functions that don't get instantiated when compiling cinder)
  • I've never contributed anything to boost, so I don't know how to properly test the PR or if I've to prepare it in a particular manner.

Is it possible to rank rtree of points?

I've a Ranked point structure which looks like this -

struct Point {
	Float x;
	Float y;
	Point(Float _x, Float _y) : x(_x), y(_y) {}
};

struct RankedPoint {
	Point point;
	int rank;
	RankedPoint(Point _p, int _rank) : point(_p), rank(_rank) {}
	RankedPoint(Float _x, Float _y, int _rank) : point(_x, _y), rank(_rank) {}
};

And I'm using boost.geometry's registration Macros to register these eg
BOOST_GEOMETRY_REGISTER_POINT_2D(RankedPoint, float, cs::cartesian, point.x, point.y)

I also have a Rectangle structure which corresponds to Box concept of boost.geometry eg

struct Rectangle {
	Point min_corner;
	Point max_corner;
	Rectangle(Point _min, Point _max) : min_corner(_min), max_corner(_max) {}
	Rectangle(Float _x1, Float _y1, Float _x2, Float _y2)
	    : min_corner(_x1, _y1), max_corner(_x2, _y2)
	{
	}
};

BOOST_GEOMETRY_REGISTER_POINT_2D(Point, float, cs::cartesian, x, y)
BOOST_GEOMETRY_REGISTER_BOX(Rectangle, Point, min_corner, max_corner)

Now the task I'm trying to do deals with getting only 100 points ranked by rank(lowest is better) inside a box. So first I create a rtree of points - bgi::rtree<RankedPoint, bgi::dynamic_rstar> tempRT(points, bgi::dynamic_rstar(points.size())); and then create a Rectangle and use rtree's query method eg -

struct Extract_Ranks {
	void operator()(const RankedPoint &p) { Top100Result.push_back(p); }
} callback;

rT.query(bgi::covered_by(rectangle1), boost::make_function_output_iterator(callback));

The problem with this approach is that I've to extract all the points in that rectangle and then sort them by rank and then use starting 100 and delete others. So I was thinking, isn't there a way to either store the points inside rtree sorted by rank or somehow retrieve them sorted by rank so that I don't have to pull millions of points just for top 100 ones.

Intersection A-B and C-D is not equal to intersection B-A C-D

The intersection point returned depend on the direction of a segment. The difference is usually just 1, probably due to rounding.

For example, the intersection between this segment:

4710043 -2665034, 4685409 -2666385

with:

4700000 -2500000, 4700000 -3500000

Can be either:

4700000 -2665585
or
4700000 -2665584

depending on the order of the first segment.

I would expect the order of the segment not to matter.

Very Long Directory Path

In the geometry documentation there is a file with a 196 character path (from the root of a boost install):
.\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry__index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html

This isn't a problem in many installs. However on windows where there is a maximum path length limit of 256 characters, this doesn't leave a lot of breathing room for environments that don't put their boost install very near to the root of their drive.

Could this path please be trimmed (<150 chars would be ideal) so that it isn't an issue?

Calculation error when using union_ in boost 1.65 release

A polygon num: 1210
A Area is 0.0491783
B polygon num: 3201
B Area is 0.0594317 (using bg::area())
calculate A+B=C (using union_(A,B,C))

C polygon num 2143
Output value :C Area is 0.0201694

why the area of union of two multi_polygon is the smallest among all value?

clang 5.0 error

/usr/local/include/boost/geometry/index/detail/rtree/node/variant_dynamic.hpp:188:61: error: no member named 'to_address' in 'boost::pointer_traits<boost::variant<boost::geometry::index::detail::rtree::variant_leaf<std::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, std::pair<double, double> >, boost::geometry::index::quadratic<4, 2>, boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, boost::geometry::index::detail::rtree::allocators<std::allocator<std::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, std::pair<double, double> > >, std::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, std::pair<double, double> >, boost::geometry::index::quadratic<4, 2>, boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, boost::geometry::index::detail::rtree::node_variant_static_tag>, boost::geometry::index::detail::rtree::node_variant_static_tag>, boost::geometry::index::detail::rtree::variant_internal_node<std::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, std::pair<double, double> >, boost::geometry::index::quadratic<4, 2>, boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, boost::geometry::index::detail::rtree::allocators<std::allocator<std::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, std::pair<double, double> > >, std::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, std::pair<double, double> >, boost::geometry::index::quadratic<4, 2>, boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> >, boost::geometry::index::detail::rtree::node_variant_static_tag>, boost::geometry::index::detail::rtree::node_variant_static_tag> > *>' Al::construct(alloc_node, boost::pointer_traits<P>::to_address(p... ~~~~~~~~~~~~~~~~~~~~~~~~~~^

Wrong area calculation for box in a spherical_equatorial CS

Given the code (http://cpp.sh/43sl):

#include <iostream>
#include <boost/geometry.hpp>

using coordinate_system = boost::geometry::cs::spherical_equatorial<boost::geometry::degree>;
using lonlat = boost::geometry::model::point<double, 2, coordinate_system>;
using box = boost::geometry::model::box<lonlat>;
using polygon = boost::geometry::model::polygon<lonlat>;

int main()
{
    box b{
        lonlat{0, 0},
        lonlat{1, 1},
    };

    polygon p;
    p.outer().push_back(lonlat{0, 0});
    p.outer().push_back(lonlat{0, 1});
    p.outer().push_back(lonlat{1, 1});
    p.outer().push_back(lonlat{1, 0});
    p.outer().push_back(lonlat{0, 0});

    std::cout << wkt(b) << std::endl;
    std::cout << wkt(p) << std::endl;
    std::cout << area(b) << std::endl;
    std::cout << area(p) << std::endl;
}

It gives the following output:

POLYGON((0 0,0 1,1 1,1 0,0 0))
POLYGON((0 0,0 1,1 1,1 0,0 0))
1
0.00030461

The problem is that boost::geometry calls the following code to calculate the are of the box:

{
    template <typename Box, typename Strategy>
    static inline typename coordinate_type<Box>::type
    apply(Box const& box, Strategy const&)
    {
        // Currently only works for 2D Cartesian boxes
        assert_dimension<Box, 2>();

        return (get<max_corner, 0>(box) - get<min_corner, 0>(box))
             * (get<max_corner, 1>(box) - get<min_corner, 1>(box));
    }
};

Which as stated can't work in a spherical referential.
Even giving the strategy explicitely does not workaround the bug :)

Cheers,

Failed to build and run geometry test for Boost

We tried to build and run geometry test for Boost. It failed to build due to error: in "test_main_caller( argc, argv )": projection: bonne_spheroid distance found: 17 expected: 35. Could you please help take a look at this? Thanks!

Reproduce steps:

  1. git clone -c core.autocrlf=true --recursive https://github.com/boostorg/boost.git D:\Boost\src
  2. Open a VS 2015 x86 command prompt and browse to D:\Boost\src
  3. .\bootstrap
  4. .\b2 headers variant=release --build-dir=..\out\Release --address-model=32
  5. .\b2 variant=release --build-dir=..\out\Release --address-model=32
  6. .\b2 -j4 variant=release --build-dir=..\out\x86rel libs\geometry\test
    Expected result:
    All tests passed

Actual result:
Running 1 test case...
libs/geometry/test/srs/projections_static.cpp(59): error: in "test_main_caller( argc, argv )": projection: bonne_spheroid distance found: 17 expected: 35

*** 1 failure is detected in the test module "Test Program"

EXIT STATUS: 201
====== END OUTPUT ======
set status=0
if %status% NEQ 0 (
echo Skipping test execution due to testing.execute=off
exit 0
)
"..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.exe" > "..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.output" 2>&1
set status=%ERRORLEVEL%
echo. >> "..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.output"
echo EXIT STATUS: %status% >> "..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.output"
if %status% EQU 0 (
copy "..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.output" "..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.run"
)
set verbose=0
if %status% NEQ 0 (
set verbose=1
)
if %verbose% EQU 1 (
echo ====== BEGIN OUTPUT ======
type "..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.output"
echo ====== END OUTPUT ======
)
exit %status%

...failed testing.capture-output ..\out\x86rel\boost\bin.v2\libs\geometry\test\srs\srs_projections_static.test\msvc-14.1\release\asynch-exceptions-on\threading-multi\srs_projections_static.run...

Adaptor for C++11 std::tuple needed?

Do you see any value in also adapting std::tuple the same as Boost.Tuple? This seems to be the only currently adapted Boost type, that has a C++11 std:: version and is not readily available for use in Geometry.

If there is any interest I'd be willing to do that now, as I have the environment to build the lib and documentation currently set up.

spherical polygon area

Hi,
there may be a bug in calculating the area of spherical polygon. when the polygon 's verticals contain north polar,the result is right ,but when containing south polar, it returns a wrong result.
I have tested POLYGON((0 0,90 0,0 -90,0 0)), we expect to 1.57249 but returning 2.02365.
swanny

Distance strategy for negative buffer

Hi there!
I am making some tests to understand what is going on with the distance strategy when this distance is negative. Using the code below, I got empty MultiPolygons for some values of the buffer. This case only appears with the polygon imported from the given WKT for a buffer of -1e-4, -1e-5 or -1e-6. But it is not empty for -1e-7 and -1e-8. In the self-intersecting case (hourglass), I get weird results (as expected) but not empty MultiPolygons. In the simple case (sqaure), I get proper results whatever the distance of the buffer is.
Is it a bug ? If it is not, could someone explain me why please?
I am using Boost 1.60.
Thank you very much.

#include <iostream>
#include <iomanip>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>

typedef boost::geometry::model::d2::point_xy<double> point_2d;
typedef boost::geometry::model::polygon<point_2d> polygon_2d;
typedef boost::geometry::model::multi_polygon<polygon_2d> multi_polygon_2d;

template <typename T>
void test_buffer(T &geom)
{
    for (double i = -1; i < -1e-8; i/=10)
    {
        multi_polygon_2d tmp;
        boost::geometry::buffer(
            geom,
            tmp,
            boost::geometry::strategy::buffer::distance_symmetric<double>(i),
            boost::geometry::strategy::buffer::side_straight(),
            boost::geometry::strategy::buffer::join_round(),
            boost::geometry::strategy::buffer::end_round(),
            boost::geometry::strategy::buffer::point_circle(360)
            );
        std::cout<<"geom ("<<i<<"): "<<boost::geometry::wkt(tmp)<<std::endl<<std::endl;
    }
}

int main(int argc, const char *argv[])
{
    std::string wkt = "MULTIPOLYGON(((-203.3984972480392 326.87043766411114,-234.3294031269611 350.72117460025004,-234.32940582512484 350.7211767561067,-234.59541944833873 350.9413566745228,-234.5954246133754 350.9413612592119,-234.8456066177885 351.1793768235705,-234.84561145406377 351.179381753826,-235.078768547128 351.43409770182103,-235.07877303157431 351.43410295412707,-235.29379312442313 351.70430436766964,-235.29379723565108 351.7043099169743,-235.39951413618792 351.85781786966413,-240.86780715032046 350.38218215855835,-241.2049443604434 350.30361570297174,-241.20495115354115 350.3036143659985,-241.5467165739732 350.24856362767656,-241.54672344329876 350.24856276394,-241.89147886679623 350.21729162130026,-241.89148577942245 350.2172912349408,-242.23758558935015 350.20994967493,-242.58335698974216 350.2265727030494,-242.5833638895166 350.22657327470256,-242.9271563937872 350.26708130353956,-242.92716323747084 350.2670823512364,-243.26732892181855 350.3312812109238,-243.26733567660713 350.3312827296422,-243.60225063542637 350.4188666739157,-243.93029626301933 350.52941192532916,-243.93030274346452 350.52941436202866,-244.24991952642313 350.66239589829064,-244.55956286161836 350.81717054531686,-244.55956894361645 350.81717385333343,-244.8577608930744 350.99300259862656,-244.85776673160544 350.99300631954446,-245.14307795174008 351.18904635131906,-245.1430835188178 351.18905046730254,-245.41415167705114 351.40436658497003,-245.6696669314724 351.6379177381484,-245.66967187701746 351.63792258327567,-245.90841706208894 351.88859631483484,-266.58920031948566 375.16554041806563,-266.58920258870927 375.16554306360825,-266.8114462984894 375.433970996735,-266.8114505535744 375.43397651693255,-267.0144568842047 375.7172330288498,-267.0144607444406 375.7172388320306,-267.19724352509485 376.01394790994334,-267.1972469717292 376.0139539679166,-267.358918274207 376.32267424871253,-267.35892129049665 376.3226805320497,-267.49869574263016 376.6419123042001,-267.4986983139225 376.6419187823777,-267.6158969147833 376.97011127128593,-267.6158990285875 376.970117912834,-267.7099540930073 377.30568358689385,-267.7804054331035 377.6469788117333,-267.780406603398 377.6469856825949,-267.8269143132387 377.99236621139704,-267.8492510917757 378.34014040558645,-267.84925129584775 378.3401473724138,-267.84730904189666 378.68863970288874,-267.8210977526416 379.03614335774023,-267.8210969865306 379.036150285323,-267.7707424635338 379.3809909713855,-267.6964900867632 379.72148658265553,-267.59870274954784 380.0559764307823,-267.5987005618558 380.05598304835985,-267.4778489339802 380.38285544057135,-267.3345253662763 380.7005096185073,-267.334522280147 380.700515867838,-267.1694203712224 381.00741516970913,-267.1694168572867 381.0074211888939,-266.9833347199501 381.3020805089815,-266.77718414040345 381.58305694993714,-266.7771798240608 381.58306242236944,-266.5519583226944 381.8489968074004,-266.5519536356491 381.8490019658822,-266.30875282540296 382.09860488379184,-232.51589024775978 414.4450812583296,-232.51588002802416 414.4450898114167,-232.51586876173633 414.4450969296367,-232.51585664898366 414.445102486571,-232.51584390488657 414.4451063835295,-232.5158373664838 414.445107686701,-211.12681324719696 417.9713206571314,-211.12680695294904 417.97132149052527,-211.1267942693878 417.9713219522357,-211.12678793120457 417.971321578691,-211.1267816295017 417.9713208036793,-211.12676923690148 417.97131806335767,-211.1267572912145 417.97131377541353,-211.12675154646425 417.9713110717222,-177.1106691504801 400.6223337146699,-177.1106636027793 400.62233015463886,-177.11065830167098 400.6223262368518,-177.11064853019522 400.6223173975823,-177.11064000569968 400.62230735032404,-177.11063625823746 400.6223019274713,-177.11063287618194 400.6222962695118,-177.11062726542067 400.6222843475245,-177.11062327082684 400.622271791345,-177.11062190239758 400.6222653432285,-165.59426937600804 335.9234066092942,-162.6596781566315 302.06171116087233,-162.6596788436905 302.0616975137797,-162.65967988463825 302.06169075731424,-162.65968333706937 302.06167753627386,-162.65968573241835 302.0616711334854,-162.6596885596208 302.06166490931287,-162.65969545477958 302.06165311219564,-162.65970389380263 302.0616423651924,-162.65970864407186 302.06163744906183,-162.65971909523134 302.0616286463092,-162.65973064885196 302.0616213504858,-162.65974308921002 302.0616156978157,-162.6597561840252 302.0616117938428,-162.65976290080164 302.0616105217139,-162.65977651628992 302.06160936686865,-162.65979016210093 302.0616100789291,-162.65979691664793 302.06161113225346,-162.65981013134098 302.0616146089008,-162.65982274871268 302.0616198545771,-204.8758528204258 323.10306070098704,-204.8758584840069 323.10306427432,-204.87586903132672 323.1030725164298,-204.87587838335946 323.10308209337154,-204.87588255785658 323.1030873296329,-204.87588981029387 323.1030985804321,-204.8758928557106 323.103104544516,-204.87589549513 323.1031106990528,-204.87589771671574 323.10311701644275,-204.87590086845387 323.1031300258577,-204.87590225445257 323.1031433396602,-204.8759018498778 323.10315671929584,-204.8444560373964 323.42562807154223,-204.84445513319602 323.42563489982314,-204.78751382477697 323.76528940556193,-204.78751245267617 323.76529615540176,-204.70732324106254 324.10023186228716,-204.60427022620226 324.42884648764846,-204.60426794001853 324.4288529850604,-204.47883820282144 324.74959412196023,-204.47883547479194 324.74960044658303,-204.33162256579686 325.0609494910012,-203.3984972480392 326.87043766411114)))";

    polygon_2d hourglass, square;
    multi_polygon_2d tmp, poly;

    boost::geometry::read_wkt("Polygon ((0 0, 1 1, 1 0, 0 1, 0 0))", hourglass);
    boost::geometry::read_wkt("Polygon ((0 0, 0 1, 1 1, 1 0, 0 0))", square);
    boost::geometry::read_wkt(wkt, poly);

    std::cout<<"hourglass: "<<boost::geometry::wkt(hourglass)<<std::endl<<std::endl;
    test_buffer(hourglass);

    std::cout<<"square: "<<boost::geometry::wkt(square)<<std::endl<<std::endl;
    test_buffer(square);

    std::cout<<"poly: "<<boost::geometry::wkt(poly)<<std::endl<<std::endl;
    test_buffer(poly);

    return 0;
}

Visual Studio 2017 vs Boost 1.66.0 - geometry::detail::self_get_turn_points::self_section_visitor::apply fails to compile with /W4: size_t converted to int, possible loss of data, warning converted to error.

Hi,

We're looking at upgrading our compiler to VC141 and boost is one of our dependencies.
I saw that 1.66.0 came out too close to the release of VS 2017 for you guys to be happy with your testing, so I've been tentatively looking at upgrading boost so that it can be built with VC141 along with the rest of our software. I found a few things, but nothing huge - we compile with /W4, I've been using Visual Studio 2017 Professional v15.5.6.

  1. In \boost_1_66_0\boost\geometry\algorithms\detail\overlay\self_turn_points.hpp,
    This can be fixed by inserting static_casts at line 113 and line 114 around the m_ arguments, which are size_t. Not sure if right fix but easy one for me.
    Warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file ...) ... D:\Development...\3rdParty\boost\boost\geometry\algorithms\detail\overlay\self_turn_points.hpp 118

  2. In \boost_1_66_0\boost\range\concepts.hpp at line 255, there is a prefix to a class member declaration which causes the /W4 compilation of boost 1.66.0 to fail with the following error message:

Error C4596: 'difference_type': illegal qualified name in member declaration (compiling source file ...) ... D:\Development.....\3rdParty\boost\boost\range\concepts.hpp 255

  • fix was simply deleting 'RandomAccessIteratorConcept::'

"..." where I've deleted something.

I hope this information is useful, let me know if I can be of more help.

Clarification regarding a statement in model::box docs

I was reading the documentation here - http://www.boost.org/doc/libs/1_63_0/libs/geometry/doc/html/geometry/reference/models/model_box.html#geometry.reference.models.model_box.c1

and it mentions that

Box is always described by a min_corner() and a max_corner() point. If another rectangle is used, use linear_ring or polygon.

What is meant by - 'if another rectangle is used' here? Does it means more than 2 points are provided or something else that I'm missing?

And what exactly is meant by min_corner() and max_corner()? Does it means more inclination to negative side and positive side? What happens if I reverse them while constructing?

Stale unconditional return statement intended here?

In isea.hpp line 1017 you will see this:

   ...
   hex->x = ((int)v.x << 4) + quad;
   hex->y = v.y;

   return 1;     <-------------

   d = (int)v.x;
   i = (int)v.y;
   ...

Because of this unconditional return statement amidst function isea_hex, msvc barfs bursts of compiler warnings on each encounter:

boost\geometry\srs\projections\proj\isea.hpp(1019) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1023) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1024) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1030) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1032) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1033) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1035) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1036) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1039) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1048) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1050) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1052) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1053) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1056) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1057) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1058) : warning C4702: unreachable code
boost\geometry\srs\projections\proj\isea.hpp(1061) : warning C4702: unreachable code

Is this return statement really intended here?

buffer() works incorrectly on small coordinates

See the demo: http://melpon.org/wandbox/permlink/yMk39ZquRHSIZmKZ

I'm dilating (buffering with positive distance) a small triangle, then convert both input and output polygons to linestrings and measure distance between them. Instead of expected distance I got zero. Output polygon has quite strange shape.

The demo produces WKT for input and output shapes:

LINESTRING(-0.0149623 -0.0269555,-0.0149471 -0.0271355,-0.0149539 -0.0271028,-0.0149623 -0.0269555)
LINESTRING(-0.0138163 -0.0268588,-0.0138012 -0.0270389,-0.0160727 -0.0273712,-0.0160795 -0.0273385,-0.0161104 -0.0270204,-0.0138163 -0.0268588)

That's how these shapes look on https://arthur-e.github.io/Wicket/sandbox-gmaps3.html:

image

Thin vertical bar in the middle is the input. The wide shape is the output. If I tweak input a little, e.g. remove the second vertex from the input polygon, result is correct:

image

Thus I assume my method is correct. Sorry for the strange numbers, I took them from the data I'm currently working on to prepare a repro-case for you. Here is the image of what I get in my project:

image

Look for two red outlines, other stuff is irrelevant. The bigger one is the dilated version of the smaller one. As you can see, it has incorrect shape on the left top side.

VS2017 Update 3 Test failures

Running bjam address-model=64 in libs/geometry/test

$ grep -A5 -B10 failures out.txt
common.mkdir ..\..\..\bin.v2\libs\geometry\test\formulas\formulas_vertex_longitude.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on
common.mkdir ..\..\..\bin.v2\libs\geometry\test\formulas\formulas_vertex_longitude.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on\threading-multi
msvc.manifest ..\..\..\bin.v2\libs\geometry\test\formulas\formulas_inverse.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on\threading-multi\formulas_inverse.exe
msvc.link ..\..\..\bin.v2\libs\geometry\test\formulas\formulas_direct.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on\threading-multi\formulas_direct.exe
testing.capture-output ..\..\..\bin.v2\libs\geometry\test\formulas\formulas_inverse.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on\threading-multi\formulas_inverse.run
====== BEGIN OUTPUT ======
Running 1 test case...
d:/dev/boost/libs/geometry/test/formulas/test_formula.hpp(52): error: in "test_main_caller(_argc,_argv_)": difference{0.0122974} between result{-88.906681419909546} and expected{-90} exceeds 0.1%
d:/dev/boost/libs/geometry/test/formulas/test_formula.hpp(69): error: in "test_main_caller(_argc,_argv_)": result {-88.906681419909546094} and reference {-90} not close enough.

*** 2 failures are detected in the test module "Test Program"

EXIT STATUS: 201
====== END OUTPUT ======


--
msvc.manifest ..\..\..\bin.v2\libs\geometry\test\formulas\formulas_vertex_longitude.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on\threading-multi\formulas_vertex_longitude.exe
compile-c-c++ ..\..\..\bin.v2\libs\geometry\test\algorithms\algorithms_centroid.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on\threading-multi\centroid.obj
centroid.cpp
Unknown compiler version - please run the configure tests and report the results
testing.capture-output ..\..\..\bin.v2\libs\geometry\test\formulas\formulas_vertex_longitude.test\msvc-14.1\debug\address-model-64\asynch-exceptions-on\threading-multi\formulas_vertex_longitude.run
====== BEGIN OUTPUT ======
Running 1 test case...
d:/dev/boost/libs/geometry/test/formulas/test_formula.hpp(52): error: in "test_main_caller(_argc,_argv_)": difference{0.0247883} between result{0.77019371459144814} and expected{0.78928549265438153} exceeds 0.1%
d:/dev/boost/libs/geometry/test/formulas/test_formula.hpp(69): error: in "test_main_caller(_argc,_argv_)": result {0.77019371459144814196} and reference {0.78539816339715939897} not close enough.

*** 2 failures are detected in the test module "Test Program"

EXIT STATUS: 201
====== END OUTPUT ======

Boost Assertion failure running in valgrind

TEST(TestPolygon, BoostPolyValgrind) {
  BoostPolygon a;
  BoostPolygon b;
  boost::geometry::read_wkt(
      "POLYGON((1.75 -5.5,2.75 -5.5,2.75 -6.5,1.75 -6.5,1.75 -5.5))", a);
  boost::geometry::read_wkt(
      "POLYGON((1.25 -5.5,2.25 -5.5,2.25 -6.5,1.25 -6.5,1.25 -5.5))", b);
  // Boost assertion failure in this call:
  bool intersect = boost::geometry::intersects(a, b);
  EXPECT_EQ(intersect, true);
}

Running this in valgrind e.g.
valgrind out

Yields this boost assertion failure:

[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TestPolygon
[ RUN      ] TestPolygon.BoostPolyValgrind
F1122 00:33:45.722594 88400 boost_assertion_failed.cc:16] BOOST_ASSERT failed in function static bool boost::geometry::detail::segment_ratio::less<double, false>::apply(const Ratio &, const Ratio &) [Type = double, IsIntegral = false, Ratio = boost::geometry::segment_ratio<double>] on line 51. Expression: rhs.denominator() != 0

A stack trace:

==88400==  Address 0xffefff004 is on thread 1's stack
==88400==  in frame #6, created by google::GetStackTrace(void**, int, int) (stacktrace_libunwind-inl.h:55)
==88400== 
*** Check failure stack trace: ***
    @           0x4bbe0b  google::LogMessage::SendToLog()
    @           0x4bc2d7  google::LogMessage::Flush()
    @           0x4bf99f  google::LogMessageFatal::~LogMessageFatal()
    @           0x4bad0a  boost::assertion_failed()
    @           0x42cb44  boost::geometry::detail::overlay::collinear<>::apply<>()
    @           0x42ba9e  boost::geometry::detail::overlay::get_turn_info<>::apply<>()
    @           0x42ae88  boost::geometry::detail::get_turns::get_turns_in_sections<>::apply<>()
    @           0x4292f4  boost::geometry::partition<>::apply<>()
    @           0x4290c8  boost::geometry::detail::get_turns::get_turns_generic<>::apply<>()
    @           0x4283cc  boost::geometry::detail::disjoint::disjoint_linear<>::apply()
    @           0x41c7e8  TestPolygon_BoostPolyValgrind_Test::TestBody()

Polygon validation

boost::geometry's WKT-reading code accepts "POLYGON((2 1.3,2.4 1.7))" as a valid WKT string - and it is a valid string but is not a valid polygon, since polygons have to be closed objects under the WKT spec. Is there any way to have the code validate the polygons more strictly, either in WKT-reading or generally?

Duplicate symbols when including extensions/gis/projections/factory.hpp in more than one file

Including extensions/gis/projections/factory.hpp in more than one file leads to duplicate symbol linker errors (with clang on OSX):

duplicate symbol __ZN5boost8geometry11projections6detail7healpix8in_imageEddiii in:
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/Geometry.cpp.rel.o
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/LocationProcessor.cpp.rel.o
duplicate symbol __ZN5boost8geometry11projections6detail7healpix7pj_signEd in:
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/Geometry.cpp.rel.o
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/LocationProcessor.cpp.rel.o
duplicate symbol __ZN5boost8geometry11projections6detail7healpix22healpix_sphere_inverseERKdS5_RdS6_ in:
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/Geometry.cpp.rel.o
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/LocationProcessor.cpp.rel.o
duplicate symbol __ZN5boost8geometry11projections6detail7healpix14healpix_sphereERKdS5_RdS6_ in:
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/Geometry.cpp.rel.o
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/LocationProcessor.cpp.rel.o
duplicate symbol __ZN5boost8geometry11projections6detail7healpix3rotE in:
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/Geometry.cpp.rel.o
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/LocationProcessor.cpp.rel.o
duplicate symbol __ZN5boost8geometry11projections6detail4isea13icostrianglesE in:
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/Geometry.cpp.rel.o
    build/debug/macosx/x86_64/liblocosonic_dylib_obj/src/LocationProcessor.cpp.rel.o
ld: 6 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The culprits are non-inline functions and static namespace members in

  • extensions/gis/projections/proj/healpix.hpp and
  • extensions/gis/projections/proj/isea.hpp

Commenting out these includes and the corresponding _init calls in extensions/gis/projections/factory.hpp fixes the linker errors.

Since these files are automatically generated, I'm not sure where to fix this.

union_ doesn't compile with -Wduplicated-branches -Werror

The following code using union_ compiled without errors in Boost 1.64, but in Boost 1.66 it fails because of duplicated branches:

#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/algorithms/union.hpp>

using Point = boost::geometry::model::d2::point_xy<float>;
using Polygon = boost::geometry::model::polygon<Point>;

int main()
{
    const Polygon polygon1{{Point{0,0}, Point{0,1}, Point{1,0}}};
    const Polygon polygon2{{Point{-1,0}, Point{0,1}, Point{1,0}}};
    std::vector<Polygon> outputPolygon;
    boost::geometry::union_(polygon1, polygon2, outputPolygon);

    return 0;
}

It produces the following errors:

[1/2 0.0/sec] Building CXX object CMakeFiles/boost-geometry-union-test.dir/main.cpp.obj
FAILED: CMakeFiles/boost-geometry-union-test.dir/main.cpp.obj 
D:\app\msys64\mingw64\bin\g++.exe    -g   -Werror -Wduplicated-branches -MD -MT CMakeFiles/boost-geometry-union-test.dir/main.cpp.obj -MF CMakeFiles\boost-geometry-union-test.dir\main.cpp.obj.d -o CMakeFiles/boost-geometry-union-test.dir/main.cpp.obj -c D:/dev/project/test/boost-geometry-union-test/main.cpp
D:/app/msys64/mingw64/include/boost/geometry/algorithms/detail/overlay/overlay.hpp: In instantiation of 'static OutputIterator boost::geometry::detail::overlay::overlay<Geometry1, Geometry2, Reverse1, Reverse2, ReverseOut, GeometryOut, OverlayType>::apply(const Geometry1&, const Geometry2&, const RobustPolicy&, OutputIterator, const Strategy&, Visitor&) [with RobustPolicy = boost::geometry::detail::robust_policy<boost::geometry::model::d2::point_xy<float>, boost::geometry::model::point<long long int, 2, boost::geometry::cs::cartesian>, float>; OutputIterator = boost::geometry::range::back_insert_iterator<std::vector<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> > > >; Strategy = boost::geometry::strategy::intersection::cartesian_segments<>; Visitor = boost::geometry::detail::overlay::overlay_null_visitor; Geometry1 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Geometry2 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; bool Reverse1 = false; bool Reverse2 = false; bool ReverseOut = false; GeometryOut = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; boost::geometry::overlay_type OverlayType = (boost::geometry::overlay_type)0]':
D:/app/msys64/mingw64/include/boost/geometry/algorithms/detail/overlay/overlay.hpp:418:21:   required from 'static OutputIterator boost::geometry::detail::overlay::overlay<Geometry1, Geometry2, Reverse1, Reverse2, ReverseOut, GeometryOut, OverlayType>::apply(const Geometry1&, const Geometry2&, const RobustPolicy&, OutputIterator, const Strategy&) [with RobustPolicy = boost::geometry::detail::robust_policy<boost::geometry::model::d2::point_xy<float>, boost::geometry::model::point<long long int, 2, boost::geometry::cs::cartesian>, float>; OutputIterator = boost::geometry::range::back_insert_iterator<std::vector<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> > > >; Strategy = boost::geometry::strategy::intersection::cartesian_segments<>; Geometry1 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Geometry2 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; bool Reverse1 = false; bool Reverse2 = false; bool ReverseOut = false; GeometryOut = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; boost::geometry::overlay_type OverlayType = (boost::geometry::overlay_type)0]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/union.hpp:290:20:   required from 'static void boost::geometry::resolve_strategy::union_::apply(const Geometry1&, const Geometry2&, const RobustPolicy&, Collection&, boost::geometry::default_strategy) [with Geometry1 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Geometry2 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; RobustPolicy = boost::geometry::detail::robust_policy<boost::geometry::model::d2::point_xy<float>, boost::geometry::model::point<long long int, 2, boost::geometry::cs::cartesian>, float>; Collection = std::vector<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> > >]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/union.hpp:325:40:   required from 'static void boost::geometry::resolve_variant::union_<Geometry1, Geometry2>::apply(const Geometry1&, const Geometry2&, Collection&, const Strategy&) [with Collection = std::vector<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> > >; Strategy = boost::geometry::default_strategy; Geometry1 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Geometry2 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/union.hpp:530:17:   required from 'void boost::geometry::union_(const Geometry1&, const Geometry2&, Collection&) [with Geometry1 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Geometry2 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Collection = std::vector<boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> > >]'
D:/dev/project/test/boost-geometry-union-test/main.cpp:14:62:   required from here
cc1plus.exe: error: this condition has identical branches [-Werror=duplicated-branches]
cc1plus.exe: all warnings being treated as errors
ninja: build stopped: subcommand failed.
14:45:54: The process "D:\app\CMake\bin\cmake.exe" exited with code 1.
Error while building/deploying project boost-geometry-union-test (kit: Qt 5.10.0 MinGW x64 GCC 7.2)
When executing step "CMake Build"

Environment: Windows 10 x64, Msys2, GCC 7.2 x64, Boost 1.66.0 x64.

disjoint unexpectedly returns true

In some cases, disjoint function does not return the expected value. See code below for a failing example:

#include <boost/geometry.hpp>
#include <iostream>

using coordinate_system = boost::geometry::cs::spherical_equatorial<boost::geometry::degree>;
using lonlat = boost::geometry::model::point<double, 2, coordinate_system>;
using box = boost::geometry::model::box<lonlat>;
using polygon = boost::geometry::model::polygon<lonlat>;

int main()
{
    std::cout << "Boost version : " << BOOST_LIB_VERSION << " (" << BOOST_VERSION << ")" << std::endl;

    const std::vector<double> norths{
        48.9021,
        48.90215,
        48.9022,
    };

    for (const auto& north: norths) {
        if (boost::geometry::disjoint(
            box{
                {2.2, 48.88},
                {2.5, 48.9021}
            },
            polygon{{{
                {2.4, north},
                {2.4, 48.89},
                {2.3, 48.89},
                {2.3, north},
            }}}))
            std::cerr << "Unexpected disjoint for north lat : " << std::setprecision(7) << north << std::endl;
    }

    return 0;
}

Output:

Boost version : 1_66 (106600)
Unexpected disjoint for north lat : 48.90215

Reproduced when compiled with Apple Clang:

Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0

Some investigation shows that this happens because the method general_areal::apply receives contradictory information:

  • disjoint_linear<Geometry1, Geometry2>::apply(geometry1, geometry2, strategy) returns true, because, schematically, it considers latitudes 48.90215 and 48.9021 to be close enough to be considered equal
  • rings_containing(geometry2, geometry1, strategy.template get_point_in_geometry_strategy<Geometry1, Geometry2>()) returns false because it considers point with latitude 48.90215 to be outside the box

Some problem in Generating and Improving Documentation

Here is a little problem in Generating and Improving Documentation.

The path when I followed the step compiling doxygen_xml2qbk tool, the path of the following call does not
work.

./b2 libs/geometry/src/docutils/tools/doxygen_xml2qbk

So, I searched the folder and found the right path is:

./b2 libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk

Could you please check this problem, or this problem happened only on my linux?

Distance of (nearly) antipodal points

We want to examine the behaviour of the current formulas for distance computation in geographic coordinate systems, i.e. andoyer, thomas, vincenty.

We do the following experiment (on develop branch): compute the distance between (0,0) and (180,x) where x takes values from 0 to 0.00001 with step 0.0000001. Note that this is a computation along a meridian, in other words the geodesic is a meridian, that is a very special case of nearly antipodal points.

Here are the distances calculated: data.txt; the columns are x, andoyer, thomas and vincenty distance respectively.

See below the plots of computed distance as a function of latitude x for the 3 different formulas.
andoyer.pdf
thomas.pdf
vincenty.pdf

Vincenty seems ok for this test case; andoyer is doing a jump when x is getting close to 0; thomas seems to return more or less arbitrary numbers.

In general all the above formulas are expected to return non accurate results for nearly antipodal points. This is more or less a known issue but I just put it here for future reference until we fix it.

GIS and Boost.Units

I see that your experimental GIS code does distance calculations in meters. I don't see (in my limited search) whether or not you use Boost.Units or are compatible with it. Are you? It would be super cool if you were.

looking for extensions compatible with version in boost 1.61.0

Hi,

I recently upgraded Boost to 1.61.0 and since my software uses some extensions, I came here looking for the matching set of extension files. For Boost 1.60.0 there was a develop-1.60.0 branch but this branch seems missing for Boost 1.61.0. Could you please point me to where I can find the correct set of extension files?

How to buffer() polygons

In Boost 1.61 it seems as though buffer() does not support polygons. I read that there was an experimental implementation of this (the thread was from 2013) - have I come to the right place to try out this implementation? I looked in the 'extensions' directory here but didn't see anything like that.

Improve doxygen files clean-up

Task to improve changes from PR #387

Below are suggestions from @awulkiew which I intend to work on:


Instead of clearing out the index dir in the index/make_qbk.py and doing the same in the make_qbk.py, index/make_qbk.py could be executed with --release-build option and cleanup related to the index could be done only there.

There are generated *.qbk files in directories doc/generated and doc/index/generated which are not needed. Also doc/html/geometry_HTML.manifest file. Ideally they probably should be removed as well, but this should be done after b2 is called. But since b2 can run make_qbk.py and the script is then executed before quickbook it is impossible to implement the cleanup of generated qbk files in this single script. Maybe it could be done in a separate cleanup script run by b2 after building docs from qbk files, but I don't know how exactly.


Reduce test suite when Travis is detected?

Would it be possible to run a reduced version of the test suite when Travis is detected? Perhaps something along the lines of

import os ;

build-project core ;
// other critical tests

if ! [ os.environ TRAVIS ]
{

build-project concepts ; 
// other less critical tests

}

The reason Travis matters, even though you don't use it at the moment, is that the superproject Travis runs the library tests when a library is updated, such as f.ex. here: https://travis-ci.org/boostorg/boost/builds/329477374

point within box not behaving as expected

Pardon me if I'm wrong, but why would such an example give result as 'no'

#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/register/point.hpp>
#include <boost/geometry/geometries/register/box.hpp>

struct my_point
{
    double x, y;
	my_point(double _x, double _y) : x(_x), y(_y) {}
};

struct my_box
{
    my_point ll, ur;
    my_box(double x1, double y1, double x2, double y2) : ll(x1,y1), ur(x2,y2) {}
};

// Register the point type
BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y)

// Register the box type, also notifying that it is based on "my_point"
BOOST_GEOMETRY_REGISTER_BOX(my_box, my_point, ll, ur)

int main()
{
    my_box b(2,1,3,4);
    my_point p(2.0,2.0);
	std::cout << "within: " << (boost::geometry::within(p, b) ? "yes" : "no") << std::endl;
    return 0;
}

I tried to draw a rectangle on paper and the point fell inside it. I'm sure there is something wrong with my approach here, is that box b not qualified to be a box? Or is it something else?

Documentation of index predicates

The documentation of index predicates is a bit sparse and rather obtuse. I forked so I could add something a bit more friendly, but I have a rudimentary knowledge of doxygen and don't want to screw up the documentation.

Its takes a bit of careful reading to figure out that contains will return those geometries that contain the passed geometry and within will return those geometries falling within the passed geometry. It seems these have LHS and RHS swapped, which is counter intuitive. The text "returns the indexed geometries that contain the passed geometry" and "returns the indexed geometries falling within the passed geometry" or some such would be really easy to get quickly.

Obviously very minor -- hoping its a helpful suggestion.

Some problems when getting start for Boost.geometry

Hi all:
I'm a student participated in GSoC about Boost.geometry. When I installed Boost.geometry with wiki there is something wrong.
I used the following command lines to install boost, so the Bost.Geometry may installed on my local repository,

git clone --recursive https://github.com/boostorg/boost.git
cd boost
git checkout develop # or whatever branch you want to use
./bootstrap.sh
./b2 headers

But when I run the following,

cd modular-boost/libs/geometry

the files can not find, and when I run the following:

cd libs/geometry
git checkout develop
git branch -vv
git pull

It run.And after I was added the that Boost directory to the PATH, the following run.

b2 test

Do i got something wrong? Or there are some changes in Boost doc?

Geometries with short segments triggers assertions in algorithms

The following example:

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>

namespace bg = boost::geometry;

using DegreePoint = bg::model::d2::point_xy<
  double,
  bg::cs::spherical_equatorial<
    bg::degree
  >
>;
using RadianPoint = bg::model::d2::point_xy<
  double,
  bg::cs::spherical_equatorial<
    bg::radian
  >
>;
using LineString = bg::model::linestring<RadianPoint>;

int main() {
  std::vector<DegreePoint> ls = {
    bg::make<DegreePoint>(0.001, 0.001),
    bg::make<DegreePoint>(0.001, 0.005),
    bg::make<DegreePoint>(0.005, 0.005)
  };

  LineString p1;

  bg::append(p1, bg::make<RadianPoint>(bg::get_as_radian<0>(ls[0]), bg::get_as_radian<1>(ls[0])));
  bg::append(p1, bg::make<RadianPoint>(bg::get_as_radian<0>(ls[1]), bg::get_as_radian<1>(ls[1])));
  bg::append(p1, bg::make<RadianPoint>(bg::get_as_radian<0>(ls[2]), bg::get_as_radian<1>(ls[2])));
  
  auto p2 = p1;

  std::cout << std::boolalpha << "equals:     " << boost::geometry::equals(p1, p2) << std::endl;
  std::cout << std::boolalpha << "intersects: " << boost::geometry::intersects(p1, p2) << std::endl;

  boost::geometry::model::multi_linestring<LineString> out;
  boost::geometry::intersection(p1, p2, out);

  std::cout << boost::geometry::wkt(out) << std::endl;
}

triggers an assertion for all three algorithms with the following backtrace:

gdb ./a.out
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...done.
(gdb) r
Starting program: /home/tvoss/Documents/airmap/fix-boost/a.out 
a.out: /usr/include/boost/geometry/policies/robustness/segment_ratio.hpp:54: static bool boost::geometry::detail::segment_ratio::less<Type, false>::apply(const Ratio&, const Ratio&) [with Ratio = boost::geometry::segment_ratio<double>; Type = double]: Assertion `lhs.denominator() != 0' failed.
equals:     
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
        set = {__val = {0, 140737488342736, 140737488345648, 140737338941713, 139642199179264, 140737338952615, 140737342461728, 3432, 12, 
            93824994873232, 140737342441632, 140737338959746, 93824994875548, 140737342461728, 0, 3432}}
        pid = <optimized out>
        tid = <optimized out>
#1  0x00007ffff713af5d in __GI_abort () at abort.c:90
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x5555557d9770, sa_sigaction = 0x5555557d9770}, sa_mask = {__val = {
              17912167528584999168, 0, 140737354096640, 93824992524722, 54, 93824992531168, 0, 140737488345648, 140737339003982, 
              140737488342768, 140737340166592, 21474836480, 140737340151984, 0, 17912167528584999168, 93824992524722}}, 
          sa_flags = -134258688, sa_restorer = 0x55555559b9b2}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007ffff7130f17 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55555559b9b2 "lhs.denominator() != 0", 
    file=file@entry=0x55555559b970 "/usr/include/boost/geometry/policies/robustness/segment_ratio.hpp", line=line@entry=54, 
    function=function@entry=0x55555559d2e0 <bool boost::geometry::detail::segment_ratio::less<double, false>::apply<boost::geometry::segment_ratio<double> >(boost::geometry::segment_ratio<double> const&, boost::geometry::segment_ratio<double> const&)::__PRETTY_FUNCTION__> "static bool boost::geometry::detail::segment_ratio::less<Type, false>::apply(const Ratio&, const Ratio&) [with Ratio = boost::geometry::segment_ratio<double>; Type = double]") at assert.c:92
        str = 0x5555557d9770 ""
        total = 4096
#3  0x00007ffff7130fc2 in __GI___assert_fail (assertion=0x55555559b9b2 "lhs.denominator() != 0", 
    file=0x55555559b970 "/usr/include/boost/geometry/policies/robustness/segment_ratio.hpp", line=54, 
    function=0x55555559d2e0 <bool boost::geometry::detail::segment_ratio::less<double, false>::apply<boost::geometry::segment_ratio<double> >(boost::geometry::segment_ratio<double> const&, boost::geometry::segment_ratio<double> const&)::__PRETTY_FUNCTION__> "static bool boost::geometry::detail::segment_ratio::less<Type, false>::apply(const Ratio&, const Ratio&) [with Ratio = boost::geometry::segment_ratio<double>; Type = double]") at assert.c:101
No locals.
#4  0x0000555555586c62 in boost::geometry::detail::segment_ratio::less<double, false>::apply<boost::geometry::segment_ratio<double> > (
    lhs=..., rhs=...) at /usr/include/boost/geometry/policies/robustness/segment_ratio.hpp:54
        __PRETTY_FUNCTION__ = "static bool boost::geometry::detail::segment_ratio::less<Type, false>::apply(const Ratio&, const Ratio&) [with Ratio = boost::geometry::segment_ratio<double>; Type = double]"
#5  0x000055555557f398 in boost::geometry::segment_ratio<double>::operator< (this=0x7fffffffd340, other=...)
    at /usr/include/boost/geometry/policies/robustness/segment_ratio.hpp:203
No locals.
#6  0x000055555557a886 in boost::geometry::detail::overlay::base_turn_handler::non_opposite_to_index<boost::geometry::segment_intersection_points<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> > > (info=...) at /usr/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp:128
No locals.
#7  0x0000555555571a4a in boost::geometry::detail::overlay::collinear<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > >::apply<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_intersection_points<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::geometry::policies::relate::direction_type, boost::geometry::detail::overlay::side_calculator<boost::geometry::spherical_equatorial_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > (pj=..., 
    pk=..., qj=..., qk=..., ti=..., info=..., dir_info=..., side=...)
    at /usr/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp:596
        __PRETTY_FUNCTION__ = "static void boost::geometry::detail::overlay::collinear<TurnInfo>::apply(const Point1&, const Point1&, const Point1&, const Point2&, const Point2&, const Point2&, TurnInfo&, const IntersectionInfo&, c"...
        arrival = 32767
        side_p = -11984
        side_q = 32767
        side_p_or_q = 1431806492
        product = 21845
#8  0x0000555555575953 in boost::geometry::detail::overlay::get_turn_info_linear_linear<boost::geometry::detail::relate::turns::assign_policy<true> >::apply<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, boost::geometry::detail::no_rescale_policy, std::back_insert_iterator<std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::po---Type <return> to continue, or q <return> to quit---  
int_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > > > > > (pi=..., pj=..., pk=..., qi=..., qj=..., qk=..., is_p_first=true, is_p_last=false, 
    is_q_first=true, is_q_last=false, tp_model=..., robust_policy=..., out=...)
    at /usr/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp:373
        method_replace = boost::geometry::detail::overlay::method_touch_interior
        spike_op = boost::geometry::detail::overlay::operation_continue
        transformer = {m_method = 4294955592}
        inters = {<boost::geometry::detail::overlay::intersection_info_base<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::detail::no_rescale_policy>> = {m_side_calc = {m_pi = @0x5555557d8f00, m_pj = @0x5555557d8f10, m_pk = @0x5555557d8f20, 
              m_qi = @0x5555557d8f50, m_qj = @0x5555557d8f60, m_qk = @0x5555557d8f70}}, 
          m_result = {<boost::tuples::cons<boost::geometry::segment_intersection_points<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::tuples::cons<boost::geometry::policies::relate::direction_type, boost::tuples::null_type> >> = {head = {count = 1, intersections = {
                  {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                      m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, 
                  {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                      m_values = {4.635570543470383e-310, 4.6355706688023869e-310}}, <No data fields>}}, fractions = {{robust_ra = {
                      m_numerator = 0, m_denominator = 1, m_approximation = 0}, robust_rb = {m_numerator = 0, m_denominator = 0, 
                      m_approximation = 0}, initialized = true}, {robust_ra = {m_numerator = 0, m_denominator = 1, m_approximation = 0}, 
                    robust_rb = {m_numerator = 0, m_denominator = 1, m_approximation = 0}, initialized = false}}}, tail = {head = {
                  how = 99 'c', opposite = false, how_a = 0, how_b = 0, dir_a = 0, dir_b = 0, sides = {sides = {{first = 0, second = 0}, {
                        first = 0, second = 0}}}, arrival = {-1, 0}}}}, <No data fields>}, m_robust_policy = @0x7fffffffd9c7}
        method = 99 'c'
        tp = {point = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
              m_values = {6.953355807308528e-310, 4.6355705488025864e-310}}, <No data fields>}, 
          method = boost::geometry::detail::overlay::method_none, cluster_id = -1, discarded = false, colocated = false, 
          switch_source = false, operations = {elems = {
              {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                  operation = boost::geometry::detail::overlay::operation_none, seg_id = {source_index = 0, multi_index = -1, 
                    ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 1, 
                    m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_middle, 
                is_collinear = true}, 
              {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                  operation = boost::geometry::detail::overlay::operation_none, seg_id = {source_index = 1, multi_index = -1, 
                    ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 1, 
                    m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_middle, 
                is_collinear = true}}}}
#9  0x000055555556cb67 in boost::geometry::detail::get_turns::get_turns_in_sections<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, false, false, boost::geometry::section<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2ul>, boost::geometry::section<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2ul>, boost::geometry::detail::get_turns::get_turn_info_type<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::relate::turns::assign_policy<true>, boost::geometry::linestring_tag, boost::geometry::linestring_tag, boost::geometry::linear_tag, boost::geometry::linear_tag> >::apply<std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > > >, boost::geometry::detail::no_rescale_policy, boost::geometry::detail::relate::linear_linear<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::interrupt_policy_linear_linear<boost::geometry::detail::relate::static_mask_handler<boost::geometry::de9im::static_mask<(char)84, (char)42, (char)70, (char)42, (char)42, (char)70, (char)70, (char)70, (char)42>, true> > > (source_id1=0, geometry1=..., sec1=..., source_id2=1, geometry2=..., sec2=..., 
    skip_larger=false, robust_policy=..., turns=std::vector of length 1, capacity 1 = {...}, interrupt_policy=...)
---Type <return> to continue, or q <return> to quit---
    at /usr/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp:296
        nd_next2 = {<boost::geometry::detail::iterators::iterator_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::bidirectional_traversal_tag>> = {<boost::iterators::iterator_adaptor<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::use_default, boost::iterators::bidirectional_traversal_tag, boost::iterators::use_default, boost::iterators::use_default>> = {<boost::iterators::iterator_facade<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, true, false>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, false, false>> = {<No data fields>}, <No data fields>}, <No data fields>}, m_iterator = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}}, <No data fields>}, m_begin = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, m_end = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {0, 5.1432233732073765e-321}}, <No data fields>}, m_skip_first = true}
        size_before = 0
        is_1_last = false
        is_2_first = true
        ti = {point = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
              m_values = {6.953355807308528e-310, 4.6355705488025864e-310}}, <No data fields>}, 
          method = boost::geometry::detail::overlay::method_none, cluster_id = -1, discarded = false, colocated = false, 
          switch_source = false, operations = {elems = {
              {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                  operation = boost::geometry::detail::overlay::operation_none, seg_id = {source_index = 0, multi_index = -1, 
                    ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 1, 
                    m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_middle, 
                is_collinear = false}, 
              {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                  operation = boost::geometry::detail::overlay::operation_none, seg_id = {source_index = 1, multi_index = -1, 
                    ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 1, 
                    m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_middle, 
                is_collinear = false}}}}
        is_1_first = true
        is_2_last = false
        skip = false
        index2 = 0
        prev2 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}
        it2 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 8.7266462599716482e-05}}, <No data fields>}
        next2 = {<boost::geometry::detail::iterators::iterator_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::---Type <return> to continue, or q <return> to quit---
geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::bidirectional_traversal_tag>> = {<boost::iterators::iterator_adaptor<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::use_default, boost::iterators::bidirectional_traversal_tag, boost::iterators::use_default, boost::iterators::use_default>> = {<boost::iterators::iterator_facade<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, true, false>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, false, false>> = {<No data fields>}, <No data fields>}, <No data fields>}, m_iterator = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}}, <No data fields>}, m_begin = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, m_end = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {0, 5.1432233732073765e-321}}, <No data fields>}, m_skip_first = true}
        nd_next1 = {<boost::geometry::detail::iterators::iterator_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::bidirectional_traversal_tag>> = {<boost::iterators::iterator_adaptor<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::use_default, boost::iterators::bidirectional_traversal_tag, boost::iterators::use_default, boost::iterators::use_default>> = {<boost::iterators::iterator_facade<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, true, false>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, false, false>> = {<No data fields>}, <No data fields>}, <No data fields>}, m_iterator = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}}, <No data fields>}, m_begin = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, m_end = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {0, 0}}---Type <return> to continue, or q <return> to quit---
, <No data fields>}, m_skip_first = true}
        ndi2 = 0
        end2 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}
        cview1 = {m_range = @0x7fffffffdbf0}
        cview2 = {m_range = @0x7fffffffdc10}
        view1 = {m_range = @0x7fffffffd4e8}
        view2 = {m_range = @0x7fffffffd4f0}
        begin_range_1 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}
        end_range_1 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {0, 0}}, <No data fields>}
        begin_range_2 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}
        end_range_2 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {0, 5.1432233732073765e-321}}, <No data fields>}
        dir1 = 0
        dir2 = 0
        index1 = 0
        ndi1 = 0
        same_source = false
        prev1 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}
        it1 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 8.7266462599716482e-05}}, <No data fields>}
        end1 = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}
        next1 = {<boost::geometry::detail::iterators::iterator_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::bidirectional_traversal_tag>> = {<boost::iterators::iterator_adaptor<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, __gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > >, boost::iterators::use_default, boost::iterators::bidirectional_traversal_tag, boost::iterators::use_default, boost::iterators::use_default>> = {<boost::iterators::iterator_facade<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, true, false>> = {<boost::iterators::detail::iterator_facade_base<boost::geometry::ever_circling_iterator<__gnu_cxx::__normal_iterator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const*, std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > > > >, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::iterators::bidirectional_traversal_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > const&, long, false, false>> = {<No data fields>}, <No data fields>}, <No data fields>}, m_iterator = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}}, <No data fields>}, m_begin = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, m_end = 
      {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {0, 0}}---Type <return> to continue, or q <return> to quit---
, <No data fields>}, m_skip_first = true}
#10 0x00005555555662e3 in boost::geometry::detail::get_turns::section_visitor<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, false, false, std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > > >, boost::geometry::detail::get_turns::get_turn_info_type<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::relate::turns::assign_policy<true>, boost::geometry::linestring_tag, boost::geometry::linestring_tag, boost::geometry::linear_tag, boost::geometry::linear_tag>, boost::geometry::detail::no_rescale_policy, boost::geometry::detail::relate::linear_linear<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::interrupt_policy_linear_linear<boost::geometry::detail::relate::static_mask_handler<boost::geometry::de9im::static_mask<(char)84, (char)42, (char)70, (char)42, (char)42, (char)70, (char)70, (char)70, (char)42>, true> > >::apply<boost::geometry::section<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2ul> > (this=0x7fffffffd8f0, sec1=..., sec2=...) at /usr/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp:427
No locals.
#11 0x0000555555561e17 in boost::geometry::partition<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, boost::geometry::detail::section::get_section_box, boost::geometry::detail::section::overlaps_section_box, boost::geometry::detail::section::get_section_box, boost::geometry::detail::section::overlaps_section_box, boost::geometry::detail::partition::include_all_policy, boost::geometry::detail::partition::include_all_policy, boost::geometry::detail::partition::visit_no_policy>::apply<boost::geometry::sections<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2ul>, boost::geometry::sections<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2ul>, boost::geometry::detail::get_turns::section_visitor<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, false, false, std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > > >, boost::geometry::detail::get_turns::get_turn_info_type<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::relate::turns::assign_policy<true>, boost::geometry::linestring_tag, boost::geometry::linestring_tag, boost::geometry::linear_tag, boost::geometry::linear_tag>, boost::geometry::detail::no_rescale_policy, boost::geometry::detail::relate::linear_linear<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::interrupt_policy_linear_linear<boost::geometry::detail::relate::static_mask_handler<boost::geometry::de9im::static_mask<(char)84, (char)42, (char)70, (char)42, (char)42, (char)70, (char)70, (char)70, (char)42>, true> > > > (forward_range1=..., forward_range2=..., visitor=..., min_elements=16, box_visitor=...)
    at /usr/include/boost/geometry/algorithms/detail/partition.hpp:627
        it2 = 
  {static dimension_count = 2, directions = {0, 1}, ring_id = {source_index = 1, multi_index = -1, ring_index = -1}, bounding_box = {m_min_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519721252e-05, 1.7453292519721252e-05}}, <No data fields>}, m_max_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292520165341e-05, 8.7266462599938527e-05}}, <No data fields>}}, begin_index = 0, end_index = 1, count = 1, range_count = 3, duplicate = false, non_duplicate_index = 0, is_non_duplicate_first = true, is_non_duplicate_last = false}
        it1 = 
  {static dimension_count = 2, directions = {0, 1}, ring_id = {source_index = 0, multi_index = -1, ring_index = -1}, bounding_box = {m_min_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519721252e-05, 1.7453292519721252e-05}}, <No data fields>}, m_max_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292520165341e-05, 8.7266462599938527e-05}}, <No data fields>}}, begin_index = 0, end_index = 1, count = 1, range_count = 3, duplicate = false, non_duplicate_index = 0, is_non_duplicate_first = true, is_non_duplicate_last = false}
#12 0x000055555555e4ad in boost::geometry::detail::get_turns::get_turns_generic<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vecto---Type <return> to continue, or q <return> to quit---
r, std::allocator>, false, false, boost::geometry::detail::get_turns::get_turn_info_type<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::relate::turns::assign_policy<true>, boost::geometry::linestring_tag, boost::geometry::linestring_tag, boost::geometry::linear_tag, boost::geometry::linear_tag> >::apply<boost::geometry::detail::no_rescale_policy, std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > > >, boost::geometry::detail::relate::linear_linear<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::interrupt_policy_linear_linear<boost::geometry::detail::relate::static_mask_handler<boost::geometry::de9im::static_mask<(char)84, (char)42, (char)70, (char)42, (char)42, (char)70, (char)70, (char)70, (char)42>, true> > > (source_id1=0, 
    geometry1=..., source_id2=1, geometry2=..., robust_policy=..., turns=std::vector of length 1, capacity 1 = {...}, interrupt_policy=...)
    at /usr/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp:486
        sec1 = {<std::vector<boost::geometry::section<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2>, std::allocator<boost::geometry::section<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2> > >> = std::vector of length 2, capacity 2 = {{static dimension_count = 2, directions = {0, 1}, ring_id = {source_index = 0, multi_index = -1, ring_index = -1}, 
              bounding_box = {
                m_min_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519721252e-05, 1.7453292519721252e-05}}, <No data fields>}, 
                m_max_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292520165341e-05, 8.7266462599938527e-05}}, <No data fields>}}, begin_index = 0, end_index = 1, count = 1, 
              range_count = 3, duplicate = false, non_duplicate_index = 0, is_non_duplicate_first = true, is_non_duplicate_last = false}, {
              static dimension_count = 2, directions = {1, 0}, ring_id = {source_index = 0, multi_index = -1, ring_index = -1}, 
              bounding_box = {
                m_min_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519721252e-05, 8.7266462599494438e-05}}, <No data fields>}, 
                m_max_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599938527e-05, 8.7266462599938527e-05}}, <No data fields>}}, begin_index = 1, end_index = 2, count = 1, 
              range_count = 3, duplicate = false, non_duplicate_index = 1, is_non_duplicate_first = false, is_non_duplicate_last = true}}, 


          static value = <optimized out>}
        sec2 = {<std::vector<boost::geometry::section<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2>, std::allocator<boost::geometry::section<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > >, 2> > >> = std::vector of length 2, capacity 2 = {{static dimension_count = 2, directions = {0, 1}, ring_id = {source_index = 1, multi_index = -1, ring_index = -1}, 
              bounding_box = {
                m_min_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519721252e-05, 1.7453292519721252e-05}}, <No data fields>}, 
                m_max_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292520165341e-05, 8.7266462599938527e-05}}, <No data fields>}}, begin_index = 0, end_index = 1, count = 1, 
              range_count = 3, duplicate = false, non_duplicate_index = 0, is_non_duplicate_first = true, is_non_duplicate_last = false}, {
              static dimension_count = 2, directions = {1, 0}, ring_id = {source_index = 1, multi_index = -1, ring_index = -1}, 
              bounding_box = {
                m_min_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {1.7453292519721252e-05, 8.7266462599494438e-05}}, <No data fields>}, 
                m_max_corner = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {m_values = {8.7266462599938527e-05, 8.7266462599938527e-05}}, <No data fields>}}, begin_index = 1, end_index = 2, count = 1, 
              range_count = 3, duplicate = false, non_duplicate_index = 1, is_non_duplicate_first = false, is_non_duplicate_last = true}}, 
          static value = <optimized out>}
        visitor = {m_source_id1 = 0, m_geometry1 = @0x7fffffffdbf0, m_source_id2 = 1, m_geometry2 = @0x7fffffffdc10, 
          m_rescale_policy = @0x7fffffffd9c7, m_turns = std::vector of length 1, capacity 1 = {{
              point = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                  m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, 
              method = boost::geometry::detail::overlay::method_touch, cluster_id = -1, discarded = false, colocated = false, 
              switch_source = false, operations = {elems = {
                  {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                      operation = boost::geometry::detail::overlay::operation_intersection, seg_id = {source_index = 0, multi_index = -1, 
                        ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 1, 
                        m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_front, 
                    is_collinear = false}, 
                  {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                      operation = boost::geometry::detail::overlay::operation_intersection, seg_id = {source_index = 1, multi_index = -1, 
                        ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 0, 
---Type <return> to continue, or q <return> to quit---
                        m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_middle, 
                    is_collinear = false}}}}}, m_interrupt_policy = @0x7fffffffda08}
#13 0x000055555555b5aa in boost::geometry::detail::relate::turns::get_turns<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::get_turns::get_turn_info_type<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::relate::turns::assign_policy<true>, boost::geometry::linestring_tag, boost::geometry::linestring_tag, boost::geometry::linear_tag, boost::geometry::linear_tag>, boost::geometry::detail::no_rescale_policy>::apply<std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > > >, boost::geometry::detail::relate::linear_linear<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::interrupt_policy_linear_linear<boost::geometry::detail::relate::static_mask_handler<boost::geometry::de9im::static_mask<(char)84, (char)42, (char)70, (char)42, (char)42, (char)70, (char)70, (char)70, (char)42>, true> > > (
    turns=std::vector of length 1, capacity 1 = {...}, geometry1=..., geometry2=..., interrupt_policy=..., robust_policy=...)
    at /usr/include/boost/geometry/algorithms/detail/relate/turns.hpp:121
No locals.
#14 0x0000555555559e5b in boost::geometry::detail::relate::turns::get_turns<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::get_turns::get_turn_info_type<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::detail::relate::turns::assign_policy<true>, boost::geometry::linestring_tag, boost::geometry::linestring_tag, boost::geometry::linear_tag, boost::geometry::linear_tag>, boost::geometry::detail::no_rescale_policy>::apply<std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double>, boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, boost::array<boost::geometry::detail::overlay::turn_operation_linear<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >, 2ul> > > >, boost::geometry::detail::relate::linear_linear<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::interrupt_policy_linear_linear<boost::geometry::detail::relate::static_mask_handler<boost::geometry::de9im::static_mask<(char)84, (char)42, (char)70, (char)42, (char)42, (char)70, (char)70, (char)70, (char)42>, true> > > (
    turns=std::vector of length 1, capacity 1 = {...}, geometry1=..., geometry2=..., interrupt_policy=...)
    at /usr/include/boost/geometry/algorithms/detail/relate/turns.hpp:92
        robust_policy = {static enabled = false}
#15 0x000055555555906f in boost::geometry::detail::relate::linear_linear<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::apply<boost::geometry::detail::relate::static_mask_handler<boost::geometry::de9im::static_mask<(char)84, (char)42, (char)70, (char)42, (char)42, (char)70, (char)70, (char)70, (char)42>, true> > (geometry1=..., geometry2=..., result=...)
    at /usr/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp:141
        turns = std::vector of length 1, capacity 1 = {{
            point = {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, 
            method = boost::geometry::detail::overlay::method_touch, cluster_id = -1, discarded = false, colocated = false, 
            switch_source = false, operations = {elems = {
                {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                    operation = boost::geometry::detail::overlay::operation_intersection, seg_id = {source_index = 0, multi_index = -1, 
                      ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 1, 
                      m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_front, 
                  is_collinear = false}, 
                {<boost::geometry::detail::overlay::turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, boost::geometry::segment_ratio<double> >> = {
                    operation = boost::geometry::detail::overlay::operation_intersection, seg_id = {source_index = 1, multi_index = -1, 
                      ring_index = -1, segment_index = 0, piece_index = -1}, fraction = {m_numerator = 0, m_denominator = 0, 
---Type <return> to continue, or q <return> to quit---
                      m_approximation = 0}, remaining_distance = 0}, position = boost::geometry::detail::overlay::position_middle, 
                  is_collinear = false}}}}}
        interrupt_policy = {static enabled = true, m_result = @0x7fffffffdb3e}
        boundary_checker1 = {has_boundary = 16, geometry = @0x7ffff74dcc10}
        pred1 = {m_result = @0x0, m_boundary_checker = @0x0, m_flags = 4149053600}
        boundary_checker2 = {has_boundary = 13, geometry = @0xd}
        pred2 = {m_result = @0xff00000000000000, m_boundary_checker = @0x0, m_flags = 125}
#16 0x0000555555558676 in boost::geometry::detail::relate::relate_impl<boost::geometry::detail::de9im::static_mask_equals_type, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::apply (g1=..., g2=...)
    at /usr/include/boost/geometry/algorithms/detail/relate/relate_impl.hpp:69
        handler = {<boost::geometry::detail::relate::matrix_handler<boost::geometry::detail::relate::matrix<3, 3> >> = {
            static interrupt = <optimized out>, m_matrix = {static static_width = 3, static static_height = 3, static static_size = 9, 
              m_array = "FFFFFFFFF"}}, interrupt = false}
#17 0x0000555555557e63 in boost::geometry::resolve_variant::equals<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> >::apply (geometry1=..., geometry2=...) at /usr/include/boost/geometry/algorithms/equals.hpp:362
No locals.
#18 0x0000555555557661 in boost::geometry::equals<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> > (
    geometry1=..., geometry2=...) at /usr/include/boost/geometry/algorithms/equals.hpp:478
No locals.
#19 0x0000555555555c04 in main () at test.cpp:37
        wkt = 0x55555559b478 "LINESTRING(0.001 0.001,0.001 0.005,0.005 0.005)"
        ls = std::vector of length 3, capacity 3 = {
          {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::degree> >> = {m_values = {
                0.001, 0.001}}, <No data fields>}, 
          {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::degree> >> = {m_values = {
                0.001, 0.0050000000000000001}}, <No data fields>}, 
          {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::degree> >> = {m_values = {
                0.0050000000000000001, 0.0050000000000000001}}, <No data fields>}}
        p1 = {<std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > >> = std::vector of length 3, capacity 4 = {
            {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, 
            {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                m_values = {1.7453292519943296e-05, 8.7266462599716482e-05}}, <No data fields>}, 
            {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}}, <No data fields>}
        p2 = {<std::vector<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::allocator<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> > > >> = std::vector of length 3, capacity 3 = {
            {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                m_values = {1.7453292519943296e-05, 1.7453292519943296e-05}}, <No data fields>}, 
            {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                m_values = {1.7453292519943296e-05, 8.7266462599716482e-05}}, <No data fields>}, 
            {<boost::geometry::model::point<double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >> = {
                m_values = {8.7266462599716482e-05, 8.7266462599716482e-05}}, <No data fields>}}, <No data fields>}
        out = {<std::vector<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator>, std::allocator<boost::geometry::model::linestring<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::spherical_equatorial<boost::geometry::radian> >, std::vector, std::allocator> > >> = std::vector of length -189413617304512226, capacity -189415571991743554 = {<error reading variable>

Compilation errors with VS 2017 15.3 and /permissive-

I have installed Visual Studio 2017 with latest updates (15.3) and Boost 1.65 RC3.

I am trying to use the /permissive- compiler switch that is supposed to make VS stick more closely to the C++ standard. However when I enable that switch I get the compilation errors from Boost.Geometry headers.

For the sample program

#define _HAS_AUTO_PTR_ETC 1

#include <boost/geometry.hpp>

int main(int, char*[])
{
}

I get the errors:

Unknown compiler version - please run the configure tests and report the results
c:\c++\libs-v140\boost_1_65_0\boost\geometry\algorithms\assign.hpp(236,1): error C2760: syntax error: expected ';' not '('
        BOOST_MPL_ASSERT_MSG
^
c:\c++\libs-v140\boost_1_65_0\boost\geometry\algorithms\assign.hpp(253): note: see reference to class template instantiation 'boost::geometry::resolve_variant::assign<Geometry1,Geometry2>' being compiled
};
c:\c++\libs-v140\boost_1_65_0\boost\geometry\iterators\concatenate_iterator.hpp(86,1): error C2760: syntax error: expected ';' not '('
        BOOST_MPL_ASSERT_MSG((are_conv),
^
c:\c++\libs-v140\boost_1_65_0\boost\geometry\iterators\concatenate_iterator.hpp(147): note: see reference to class template instantiation 'boost::geometry::concatenate_iterator<Iterator1,Iterator2,Value,Reference>' being compiled
};
c:\c++\libs-v140\boost_1_65_0\boost\geometry\iterators\flatten_iterator.hpp(105,1): error C2760: syntax error: expected ';' not '('
        BOOST_MPL_ASSERT_MSG((are_conv),
^
c:\c++\libs-v140\boost_1_65_0\boost\geometry\iterators\flatten_iterator.hpp(222): note: see reference to class template instantiation 'boost::geometry::flatten_iterator<OuterIterator,InnerIterator,Value,AccessInnerBegin,AccessInnerEnd,Reference>' being compiled
};
c:\c++\libs-v140\boost_1_65_0\boost\geometry\iterators\detail\segment_iterator\range_segment_iterator.hpp(156,1): error C2760: syntax error: expected ';' not '('
        BOOST_MPL_ASSERT_MSG((are_conv), NOT_CONVERTIBLE, (types<OtherRange>));
^
c:\c++\libs-v140\boost_1_65_0\boost\geometry\iterators\detail\segment_iterator\range_segment_iterator.hpp(206): note: see reference to class template instantiation 'boost::geometry::detail::segment_iterator::range_segment_iterator<Range,Value,Reference>' being compiled
};
c:\c++\libs-v140\boost_1_65_0\boost\geometry\algorithms\is_convex.hpp(165,1): fatal error C1903: unable to recover from previous error(s); stopping compilation
    static bool apply(Geometry const& geometry, geometry::default_strategy const&)
^

It seems to be related to the usage of BOOST_MPL_ASSERT_MSG of macro — though I am not sure if the problem comes from the macro itself or its usage within Boost.Geometry.

Accuracy vs Speed

@awulkiew: This is in response to a comment you made to pull request #431. I thought it a good idea to split this discussion into a separate issue. For the record, here is your comment

@cffk Boost.Geometry is more performance-focused. In most cases where time/accuracy tradeoff has to be made the time is the default choice. So it's actually the other way around than what you suggest. Typicall user of Boost.Geometry would get less accurate result fast and only if something more accurate was needed he/she'd have to pass a different strategy.

The practical aspect also comes to mind. AFAIU in practice most of the average users don't need very good accuracy, a few meters is ok or even performing calculations on a sphere. Running the algorithm 30x faster is a good deal though. It all depends on the use-case of course.

With that said, more accurate solutions should also be available for users needing them.

The formulas are mostly for the internal use and probably will never be documented. The strategies (which may use the formulas) are for the users however geographic strategies are not documented yet because we're still working on them.

It's difficult to characterize what the "typical user" wants. However, a short time browsing https://gis.stackexchange.com will convince you that a substantial number of potential users only have the slimmest grasp of what they do want. It is also axiomatic that whatever caveats on the limits of applicability on the approximate formulas are given, many users will use the formulas well outside these limits and have no idea that their results are garbage.

For this reason, if Boost.Geometry does provide an approximate algorithm for some quantity, it's important that it also provide, where feasible, an accurate algorithm (accurate to double-precision round-off, for example). Except in special cases, I would also recommend that the accurate algorithm be the default one.

The counter-argument is that "surely the users prefer the 30x speed-up of an approximate algorithm". However this speed-up factor is the product of an unrealistic benchmark. If the time taken to transform UTM coordinates to geographical coordinates is 2 us, the difference between a 1 us distance calculation and a 0.03 us distance calculation is not so significant. In addition, the burden of continually checking whether the approximation is good enough in a particular application is an ongoing cost.

Furthermore, many of the approximate algorithms aren't so neatly characterized as "having an accuracy of better than 1 m". A good example is Vincenty's algorithm for geodesic distance. For most pairs of points the error in the distance is 0.1 mm. But for some pairs, the algorithm doesn't converge and Boost returns what is likely to be a garbage result. Often, Vincenty is forgiven by saying that such antipodal calculations don't occur often. However even though the failure probability is just 17/1000000 or so, this still means we have 8 failures when computing the distance matrix for 1000 randomly chosen points. As a result, the triangle inequality is not satisfied for the Vincenty distance, and this precludes using a vantage-point tree to do nearest-neighbor calculations.

P.S. I can't conceive of anyone with a practical application wanting to use the Andoyer or Lambert methods. These are of historical interest only.

Compilation error with g++

I am getting:

/usr/local/lib/R/site-library/BH/include/boost/mpl/assert.hpp:429:42: error: no 
matching function for call to ‘assertion_failed(mpl_::failed************ (boost:
:geometry::index::detail::indexable<std::pair<Eigen::Matrix<double, 1, 1, 0, 1, 
1>, double>, false>::NOT_VALID_INDEXABLE_TYPE::************)(Eigen::Matrix<doubl
e, 1, 1, 0, 1, 1>))’
     , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
                                                            ~~~
         boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)
::assert_arg() ) \
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
         ) \
         ~                                 

with g++ (6.3). This compiles fine with Clang++ (8.1). I am registering a matrix from the Eigen library as the coordinate type. The header look like:

// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2010 Alfredo Correa
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2016 Norbert Wenzel

// 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)

// Modified from the orignal code by Tim Keitt 4/7/17
// Changes Copyright (c) 2017 Tim Keitt

#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_EIGEN_MATRIX_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_EIGEN_MATRIX_HPP

#define BOOST_GEOMETRY_ADAPTED_EIGEN_MATRIX_TAG_DEFINED

#include <cstddef>

#include <boost/type_traits/is_arithmetic.hpp>

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/tags.hpp>

#include <Eigen/Dense>

namespace boost { namespace geometry
{


#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{


#ifndef DOXYGEN_NO_DETAIL
namespace detail
{


// Create class and specialization to indicate the tag
// for normal cases and the case that the type of the std-array is arithmetic
template <bool>
struct eigen_matrix_tag
{
  typedef geometry_not_recognized_tag type;
};


template <>
struct eigen_matrix_tag<true>
{
  typedef point_tag type;
};


} // namespace detail
#endif // DOXYGEN_NO_DETAIL


// Assign the point-tag, preventing arrays of points getting a point-tag
template <typename CoordinateType, std::size_t DimensionCount>
struct tag<Eigen::Matrix<CoordinateType, DimensionCount, 1>>
  : detail::eigen_matrix_tag<boost::is_arithmetic<CoordinateType>::value> {};


template <typename CoordinateType, std::size_t DimensionCount>
struct coordinate_type<Eigen::Matrix<CoordinateType, DimensionCount, 1>>
{
  typedef CoordinateType type;
};


template <typename CoordinateType, std::size_t DimensionCount>
struct dimension<Eigen::Matrix<CoordinateType, DimensionCount, 1>>: boost::mpl::int_<DimensionCount> {};


template <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>
struct access<Eigen::Matrix<CoordinateType, DimensionCount, 1>, Dimension>
{
  static inline CoordinateType get(Eigen::Matrix<CoordinateType, DimensionCount, 1> const& a)
  {
    return a(Dimension);
  }

  static inline void set(Eigen::Matrix<CoordinateType, DimensionCount, 1>& a,
                         CoordinateType const& value)
  {
    a(Dimension) = value;
  }
};


} // namespace traits
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS


}} // namespace boost::geometry


#define BOOST_GEOMETRY_REGISTER_EIGEN_MATRIX_CS(CoordinateSystem) \
namespace boost { namespace geometry { namespace traits {      \
template <class T, std::size_t N>                              \
struct coordinate_system<Eigen::Matrix<T, N, 1>>               \
{                                                              \
  typedef CoordinateSystem type;                               \
};                                                             \
}}}


#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_EIGEN_MATRIX_HPP

The BH R package uses Boost 1.62.

THK

Fixing self-intersections in rings

I have a set of unoriented rings, possibly (self-)intersecting, and I want to construct a multi_polygon from them, by just simply assuming that:

  • each outer ring is a polygon.
  • a ring inside of another is a hole.
  • a ring inside of a hole is another polygon, etc...

I figured that, if I can convert each ring on its own to a polygon, then sym_difference should resolve intersections nicely, and give me what I want. However, sym_difference can't work with self-intersecting rings (assertion hit), so I am trying to figure out the easiest way to fix the self-intersections first.

I think the best way to handle self-intersections in my case is to split the rings, so looking around I found split_rings.hpp. However:

  • this line seems to have a bug since detail::overlay::turn_operation is used without its template parameters.
  • also, I understand that code is an extension, so I am asking whether there are any better/easier ways to deal with this problem. I have considered using self_turns directly.

Thanks!

Question about invalid union cases

Hi,

In test/algorithms/overlay/multi_overlay_cases.hpp I see comment:

// Union was reported as invalid because of no generated interior rings, fixed
for cases ticket_11984, ticket_12118, ticket_12125, ticket_12751, ticket_12752

Does this mean that these tickets are solved? If so why they are not closed (except 11984) in https://svn.boost.org/trac10 (is this trac system still alive)?

Thanks in advance for explanations.

registered types vs existing models: within function compilation error

I have the following use-case: check if a linestring is within a polygon.
Coordinate system is Spherical Equatorial.

The support-matrix in the documentation says this should work.

When I use the existing Boost.Geometry linestring and polygon models the

within(linestring, polygon)

function call compiles fine. But when I'm switching out the existing Boost.Geometry linestring model with my own type (which I registered as a linestring) compilation fails.

Here is a small self-contained test case reproducing this issue:

#include <vector>

#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/register/point.hpp>
#include <boost/geometry/geometries/register/linestring.hpp>

struct myPoint { float x, y; };
struct myLine { std::vector<myPoint> pts; };

BOOST_GEOMETRY_REGISTER_POINT_2D(myPoint, float, cs::spherical_equatorial<degree>, x, y)
BOOST_GEOMETRY_REGISTER_LINESTRING(std::vector<myPoint>)

using bgPoint = boost::geometry::model::point<float, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::degree>>;
using bgPoly = boost::geometry::model::polygon<bgPoint>;

int main() {
  myLine ln;
  bgPoly ply;

  boost::geometry::within(ln.pts, ply);  // does not compile

  // but this does, although I expected this to be exactly the same
  //
  //using bgLine = boost::geometry::model::linestring<bgPoint>;
  //bgLine ln2;
  //boost::geometry::within(ln2, ply);
}

This is surprising to me since both types are spherical equatorial, float precision, degree unit. There is no semantic difference from what I can see. I expected them to behave identically.

Here is the full error log. Boost version is 1.62 beta1.
https://gist.github.com/daniel-j-h/64bae0c01caaff30c2e40d27f7a98406

rtree: order of includes matters

I'm currently testing the new Boost 1.62 Beta1 release. Including the rtree header before the parameters header works fine. For the other way around I get errors; here's the first one:

include/boost/geometry/index/parameters.hpp:76:26: error: expected identifier before ‘(’ token

Small self-contained test case:

#include <boost/geometry/index/parameters.hpp>
#include <boost/geometry/index/rtree.hpp>

int main() {}

Found this since I'm using clang-format and recent versions re-order includes alphabetically.

Buffer() Seg Faults with Ring as Input

On boost version 1.58.0 and C++14, boost geometry buffer with strategies fails when the input geometry given is a ring. Changing the type to a polygon behaves as expected.

I don't have newer boost versions available for testing unfortunately.

Test code below.

        std::cout << "Using Boost "
                  << BOOST_VERSION / 100000     << "."  // major version
                  << BOOST_VERSION / 100 % 1000 << "."  // minor version
                  << BOOST_VERSION % 100                // patch level
                  << std::endl;

        // Set up boost geometry types
        namespace bg = boost::geometry;
        using point_type = bg::model::point<float, 2, bg::cs::cartesian>;
        using polygon_type = bg::model::polygon<point_type>;
        using ring_type = bg::model::ring<point_type>;

        // Declare strategies
        constexpr float buffer_distance = 0.5F;
        const int points_per_circle = 36;
        bg::strategy::buffer::distance_symmetric<float> distance_strategy(buffer_distance);
        bg::strategy::buffer::join_round join_strategy(points_per_circle);
        bg::strategy::buffer::end_round end_strategy(points_per_circle);
        bg::strategy::buffer::point_circle circle_strategy(points_per_circle);
        bg::strategy::buffer::side_straight side_strategy;

        bg::model::multi_polygon<polygon_type> bufferedPolygon;
        ring_type originalPolygon;
//        polygon_type originalPolygon;

        bg::append(originalPolygon, point_type { 14.4980001F, 10.5F });
        bg::append(originalPolygon, point_type { 14.4980001F, 12.420001F });
        bg::append(originalPolygon, point_type { 15.9980001F, 12.420001F });
        bg::append(originalPolygon, point_type { 15.9980001F, 10.5F });
        bg::append(originalPolygon, point_type { 14.4980001F, 10.5F });

        bg::correct(originalPolygon);

        bg::buffer(originalPolygon, bufferedPolygon, distance_strategy, side_strategy,
            join_strategy, end_strategy, circle_strategy);

vincenty_direct treats negative distances as zero

vincenty_direct includes

    if ( math::equals(distance, Dist(0)) || distance < Dist(0) )
    {
        result.lon2 = lon1;
        result.lat2 = lat1;
        return result;
    }

i.e., negative distances are treated as zero.

If it's really the case that distances must be non-negative then throw an error when this condition is violated; don't silently set the distance to zero.

However, the notion that distances should be non-negative is a discredited prejudice. See this passage from H. W. Eves, College Geometry (1995), p. 50:

1.1 SENSED MAGNITUDES
One of the innovations of modern elementary geometry is the employment, when it proves useful, of sensed, or signed, magnitudes. It was the extension of the number system to include both positive and negative numbers that led to this forward step in geometry. Although Albert Girard, René Descartes, and others introduced negative segments into geometry during the seventeenth century, the idea of sensed magnitudes was first systematically exploited in the early nineteenth century by L. N. M. Carnot (in his Géométrie de position of 1803) and especially by A. F. Möbius (in his Der barycentrische Calcul of 1827). By means of the concept of sensed magnitudes, several separate statements or relations can often by combined into a single embracive statement or relation, and a single proof can frequently be formulated for a theorem that would otherwise require the treatment of a number of different cases.

return_centroid doesn't compile with default strategy

The function return_centroid with default strategy used to work in Boost 1.64.
After recent upgrade to Boost 1.66 in Msys2 (it skipped 1.65) it stopped compiling this code:

#include <iostream>
#include <boost/geometry/algorithms/centroid.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>

using Point = boost::geometry::model::d2::point_xy<float>;
using Polygon = boost::geometry::model::polygon<Point>;

int main()
{
    const Polygon polygon{{Point{0,0}, Point{0,1}, Point{1,0}}};
    const auto centroid = boost::geometry::return_centroid<Point,Polygon>(polygon);
    std::cout << "centroid: " << centroid.x() << " " << centroid.y();
    return 0;
}

It fails with following errors:

[1/2 0.2/sec] Building CXX object CMakeFiles/boost-geometry-centroid-test.dir/main.cpp.obj
FAILED: CMakeFiles/boost-geometry-centroid-test.dir/main.cpp.obj 
D:\app\msys64\mingw64\bin\g++.exe    -g -MD -MT CMakeFiles/boost-geometry-centroid-test.dir/main.cpp.obj -MF CMakeFiles\boost-geometry-centroid-test.dir\main.cpp.obj.d -o CMakeFiles/boost-geometry-centroid-test.dir/main.cpp.obj -c D:/dev/project/test/boost-geometry-centroid-test/main.cpp
In file included from D:/dev/project/test/boost-geometry-centroid-test/main.cpp:2:0:
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp: In instantiation of 'static bool boost::geometry::detail::centroid::centroid_polygon::apply(const Polygon&, Point&, const Strategy&) [with Polygon = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Point = boost::geometry::model::d2::point_xy<float>; Strategy = boost::geometry::strategy::centroid::not_applicable_strategy]':
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:407:32:   required from 'static void boost::geometry::detail::centroid::centroid_linear_areal<Algorithm>::apply(const Geometry&, Point&, const Strategy&) [with Geometry = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Point = boost::geometry::model::d2::point_xy<float>; Strategy = boost::geometry::strategy::centroid::not_applicable_strategy; Algorithm = boost::geometry::detail::centroid::centroid_polygon]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:534:44:   required from 'static void boost::geometry::resolve_strategy::centroid<Geometry>::apply(const Geometry&, Point&, boost::geometry::default_strategy) [with Point = boost::geometry::model::d2::point_xy<float>; Geometry = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:550:52:   required from 'static void boost::geometry::resolve_variant::centroid<Geometry>::apply(const Geometry&, Point&, const Strategy&) [with Point = boost::geometry::model::d2::point_xy<float>; Strategy = boost::geometry::default_strategy; Geometry = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:608:47:   required from 'void boost::geometry::centroid(const Geometry&, Point&, const Strategy&) [with Geometry = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Point = boost::geometry::model::d2::point_xy<float>; Strategy = boost::geometry::default_strategy]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:631:23:   required from 'void boost::geometry::centroid(const Geometry&, Point&) [with Geometry = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >; Point = boost::geometry::model::d2::point_xy<float>]'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:650:23:   required from 'Point boost::geometry::return_centroid(const Geometry&) [with Point = boost::geometry::model::d2::point_xy<float>; Geometry = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float> >]'
D:/dev/project/test/boost-geometry-centroid-test/main.cpp:12:82:   required from here
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:314:43: error: no type named 'state_type' in 'struct boost::geometry::strategy::centroid::not_applicable_strategy'
             typename Strategy::state_type state;
                                           ^~~~~
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:314:43: error: no type named 'state_type' in 'struct boost::geometry::strategy::centroid::not_applicable_strategy'
D:/app/msys64/mingw64/include/boost/geometry/algorithms/centroid.hpp:317:27: error: 'const struct boost::geometry::strategy::centroid::not_applicable_strategy' has no member named 'result'
             if ( strategy.result(state, centroid) )
                  ~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
14:02:41: The process "D:\app\CMake\bin\cmake.exe" exited with code 1.
Error while building/deploying project boost-geometry-centroid-test (kit: Qt 5.10.0 MinGW x64 GCC 7.2)
When executing step "CMake Build"

A workaround that I found is changing the code to use bashein_detmer strategy explicitly.

Environment: Windows 10 x64, Msys2, GCC 7.2 x64, Boost 1.66.0 x64.

"Strategy" nomenclature is confusing

Boost geometry uses the word "strategy" to mean two different things
(a) what is calculated
(b) how it is calculated

This dichotomy is illustrated by 2 spherical methods:
(a) strategy::distance::cross_track - a particular definition of distance
(b) strategy::distance::haversine - a particular method of computing the great-circle distance

Novice users have a tough time mastering this distinction which leads to confusing questions like this one on Stack Overflow: "Is the Haversine Formula or the Vincenty's Formula better for calculating distance?" Here is my answer.

The English word "strategy" is usually, I would say, used in the (b) sense. For example in doing a nearest neighbor calculation, "strategy" would indicate the underlying algorithm (k-D tree, VP tree, etc.) and not the distance metric.

Even if users do understand the distinction and so can the answer the (a) question, many have no good way of assessing the answer to the (b) question.

For that reason, for straightforward calculations, boost should just implement an accurate solution and not expose any b-type strategy. Thus, I contend it is silly to have a strategy::distance::haversine. What the user wants is distance::great_circle. In fact, haversine isn't a terribly good generic way of calculating this since it suffers from excessive round-off for nearly antipodal points.

Similarly
distance::pythagoras -> distance->euclidean
area::surveyor -> area::plane

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.