Skip to content

Commit 6f00cfb

Browse files
author
homann
committed
Fixes bug #523 and #560. Unintialized variables in georeferencer.
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6509 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 35295e3 commit 6f00cfb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/plugins/georeferencer/qgsleastsquares.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include <cmath>
22
#include <stdexcept>
3-
3+
#include "qgslogger.h"
44
#include <gsl/gsl_linalg.h>
55

6+
67
#include <QObject>
78

89
#include "qgsleastsquares.h"
@@ -20,6 +21,8 @@ void QgsLeastSquares::linear(std::vector<QgsPoint> mapCoords,
2021
double sumPx(0), sumPy(0), sumPx2(0), sumPy2(0), sumPxMx(0), sumPyMy(0),
2122
sumMx(0), sumMy(0);
2223
for (int i = 0; i < n; ++i) {
24+
QgsDebugMsg("Processing point Pixel(" + QString::number(pixelCoords[i].x()) + ":" + QString::number(pixelCoords[i].y()) +
25+
")\n Map(" + QString::number(mapCoords[i].x()) + ":" + QString::number(mapCoords[i].y()) + ")\n");
2326
sumPx += pixelCoords[i].x();
2427
sumPy += pixelCoords[i].y();
2528
sumPx2 += std::pow(pixelCoords[i].x(), 2);

src/plugins/georeferencer/qgspointdialog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ bool QgsPointDialog::generateWorldFile()
300300
QgsPoint origin(0, 0);
301301
double pixelSize = 1;
302302
double rotation = 0;
303+
double xOffset = 0.0;
304+
double yOffset = 0.0;
303305

304306
// create arrays with points from mPoints
305307
std::vector<QgsPoint> pixelCoords, mapCoords;
@@ -357,7 +359,6 @@ bool QgsPointDialog::generateWorldFile()
357359
}
358360

359361
// warp the raster if needed
360-
double xOffset, yOffset;
361362
if (rotation != 0)
362363
{
363364

0 commit comments

Comments
 (0)