Skip to content
Permalink
Browse files
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
  • Loading branch information
homann committed Feb 3, 2007
1 parent 35295e3 commit 6f00cfbd8c950149d32fc72312a7becede7bcb08
Showing with 6 additions and 2 deletions.
  1. +4 −1 src/plugins/georeferencer/qgsleastsquares.cpp
  2. +2 −1 src/plugins/georeferencer/qgspointdialog.cpp
@@ -1,8 +1,9 @@
#include <cmath>
#include <stdexcept>

#include "qgslogger.h"
#include <gsl/gsl_linalg.h>


#include <QObject>

#include "qgsleastsquares.h"
@@ -20,6 +21,8 @@ void QgsLeastSquares::linear(std::vector<QgsPoint> mapCoords,
double sumPx(0), sumPy(0), sumPx2(0), sumPy2(0), sumPxMx(0), sumPyMy(0),
sumMx(0), sumMy(0);
for (int i = 0; i < n; ++i) {
QgsDebugMsg("Processing point Pixel(" + QString::number(pixelCoords[i].x()) + ":" + QString::number(pixelCoords[i].y()) +
")\n Map(" + QString::number(mapCoords[i].x()) + ":" + QString::number(mapCoords[i].y()) + ")\n");
sumPx += pixelCoords[i].x();
sumPy += pixelCoords[i].y();
sumPx2 += std::pow(pixelCoords[i].x(), 2);
@@ -300,6 +300,8 @@ bool QgsPointDialog::generateWorldFile()
QgsPoint origin(0, 0);
double pixelSize = 1;
double rotation = 0;
double xOffset = 0.0;
double yOffset = 0.0;

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

// warp the raster if needed
double xOffset, yOffset;
if (rotation != 0)
{

0 comments on commit 6f00cfb

Please sign in to comment.