Skip to content
Permalink
Browse files
Ported r6509 to trunnk
git-svn-id: http://svn.osgeo.org/qgis/trunk@6510 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Feb 3, 2007
1 parent 07fe37f commit fb8e17aec30676e75c7855b6f381938037f6cb8d
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);
@@ -294,6 +294,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;
@@ -351,7 +353,6 @@ bool QgsPointDialog::generateWorldFile()
}

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

0 comments on commit fb8e17a

Please sign in to comment.