[QGIS Commit] r13515 - trunk/qgis/src/plugins/georeferencer
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Mon May 17 08:37:24 EDT 2010
Author: mhugent
Date: 2010-05-17 08:37:21 -0400 (Mon, 17 May 2010)
New Revision: 13515
Modified:
trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
Log:
Fix calculation of mean error in georeferencer
Modified: trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp 2010-05-17 11:40:57 UTC (rev 13514)
+++ trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp 2010-05-17 12:37:21 UTC (rev 13515)
@@ -1245,32 +1245,37 @@
parameterLabel->setSceneRect( QRectF( 2, composerMap->rect().bottom() + composerMap->transform().dy() + 5, composition->paperWidth(), 8 ) );
parameterLabel->setFrame( false );
+ int nPointsEnabled = 0;
+ QgsGCPList::const_iterator gcpIt = mPoints.constBegin();
+ for ( ; gcpIt != mPoints.constEnd(); ++gcpIt )
+ {
+ if (( *gcpIt )->isEnabled() )
+ {
+ ++nPointsEnabled;
+ }
+ }
+
//calculate mean error (in map units)
double meanError = 0;
- if ( mPoints.size() > 4 )
+ if ( nPointsEnabled > 2 )
{
double sumVxSquare = 0;
double sumVySquare = 0;
double resXMap, resYMap;
- int nPointsEnabled = 0;
QgsGCPList::const_iterator gcpIt = mPoints.constBegin();
for ( ; gcpIt != mPoints.constEnd(); ++gcpIt )
{
if (( *gcpIt )->isEnabled() )
{
resXMap = ( *gcpIt )->residual().x() * wldScaleX;
- resYMap = ( *gcpIt )->residual().x() * wldScaleY;
+ resYMap = ( *gcpIt )->residual().y() * wldScaleY;
sumVxSquare += ( resXMap * resXMap );
sumVySquare += ( resYMap * resYMap );
- ++nPointsEnabled;
}
}
- if ( nPointsEnabled > 4 )
- {
- meanError = sqrt(( sumVxSquare + sumVySquare ) / ( 2 * nPointsEnabled - 4 ) ) * sqrt( 2.0 );
- }
+ meanError = sqrt(( sumVxSquare + sumVySquare ) / ( 2 * nPointsEnabled - 4 ) ) * sqrt( 2.0 );
}
More information about the QGIS-commit
mailing list