• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[/============================================================================
2  Boost.Geometry (aka GGL, Generic Geometry Library)
3
4  Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
5  Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
6  Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
7
8  Use, modification and distribution is subject to the Boost Software License,
9  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10  http://www.boost.org/LICENSE_1_0.txt)
11=============================================================================/]
12
13
14[/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
15[/ Generated from doxy/doxygen_output/xml/group__distance.xml]
16[section:comparable_distance_3_with_strategy comparable_distance (with strategy)]
17
18'''<indexterm><primary>comparable_distance</primary></indexterm>'''
19Calculate the comparable distance measurement of two geometries using the specified strategy.
20
21[heading Description]
22The free function comparable\u005fdistance 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.
23
24[heading Synopsis]
25``template<typename Geometry1, typename Geometry2, typename Strategy>
26comparable_distance_result<Geometry1, Geometry2, Strategy>::type comparable_distance(Geometry1 const & geometry1, Geometry2 const & geometry2, Strategy const & strategy)``
27
28[heading Parameters]
29
30[table
31[[Type] [Concept] [Name] [Description] ]
32[[Geometry1 const &] [first geometry type ] [geometry1] [A model of the specified concept ]]
33[[Geometry2 const &] [second geometry type ] [geometry2] [A model of the specified concept ]]
34[[Strategy const &] [Any type fulfilling a Distance Strategy Concept ] [strategy] [The strategy which will be used for distance calculations ]]
35]
36
37
38[heading Returns]
39The calculated comparable distance
40
41[heading Header]
42Either
43
44`#include <boost/geometry.hpp>`
45
46
47Or
48
49`#include <boost/geometry/algorithms/comparable_distance.hpp>`
50
51
52[endsect]
53
54[section:comparable_distance_2 comparable_distance]
55
56'''<indexterm><primary>comparable_distance</primary></indexterm>'''
57Calculate the comparable distance measurement of two geometries.
58
59[heading Description]
60The free function comparable\u005fdistance 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.
61
62[heading Synopsis]
63``template<typename Geometry1, typename Geometry2>
64default_comparable_distance_result<Geometry1, Geometry2>::type comparable_distance(Geometry1 const & geometry1, Geometry2 const & geometry2)``
65
66[heading Parameters]
67
68[table
69[[Type] [Concept] [Name] [Description] ]
70[[Geometry1 const &] [first geometry type ] [geometry1] [A model of the specified concept ]]
71[[Geometry2 const &] [second geometry type ] [geometry2] [A model of the specified concept ]]
72]
73
74
75[heading Returns]
76The calculated comparable distance
77
78[heading Header]
79Either
80
81`#include <boost/geometry.hpp>`
82
83
84Or
85
86`#include <boost/geometry/algorithms/comparable_distance.hpp>`
87
88[include reference/algorithms/comparable_distance.qbk]
89
90
91[endsect]
92
93[section:distance_3_with_strategy distance (with strategy)]
94
95'''<indexterm><primary>distance</primary></indexterm>'''
96Calculate the distance between two geometries using the specified strategy.
97
98[heading Description]
99The free function distance calculates the distance between two geometries using the specified strategy. Reasons to specify a strategy include: use another coordinate system for calculations; construct the strategy beforehand (e.g. with the radius of the Earth); select a strategy when there are more than one available for a calculation.
100
101[heading Synopsis]
102``template<typename Geometry1, typename Geometry2, typename Strategy>
103distance_result<Geometry1, Geometry2, Strategy>::type distance(Geometry1 const & geometry1, Geometry2 const & geometry2, Strategy const & strategy)``
104
105[heading Parameters]
106
107[table
108[[Type] [Concept] [Name] [Description] ]
109[[Geometry1 const &] [Any type fulfilling a Geometry Concept ] [geometry1] [A model of the specified concept ]]
110[[Geometry2 const &] [Any type fulfilling a Geometry Concept ] [geometry2] [A model of the specified concept ]]
111[[Strategy const &] [Any type fulfilling a Distance Strategy Concept ] [strategy] [The strategy which will be used for distance calculations ]]
112]
113
114
115[heading Returns]
116The calculated distance
117
118[heading Header]
119Either
120
121`#include <boost/geometry.hpp>`
122
123
124Or
125
126`#include <boost/geometry/algorithms/distance.hpp>`
127
128[heading Available Strategies]
129* [link geometry.reference.strategies.strategy_distance_pythagoras Pythagoras (cartesian)]
130* [link geometry.reference.strategies.strategy_distance_haversine Haversine (spherical)]
131* [link geometry.reference.strategies.strategy_distance_cross_track Cross track (spherical, point-to-segment)]
132* [link geometry.reference.strategies.strategy_distance_projected_point Projected point (cartesian, point-to-segment)]
133* more (currently extensions): Vincenty, Andoyer (geographic)
134
135
136[endsect]
137
138[section:distance_2 distance]
139
140'''<indexterm><primary>distance</primary></indexterm>'''
141Calculate the distance between two geometries.
142
143[heading Description]
144The free function distance calculates the distance between two geometries. It uses the default strategy, based on the coordinate system of the geometry.
145
146[heading Synopsis]
147``template<typename Geometry1, typename Geometry2>
148default_distance_result<Geometry1, Geometry2>::type distance(Geometry1 const & geometry1, Geometry2 const & geometry2)``
149
150[heading Parameters]
151
152[table
153[[Type] [Concept] [Name] [Description] ]
154[[Geometry1 const &] [Any type fulfilling a Geometry Concept ] [geometry1] [A model of the specified concept ]]
155[[Geometry2 const &] [Any type fulfilling a Geometry Concept ] [geometry2] [A model of the specified concept ]]
156]
157
158
159[heading Returns]
160The calculated distance
161
162[heading Header]
163Either
164
165`#include <boost/geometry.hpp>`
166
167
168Or
169
170`#include <boost/geometry/algorithms/distance.hpp>`
171
172[include reference/algorithms/distance.qbk]
173
174
175[endsect]
176
177