Skip to content
Permalink
Browse files
Now calculates multilines correctly
git-svn-id: http://svn.osgeo.org/qgis/trunk@6531 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Feb 5, 2007
1 parent fe4554c commit 0b21820d693e5efbbafdf4cff014c7ac64e36c7a
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/core/qgsdistancearea.cpp
@@ -223,6 +223,7 @@ unsigned char* QgsDistanceArea::measureLine(unsigned char* feature, double* area

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

QgsDebugMsg("This feature WKB has " + QString::number(nPoints) + " points");
// Extract the points from the WKB format into the vector
for (unsigned int i = 0; i < nPoints; ++i)
{
@@ -255,11 +256,16 @@ double QgsDistanceArea::measureLine(const std::vector<QgsPoint>& points)
for (std::vector<QgsPoint>::size_type i = 1; i < points.size(); i++)
{
if (mProjectionsEnabled)
{
p2 = mCoordTransform->transform(points[i]);
total += computeDistanceBearing(p1,p2);
}
else
{
p2 = points[i];
total += measureLine(p1,p2);
}

total = computeDistanceBearing(p1,p2);
p1 = p2;
}

0 comments on commit 0b21820

Please sign in to comment.