|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/qgsdistancearea.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
1 | 11 |
|
2 | 12 | class QgsDistanceArea
|
3 | 13 | {
|
4 |
| -%TypeHeaderCode |
5 |
| -#include <qgsdistancearea.h> |
| 14 | +%Docstring |
| 15 | +General purpose distance and area calculator. |
| 16 | +- calculations are done on ellipsoid |
| 17 | +- it's possible to pass points/features in any CRS, coordinates are transformed |
| 18 | +- two options how to use it |
| 19 | ++ use measure() takes QgsGeometry as a parameter and calculates distance or area |
| 20 | ++ use directly measureLine(), measurePolygon() which take list of QgsPoints |
| 21 | +(both cases transform the coordinates from source CRS to the ellipse coords) |
| 22 | +- returned values are in meters resp. square meters |
6 | 23 | %End
|
7 | 24 |
|
| 25 | +%TypeHeaderCode |
| 26 | +#include "qgsdistancearea.h" |
| 27 | +%End |
8 | 28 | public:
|
9 | 29 |
|
10 |
| - //! Constructor |
11 | 30 | QgsDistanceArea();
|
| 31 | +%Docstring |
| 32 | +Constructor |
| 33 | +%End |
12 | 34 |
|
13 |
| - //! Destructor |
14 |
| - ~QgsDistanceArea(); |
15 |
| - |
16 |
| - //! Copy constructor |
17 | 35 | QgsDistanceArea( const QgsDistanceArea &origDA );
|
| 36 | +%Docstring |
| 37 | +Copy constructor |
| 38 | +%End |
| 39 | + |
| 40 | +// QgsDistanceArea &operator=( const QgsDistanceArea &origDA ); |
18 | 41 |
|
19 |
| - /** Sets whether coordinates must be projected to ellipsoid before measuring |
20 |
| - * @note for calculations to use the ellipsoid, both the ellipsoid mode must be true |
21 |
| - * and an ellipse must be set |
22 |
| - * @see setEllipsoid() |
23 |
| - * @see willUseEllipsoid() |
24 |
| - */ |
25 | 42 | void setEllipsoidalMode( bool flag );
|
| 43 | +%Docstring |
| 44 | + Sets whether coordinates must be projected to ellipsoid before measuring |
| 45 | +.. note:: |
| 46 | + |
| 47 | + for calculations to use the ellipsoid, both the ellipsoid mode must be true |
| 48 | + and an ellipse must be set |
| 49 | + \see setEllipsoid() |
| 50 | + \see willUseEllipsoid() |
| 51 | +%End |
26 | 52 |
|
27 |
| - /** Returns whether ellipsoidal calculations are enabled |
28 |
| - * @see willUseEllipsoid() |
29 |
| - * @see setEllipsoidalMode() |
30 |
| - */ |
31 | 53 | bool ellipsoidalEnabled() const;
|
| 54 | +%Docstring |
| 55 | + Returns whether ellipsoidal calculations are enabled |
| 56 | + \see willUseEllipsoid() |
| 57 | + \see setEllipsoidalMode() |
| 58 | + :rtype: bool |
| 59 | +%End |
32 | 60 |
|
33 |
| - /** Returns whether calculations will use the ellipsoid. Calculations will only use the |
34 |
| - * ellipsoid if ellipsoidalEnabled() is true and an ellipsoid has been set. |
35 |
| - * @note added in QGIS 2.14 |
36 |
| - * @see ellipsoidalEnabled() |
37 |
| - * @see ellipsoid() |
38 |
| - */ |
39 | 61 | bool willUseEllipsoid() const;
|
| 62 | +%Docstring |
| 63 | + Returns whether calculations will use the ellipsoid. Calculations will only use the |
| 64 | + ellipsoid if ellipsoidalEnabled() is true and an ellipsoid has been set. |
| 65 | +.. versionadded:: 2.14 |
| 66 | + \see ellipsoidalEnabled() |
| 67 | + \see ellipsoid() |
| 68 | + :rtype: bool |
| 69 | +%End |
40 | 70 |
|
41 |
| - //! sets source spatial reference system (by QGIS CRS) |
42 | 71 | void setSourceCrs( long srsid );
|
| 72 | +%Docstring |
| 73 | + Sets source spatial reference system (by QGIS CRS). |
| 74 | +%End |
43 | 75 |
|
44 |
| - /** |
45 |
| - * Sets source spatial reference system (by QGIS CRS) |
46 |
| - * @note: missing in Python bindings in QGIS < 2.2 |
47 |
| - */ |
48 |
| - void setSourceCrs( const QgsCoordinateReferenceSystem& srcCRS ); |
| 76 | + void setSourceCrs( const QgsCoordinateReferenceSystem &srcCRS ); |
| 77 | +%Docstring |
| 78 | + Sets source spatial reference system (by QGIS CRS). |
| 79 | +.. versionadded:: 2.2 |
| 80 | + \see sourceCrs() |
| 81 | +%End |
49 | 82 |
|
50 |
| - //! sets source spatial reference system by authid |
51 |
| - void setSourceAuthId( const QString& authid ); |
| 83 | + void setSourceAuthId( const QString &authid ); |
| 84 | +%Docstring |
| 85 | + Sets source spatial reference system by authid. |
| 86 | +%End |
52 | 87 |
|
53 |
| - /** Returns the source spatial reference system. |
54 |
| - * @see setSourceCrs() |
55 |
| - */ |
56 | 88 | QgsCoordinateReferenceSystem sourceCrs() const;
|
| 89 | +%Docstring |
| 90 | + Returns the source spatial reference system. |
| 91 | + \see setSourceCrs() |
| 92 | + :rtype: QgsCoordinateReferenceSystem |
| 93 | +%End |
57 | 94 |
|
58 |
| - /** Returns the QgsCoordinateReferenceSystem::srsid() for the CRS used during calculations. |
59 |
| - * @see setSourceCrs() |
60 |
| - * @note added in QGIS 2.14 |
61 |
| - */ |
62 | 95 | long sourceCrsId() const;
|
| 96 | +%Docstring |
| 97 | + Returns the QgsCoordinateReferenceSystem.srsid() for the CRS used during calculations. |
| 98 | + \see setSourceCrs() |
| 99 | +.. versionadded:: 2.14 |
| 100 | + :rtype: long |
| 101 | +%End |
63 | 102 |
|
64 |
| - //! What sort of coordinate system is being used? |
65 | 103 | bool geographic() const;
|
| 104 | +%Docstring |
| 105 | + Returns true if a geographic (latitude/longitude based) source CRS is used. |
| 106 | + :rtype: bool |
| 107 | +%End |
| 108 | + |
| 109 | + bool setEllipsoid( const QString &ellipsoid ); |
| 110 | +%Docstring |
| 111 | + Sets ellipsoid by its acronym. Calculations will only use the ellipsoid if |
| 112 | + both the ellipsoid has been set and ellipsoidalEnabled() is true. |
| 113 | + :return: true if ellipsoid was successfully set |
| 114 | + \see ellipsoid() |
| 115 | + \see setEllipsoidalMode() |
| 116 | + \see willUseEllipsoid() |
| 117 | + :rtype: bool |
| 118 | +%End |
66 | 119 |
|
67 |
| - /** Sets ellipsoid by its acronym. Calculations will only use the ellipsoid if |
68 |
| - * both the ellipsoid has been set and ellipsoidalEnabled() is true. |
69 |
| - * @returns true if ellipsoid was successfully set |
70 |
| - * @see ellipsoid() |
71 |
| - * @see setEllipsoidalMode() |
72 |
| - * @see willUseEllipsoid() |
73 |
| - */ |
74 |
| - bool setEllipsoid( const QString& ellipsoid ); |
75 |
| - |
76 |
| - /** Sets ellipsoid by supplied radii. Calculations will only use the ellipsoid if |
77 |
| - * both the ellipsoid has been set and ellipsoidalEnabled() is true. |
78 |
| - * @returns true if ellipsoid was successfully set |
79 |
| - * @see ellipsoid() |
80 |
| - * @see setEllipsoidalMode() |
81 |
| - * @see willUseEllipsoid() |
82 |
| - */ |
83 |
| - // Inverse flattening is calculated with invf = a/(a-b) |
84 | 120 | bool setEllipsoid( double semiMajor, double semiMinor );
|
| 121 | +%Docstring |
| 122 | +Inverse flattening is calculated with invf = a/(a-b) |
| 123 | + :rtype: bool |
| 124 | +%End |
85 | 125 |
|
86 |
| - /** Returns ellipsoid's acronym. Calculations will only use the |
87 |
| - * ellipsoid if ellipsoidalEnabled() is true and an ellipsoid has been set. |
88 |
| - * @see setEllipsoid() |
89 |
| - * @see ellipsoidalEnabled() |
90 |
| - * @see willUseEllipsoid() |
91 |
| - */ |
92 | 126 | QString ellipsoid() const;
|
| 127 | +%Docstring |
| 128 | + Returns ellipsoid's acronym. Calculations will only use the |
| 129 | + ellipsoid if ellipsoidalEnabled() is true and an ellipsoid has been set. |
| 130 | + \see setEllipsoid() |
| 131 | + \see ellipsoidalEnabled() |
| 132 | + \see willUseEllipsoid() |
| 133 | + :rtype: str |
| 134 | +%End |
93 | 135 |
|
94 |
| - //! returns ellipsoid's semi major axis |
95 | 136 | double ellipsoidSemiMajor() const;
|
96 |
| - //! returns ellipsoid's semi minor axis |
| 137 | +%Docstring |
| 138 | + Returns the ellipsoid's semi major axis. |
| 139 | + :rtype: float |
| 140 | +%End |
| 141 | + |
97 | 142 | double ellipsoidSemiMinor() const;
|
98 |
| - //! returns ellipsoid's inverse flattening |
| 143 | +%Docstring |
| 144 | + Returns ellipsoid's semi minor axis. |
| 145 | + :rtype: float |
| 146 | +%End |
| 147 | + |
99 | 148 | double ellipsoidInverseFlattening() const;
|
| 149 | +%Docstring |
| 150 | + Returns ellipsoid's inverse flattening. |
| 151 | + :rtype: float |
| 152 | +%End |
| 153 | + |
| 154 | + double measureArea( const QgsGeometry &geometry ) const; |
| 155 | +%Docstring |
| 156 | + Measures the area of a geometry. |
| 157 | + \param geometry geometry to measure |
| 158 | + :return: area of geometry. For geometry collections, non surface geometries will be ignored. The units for the |
| 159 | + returned area can be retrieved by calling areaUnits(). |
| 160 | +.. versionadded:: 2.12 |
| 161 | + \see measureLength() |
| 162 | + \see measurePerimeter() |
| 163 | + \see areaUnits() |
| 164 | + :rtype: float |
| 165 | +%End |
| 166 | + |
| 167 | + double measureLength( const QgsGeometry &geometry ) const; |
| 168 | +%Docstring |
| 169 | + Measures the length of a geometry. |
| 170 | + \param geometry geometry to measure |
| 171 | + :return: length of geometry. For geometry collections, non curve geometries will be ignored. The units for the |
| 172 | + returned distance can be retrieved by calling lengthUnits(). |
| 173 | +.. versionadded:: 2.12 |
| 174 | + \see lengthUnits() |
| 175 | + \see measureArea() |
| 176 | + \see measurePerimeter() |
| 177 | + :rtype: float |
| 178 | +%End |
| 179 | + |
| 180 | + double measurePerimeter( const QgsGeometry &geometry ) const; |
| 181 | +%Docstring |
| 182 | + Measures the perimeter of a polygon geometry. |
| 183 | + \param geometry geometry to measure |
| 184 | + :return: perimeter of geometry. For geometry collections, any non-polygon geometries will be ignored. The units for the |
| 185 | + returned perimeter can be retrieved by calling lengthUnits(). |
| 186 | +.. versionadded:: 2.12 |
| 187 | + \see lengthUnits() |
| 188 | + \see measureArea() |
| 189 | + \see measurePerimeter() |
| 190 | + :rtype: float |
| 191 | +%End |
| 192 | + |
| 193 | + double measureLine( const QList<QgsPoint> &points ) const; |
| 194 | +%Docstring |
| 195 | + Measures the length of a line with multiple segments. |
| 196 | + \param points list of points in line |
| 197 | + :return: length of line. The units for the returned length can be retrieved by calling lengthUnits(). |
| 198 | + \see lengthUnits() |
| 199 | + :rtype: float |
| 200 | +%End |
| 201 | + |
| 202 | + double measureLine( const QgsPoint &p1, const QgsPoint &p2 ) const; |
| 203 | +%Docstring |
| 204 | + Measures length of a line with one segment. |
| 205 | + \param p1 start of line |
| 206 | + \param p2 end of line |
| 207 | + :return: distance between points. The units for the returned distance can be retrieved by calling lengthUnits(). |
| 208 | + \see lengthUnits() |
| 209 | + :rtype: float |
| 210 | +%End |
| 211 | + |
| 212 | + |
| 213 | + double measureLineProjected( const QgsPoint &p1, double distance = 1, double azimuth = M_PI / 2, QgsPoint *projectedPoint /Out/ = 0 ) const; |
| 214 | +%Docstring |
| 215 | + Calculates distance from one point with distance in meters and azimuth (direction) |
| 216 | + When the sourceCrs() is geographic, computeSpheroidProject() will be called |
| 217 | + otherwise QgsPoint.project() will be called after QgsUnitTypes.fromUnitToUnitFactor() has been applied to the distance |
| 218 | + \note: |
| 219 | + The input Point must be in the coordinate reference system being used |
| 220 | +.. versionadded:: 3.0 |
| 221 | + \param p1 start point [can be Cartesian or Geographic] |
| 222 | + \param distance must be in meters |
| 223 | + \param azimuth - azimuth in radians, clockwise from North |
| 224 | + \param projectedPoint calculated projected point |
| 225 | + :return: distance in mapUnits |
| 226 | + \see sourceCrs() |
| 227 | + \see computeSpheroidProject() |
| 228 | + :rtype: float |
| 229 | +%End |
100 | 230 |
|
101 |
| - /** Measures the area of a geometry. |
102 |
| - * @param geometry geometry to measure |
103 |
| - * @returns area of geometry. For geometry collections, non surface geometries will be ignored. The units for the |
104 |
| - * returned area can be retrieved by calling areaUnits(). |
105 |
| - * @note added in QGIS 2.12 |
106 |
| - * @see measureLength() |
107 |
| - * @see measurePerimeter() |
108 |
| - * @see areaUnits() |
109 |
| - */ |
110 |
| - double measureArea( const QgsGeometry* geometry ) const; |
111 |
| - |
112 |
| - /** Measures the length of a geometry. |
113 |
| - * @param geometry geometry to measure |
114 |
| - * @returns length of geometry. For geometry collections, non curve geometries will be ignored. The units for the |
115 |
| - * returned distance can be retrieved by calling lengthUnits(). |
116 |
| - * @note added in QGIS 2.12 |
117 |
| - * @see lengthUnits() |
118 |
| - * @see measureArea() |
119 |
| - * @see measurePerimeter() |
120 |
| - */ |
121 |
| - double measureLength( const QgsGeometry* geometry ) const; |
122 |
| - |
123 |
| - /** Measures the perimeter of a polygon geometry. |
124 |
| - * @param geometry geometry to measure |
125 |
| - * @returns perimeter of geometry. For geometry collections, any non-polygon geometries will be ignored. The units for the |
126 |
| - * returned perimeter can be retrieved by calling lengthUnits(). |
127 |
| - * @note added in QGIS 2.12 |
128 |
| - * @see lengthUnits() |
129 |
| - * @see measureArea() |
130 |
| - * @see measurePerimeter() |
131 |
| - */ |
132 |
| - double measurePerimeter( const QgsGeometry *geometry ) const; |
133 |
| - |
134 |
| - /** Measures the length of a line with multiple segments. |
135 |
| - * @param points list of points in line |
136 |
| - * @returns length of line. The units for the returned length can be retrieved by calling lengthUnits(). |
137 |
| - * @see lengthUnits() |
138 |
| - */ |
139 |
| - double measureLine( const QList<QgsPoint>& points ) const; |
140 |
| - |
141 |
| - /** Measures length of a line with one segment. |
142 |
| - * @param p1 start of line |
143 |
| - * @param p2 end of line |
144 |
| - * @returns distance between points. The units for the returned distance can be retrieved by calling lengthUnits(). |
145 |
| - * @see lengthUnits() |
146 |
| - */ |
147 |
| - double measureLine( const QgsPoint& p1, const QgsPoint& p2 ) const; |
148 |
| - |
149 |
| - /** |
150 |
| - * calculates distance from one point with distance in meters and azimuth (direction) |
151 |
| - * based on inverse Vincenty's formula when Geographic |
152 |
| - * otherwise QgsPoint.project() will be called after QgsUnitTypes::fromUnitToUnitFactor() has been applied to the distance |
153 |
| - * note: usage: |
154 |
| - * QgsDistanceArea myDa; |
155 |
| - * myDa.setSourceCrs( layer->crs() ); |
156 |
| - * \since QGIS 3.0 |
157 |
| - * @param p1 start point [can be Cartesian or Geographic] |
158 |
| - * @param distance expected to be in meters |
159 |
| - * @param azimuth - azimuth in radians. [default M_PI/2 - East of p1] |
160 |
| - * @param projectedPoint calculated projected point |
161 |
| - * @return distance in mapUnits |
162 |
| - */ |
163 |
| - double measureLineProjected( const QgsPoint &p1, double distance = 1, double azimuth = M_PI / 2, QgsPoint *projectedPoint /Out/ = nullptr ) const; |
164 |
| - |
165 |
| - /** Returns the units of distance for length calculations made by this object. |
166 |
| - * @note added in QGIS 2.14 |
167 |
| - * @see areaUnits() |
168 |
| - */ |
169 | 231 | QgsUnitTypes::DistanceUnit lengthUnits() const;
|
| 232 | +%Docstring |
| 233 | + Returns the units of distance for length calculations made by this object. |
| 234 | +.. versionadded:: 2.14 |
| 235 | + \see areaUnits() |
| 236 | + :rtype: QgsUnitTypes.DistanceUnit |
| 237 | +%End |
170 | 238 |
|
171 |
| - /** Returns the units of area for areal calculations made by this object. |
172 |
| - * @note added in QGIS 2.14 |
173 |
| - * @see lengthUnits() |
174 |
| - */ |
175 | 239 | QgsUnitTypes::AreaUnit areaUnits() const;
|
| 240 | +%Docstring |
| 241 | + Returns the units of area for areal calculations made by this object. |
| 242 | +.. versionadded:: 2.14 |
| 243 | + \see lengthUnits() |
| 244 | + :rtype: QgsUnitTypes.AreaUnit |
| 245 | +%End |
| 246 | + |
| 247 | + double measurePolygon( const QList<QgsPoint> &points ) const; |
| 248 | +%Docstring |
| 249 | + Measures the area of the polygon described by a set of points. |
| 250 | + :rtype: float |
| 251 | +%End |
| 252 | + |
| 253 | + double bearing( const QgsPoint &p1, const QgsPoint &p2 ) const; |
| 254 | +%Docstring |
| 255 | + Compute the bearing (in radians) between two points. |
| 256 | + :rtype: float |
| 257 | +%End |
176 | 258 |
|
177 |
| - //! measures polygon area |
178 |
| - double measurePolygon( const QList<QgsPoint>& points ) const; |
179 |
| - |
180 |
| - //! compute bearing - in radians |
181 |
| - double bearing( const QgsPoint& p1, const QgsPoint& p2 ) const; |
182 |
| - |
183 |
| - /** Returns an distance formatted as a friendly string. |
184 |
| - * @param distance distance to format |
185 |
| - * @param decimals number of decimal places to show |
186 |
| - * @param unit unit of distance |
187 |
| - * @param keepBaseUnit set to false to allow conversion of large distances to more suitable units, e.g., meters to |
188 |
| - * kilometers |
189 |
| - * @returns formatted distance string |
190 |
| - * @note added in QGIS 2.16 |
191 |
| - * @see formatArea() |
192 |
| - */ |
193 | 259 | static QString formatDistance( double distance, int decimals, QgsUnitTypes::DistanceUnit unit, bool keepBaseUnit = false );
|
| 260 | +%Docstring |
| 261 | + Returns an distance formatted as a friendly string. |
| 262 | + \param distance distance to format |
| 263 | + \param decimals number of decimal places to show |
| 264 | + \param unit unit of distance |
| 265 | + \param keepBaseUnit set to false to allow conversion of large distances to more suitable units, e.g., meters to |
| 266 | + kilometers |
| 267 | + :return: formatted distance string |
| 268 | +.. versionadded:: 2.16 |
| 269 | + \see formatArea() |
| 270 | + :rtype: str |
| 271 | +%End |
194 | 272 |
|
195 |
| - /** Returns an area formatted as a friendly string. |
196 |
| - * @param area area to format |
197 |
| - * @param decimals number of decimal places to show |
198 |
| - * @param unit unit of area |
199 |
| - * @param keepBaseUnit set to false to allow conversion of large areas to more suitable units, e.g., square meters to |
200 |
| - * square kilometers |
201 |
| - * @returns formatted area string |
202 |
| - * @note added in QGIS 2.14 |
203 |
| - * @see formatDistance() |
204 |
| - */ |
205 | 273 | static QString formatArea( double area, int decimals, QgsUnitTypes::AreaUnit unit, bool keepBaseUnit = false );
|
| 274 | +%Docstring |
| 275 | + Returns an area formatted as a friendly string. |
| 276 | + \param area area to format |
| 277 | + \param decimals number of decimal places to show |
| 278 | + \param unit unit of area |
| 279 | + \param keepBaseUnit set to false to allow conversion of large areas to more suitable units, e.g., square meters to |
| 280 | + square kilometers |
| 281 | + :return: formatted area string |
| 282 | +.. versionadded:: 2.14 |
| 283 | + \see formatDistance() |
| 284 | + :rtype: str |
| 285 | +%End |
206 | 286 |
|
207 |
| - /** Takes a length measurement calculated by this QgsDistanceArea object and converts it to a |
208 |
| - * different distance unit. |
209 |
| - * @param length length value calculated by this class to convert. It is assumed that the length |
210 |
| - * was calculated by this class, ie that its unit of length is equal to lengthUnits(). |
211 |
| - * @param toUnits distance unit to convert measurement to |
212 |
| - * @returns converted distance |
213 |
| - * @see convertAreaMeasurement() |
214 |
| - * @note added in QGIS 2.14 |
215 |
| - */ |
216 | 287 | double convertLengthMeasurement( double length, QgsUnitTypes::DistanceUnit toUnits ) const;
|
| 288 | +%Docstring |
| 289 | + Takes a length measurement calculated by this QgsDistanceArea object and converts it to a |
| 290 | + different distance unit. |
| 291 | + \param length length value calculated by this class to convert. It is assumed that the length |
| 292 | + was calculated by this class, ie that its unit of length is equal to lengthUnits(). |
| 293 | + \param toUnits distance unit to convert measurement to |
| 294 | + :return: converted distance |
| 295 | + \see convertAreaMeasurement() |
| 296 | +.. versionadded:: 2.14 |
| 297 | + :rtype: float |
| 298 | +%End |
217 | 299 |
|
218 |
| - /** Takes an area measurement calculated by this QgsDistanceArea object and converts it to a |
219 |
| - * different areal unit. |
220 |
| - * @param area area value calculated by this class to convert. It is assumed that the area |
221 |
| - * was calculated by this class, ie that its unit of area is equal to areaUnits(). |
222 |
| - * @param toUnits area unit to convert measurement to |
223 |
| - * @returns converted area |
224 |
| - * @see convertLengthMeasurement() |
225 |
| - * @note added in QGIS 2.14 |
226 |
| - */ |
227 | 300 | double convertAreaMeasurement( double area, QgsUnitTypes::AreaUnit toUnits ) const;
|
| 301 | +%Docstring |
| 302 | + Takes an area measurement calculated by this QgsDistanceArea object and converts it to a |
| 303 | + different areal unit. |
| 304 | + \param area area value calculated by this class to convert. It is assumed that the area |
| 305 | + was calculated by this class, ie that its unit of area is equal to areaUnits(). |
| 306 | + \param toUnits area unit to convert measurement to |
| 307 | + :return: converted area |
| 308 | + \see convertLengthMeasurement() |
| 309 | +.. versionadded:: 2.14 |
| 310 | + :rtype: float |
| 311 | +%End |
228 | 312 |
|
229 |
| - protected: |
230 |
| - //! measures polygon area and perimeter, vertices are extracted from WKB |
231 |
| - // @note not available in python bindings |
232 |
| - // QgsConstWkbPtr measurePolygon( QgsConstWkbPtr feature, double* area, double* perimeter, bool hasZptr = false ) const; |
233 |
| - |
234 |
| - /** |
235 |
| - * calculates distance from two points on ellipsoid |
236 |
| - * based on inverse Vincenty's formulae |
237 |
| - * |
238 |
| - * Points p1 and p2 are expected to be in degrees and in currently used ellipsoid |
239 |
| - * |
240 |
| - * @note if course1 is not NULL, bearing (in radians) from first point is calculated |
241 |
| - * (the same for course2) |
242 |
| - * @return distance in meters |
243 |
| - */ |
244 |
| - double computeDistanceBearing( const QgsPoint& p1, const QgsPoint& p2, |
245 |
| - double* course1 = 0, double* course2 = 0 ) const; |
246 |
| - |
247 |
| - /** |
248 |
| - * Given a location, an azimuth and a distance, computes the |
249 |
| - * location of the projected point. Based on Vincenty's formula |
250 |
| - * for the geodetic direct problem as described in "Geocentric |
251 |
| - * Datum of Australia Technical Manual", Chapter 4. Tested against: |
252 |
| - * http://mascot.gdbc.gov.bc.ca/mascot/util1b.html |
253 |
| - * and |
254 |
| - * http://www.ga.gov.au/nmd/geodesy/datums/vincenty_direct.jsp |
255 |
| - * @note code (and documentation) taken from rttopo project |
256 |
| - * https://git.osgeo.org/gogs/rttopo/librttopo |
257 |
| - * - spheroid_project.spheroid_project(...) |
258 |
| - * \since QGIS 3.0 |
259 |
| - * @param p1 - location of first Geographic (lat,long) point. |
260 |
| - * @param distance - distance in meters. [default 1 meter] |
261 |
| - * @param azimuth - azimuth in radians. [default M_PI/2 - East of p1] |
262 |
| - * @return p2 - location of projected point. |
263 |
| - */ |
264 | 313 | QgsPoint computeSpheroidProject( const QgsPoint &p1, double distance = 1, double azimuth = M_PI / 2 ) const;
|
| 314 | +%Docstring |
| 315 | + Given a location, an azimuth and a distance, computes the |
| 316 | + location of the projected point. Based on Vincenty's formula |
| 317 | + for the geodetic direct problem as described in "Geocentric |
| 318 | + Datum of Australia Technical Manual", Chapter 4. |
| 319 | +.. note:: |
| 320 | + |
| 321 | + code (and documentation) taken from rttopo project |
| 322 | + https://git.osgeo.org/gogs/rttopo/librttopo |
| 323 | + - spheroid_project.spheroid_project(...) |
| 324 | +.. versionadded:: 3.0 |
| 325 | + \param p1 - location of first geographic (latitude/longitude) point as degrees. |
| 326 | + \param distance - distance in meters. |
| 327 | + \param azimuth - azimuth in radians, clockwise from North |
| 328 | + :return: p2 - location of projected point as longitude/latitude. |
| 329 | + :rtype: QgsPoint |
| 330 | +%End |
265 | 331 |
|
266 |
| - //! uses flat / planimetric / Euclidean distance |
267 |
| - double computeDistanceFlat( const QgsPoint& p1, const QgsPoint& p2 ) const; |
268 |
| - |
269 |
| - //! calculate distance with given coordinates (does not do a transform anymore) |
270 |
| - double computeDistance( const QList<QgsPoint>& points ) const; |
271 |
| - |
272 |
| - /** |
273 |
| - * calculates area of polygon on ellipsoid |
274 |
| - * algorithm has been taken from GRASS: gis/area_poly1.c |
275 |
| - */ |
276 |
| - double computePolygonArea( const QList<QgsPoint>& points ) const; |
277 |
| - |
278 |
| - double computePolygonFlatArea( const QList<QgsPoint>& points ) const; |
| 332 | +}; |
279 | 333 |
|
280 |
| - /** |
281 |
| - * precalculates some values |
282 |
| - * (must be called always when changing ellipsoid) |
283 |
| - */ |
284 |
| - void computeAreaInit(); |
285 | 334 |
|
286 |
| -}; |
| 335 | +/************************************************************************ |
| 336 | + * This file has been generated automatically from * |
| 337 | + * * |
| 338 | + * src/core/qgsdistancearea.h * |
| 339 | + * * |
| 340 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 341 | + ************************************************************************/ |
0 commit comments