Boost logo

Geometry :

Subject: Re: [geometry] determining strategies for Boost.Geometry algorithms
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2018-06-27 10:44:50

Hi Brook,

Brook Milligan Via Geometry wrote:
> I would like to use the "with strategies" option for some of the algorithms in Boost.Geometry. However, I am having trouble determining which strategies go with which algorithms, because the type deduction seems to involve a (convoluted to me and undocumented as far as I can tell) multilevel process.

Yes, currently it's very complicated and not documented well enough.

> Is there a means of understanding the strategy type deduction process? Could a clear description of that be added to the documentation?

You can get this info by:
- reading documentation of algorithms, there are strategies mentioned at
the bottom, not in all cases though,
- asking here or at GitHub,
- reading code,
- debugging algorithm overload using default strategy for various input
geometries to see which strategy is used.

Yes, I agree that it should be documented but documentation has low
priority. Besides this structure is so complex that I think it should be
slightly redesigned.

Which algorithms and strategies would you like to use?

Set operations and relational operations (equals, within, relate,
intersection, difference, etc.) take:
- within::point_in_point strategy for PointLike geometries
- within::point_in_box for PointLike v.s. Box geometries
- within::box_in_box for Box v.s. Box
- within winding strategy (within::cartesian_winding,
within::spherical_winding) for PointLike v.s. Linear and PointLike v.s.
Areal geometries
- intersection strategy (intersection::cartesian_segments,
intersection::geographic_segments) for Linear v.s. Areal and Areal v.s.
Areal geometries

- Point-Point distance strategy, e.g. distance::pythagoras (should
probably be renamed to cartesian_points} for PointLike geometries
- Point-Segment distance strategy, e.g. distance::projected_point for
other geometries (however this will change when support for geographic
distance between Linear and Areal geometries is added I think)

length, perimeter
- Point-Point distance strategy

expand, envelope
- envelope strategy, e.g. envelope::cartesian_segment

The rest of the strategies should correspond (with namespace) to algorithms.


Geometry list run by mateusz at