Skip to content

Commit

Permalink
Now calculates multilines correctly
Browse files Browse the repository at this point in the history
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 0b21820
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/qgsdistancearea.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 0b21820

Please sign in to comment.