Skip to content

Commit

Permalink
Ported r6509 to trunnk
Browse files Browse the repository at this point in the history
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 fb8e17a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/plugins/georeferencer/qgsleastsquares.cpp
@@ -1,8 +1,9 @@
#include <cmath>
#include <stdexcept>

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


#include <QObject>

#include "qgsleastsquares.h"
Expand All @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/georeferencer/qgspointdialog.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -351,7 +353,6 @@ bool QgsPointDialog::generateWorldFile()
}

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

Expand Down

0 comments on commit fb8e17a

Please sign in to comment.