Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,23 @@ class QgsDistanceArea
64
64
//! measures line
65
65
double measureLine( const QList<QgsPoint>& points );
66
66
67
- //! measures line with one segment
67
+ /** Measures length of line with one segment
68
+ * @param p1 start of line
69
+ * @param p2 end of line
70
+ * @returns distance in meters, or map units if cartesian calculation was performed
71
+ */
68
72
double measureLine( const QgsPoint& p1, const QgsPoint& p2 );
69
73
74
+ /** Measures length of line with one segment and returns units of distance.
75
+ * @param p1 start of line
76
+ * @param p2 end of line
77
+ * @param units will be set to units of measure
78
+ * @returns calculated distance between points. Distance units are stored in units parameter.
79
+ * @note backported from QGIS 2.12 (where it is const)
80
+ * @note not available in python bindings
81
+ */
82
+ // double measureLine( const QgsPoint& p1, const QgsPoint& p2, QGis::UnitType& units );
83
+
70
84
//! measures polygon area
71
85
double measurePolygon( const QList<QgsPoint>& points );
72
86
Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ double QgsDistanceArea::measureLine( const QgsPoint &p1, const QgsPoint &p2 )
465
465
return measureLine ( p1, p2, units );
466
466
}
467
467
468
- double QgsDistanceArea::measureLine ( const QgsPoint& p1, const QgsPoint& p2, QGis::UnitType& units ) const
468
+ double QgsDistanceArea::measureLine ( const QgsPoint& p1, const QgsPoint& p2, QGis::UnitType& units )
469
469
{
470
470
double result;
471
471
units = mCoordTransform ->sourceCrs ().mapUnits ();
Original file line number Diff line number Diff line change @@ -100,16 +100,17 @@ class CORE_EXPORT QgsDistanceArea
100
100
* @param p2 end of line
101
101
* @returns distance in meters, or map units if cartesian calculation was performed
102
102
*/
103
- double measureLine ( const QgsPoint& p1, const QgsPoint& p2 ) const ;
103
+ double measureLine ( const QgsPoint& p1, const QgsPoint& p2 );
104
104
105
105
/* * Measures length of line with one segment and returns units of distance.
106
106
* @param p1 start of line
107
107
* @param p2 end of line
108
108
* @param units will be set to units of measure
109
109
* @returns calculated distance between points. Distance units are stored in units parameter.
110
- * @note added in QGIS 2.12
110
+ * @note backported from QGIS 2.12 (where it is const)
111
+ * @note not available in python bindings
111
112
*/
112
- double measureLine ( const QgsPoint& p1, const QgsPoint& p2, QGis::UnitType& units ) const ;
113
+ double measureLine ( const QgsPoint& p1, const QgsPoint& p2, QGis::UnitType& units );
113
114
114
115
// ! measures polygon area
115
116
double measurePolygon ( const QList<QgsPoint>& points );
0 commit comments