Skip to content

Commit 0b21820

Browse files
author
homann
committed
Now calculates multilines correctly
git-svn-id: http://svn.osgeo.org/qgis/trunk@6531 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fe4554c commit 0b21820

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/qgsdistancearea.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ unsigned char* QgsDistanceArea::measureLine(unsigned char* feature, double* area
223223

224224
std::vector<QgsPoint> points(nPoints);
225225

226+
QgsDebugMsg("This feature WKB has " + QString::number(nPoints) + " points");
226227
// Extract the points from the WKB format into the vector
227228
for (unsigned int i = 0; i < nPoints; ++i)
228229
{
@@ -255,11 +256,16 @@ double QgsDistanceArea::measureLine(const std::vector<QgsPoint>& points)
255256
for (std::vector<QgsPoint>::size_type i = 1; i < points.size(); i++)
256257
{
257258
if (mProjectionsEnabled)
259+
{
258260
p2 = mCoordTransform->transform(points[i]);
261+
total += computeDistanceBearing(p1,p2);
262+
}
259263
else
264+
{
260265
p2 = points[i];
266+
total += measureLine(p1,p2);
267+
}
261268

262-
total = computeDistanceBearing(p1,p2);
263269
p1 = p2;
264270
}
265271

0 commit comments

Comments
 (0)