...one of the most highly
regarded and expertly designed C++ library projects in the
world.

— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards

Calculate the comparable distance measurement of two geometries using the specified strategy.

The free function comparable_distance does not necessarily calculate the distance, but it calculates a distance measure such that two distances are comparable to each other. For example: for the Cartesian coordinate system, Pythagoras is used but the square root is not taken, which makes it faster and the results of two point pairs can still be compared to each other.

template<typename Geometry1, typename Geometry2, typename Strategy> comparable_distance_result<Geometry1, Geometry2, Strategy>::type comparable_distance(Geometry1 const & geometry1, Geometry2 const & geometry2, Strategy const & strategy)

Type |
Concept |
Name |
Description |
---|---|---|---|

Geometry1 const & |
first geometry type |
geometry1 |
A model of the specified concept |

Geometry2 const & |
second geometry type |
geometry2 |
A model of the specified concept |

Strategy const & |
Any type fulfilling a Distance Strategy Concept |
strategy |
The strategy which will be used for distance calculations |

The calculated comparable distance

Either

`#include <boost/geometry.hpp>`

Or

`#include <boost/geometry/algorithms/comparable_distance.hpp>`