Skip to content
Permalink
Browse files
show residuals in pixel for non-linear transformations
git-svn-id: http://svn.osgeo.org/qgis/trunk@13626 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 2, 2010
1 parent 0ee10f2 commit dcbbbfc78d55b414897ec0baefc7e01619321706
@@ -92,14 +92,22 @@ void QgsGCPListModel::updateModel()
vector<QgsPoint> mapCoords, pixelCoords;
mGCPList->createGCPVectors( mapCoords, pixelCoords );

// TODO: the parameters should probable be updated externally (by user interaction)
bTransformUpdated = mGeorefTransform->updateParametersFromGCPs( mapCoords, pixelCoords );


// // Setup table header
QStringList itemLabels;
QString unitType;
QSettings s;
if ( s.value( "/Plugin-GeoReferencer/Config/ResidualUnits" ) == "mapUnits" )
bool mapUnitsPossible = false;

if ( mGeorefTransform )
{
bTransformUpdated = mGeorefTransform->updateParametersFromGCPs( mapCoords, pixelCoords );
mapUnitsPossible = mGeorefTransform->providesAccurateInverseTransformation();
}


if ( s.value( "/Plugin-GeoReferencer/Config/ResidualUnits" ) == "mapUnits" && mapUnitsPossible )
{
unitType = tr( "map units" );
}
@@ -70,7 +70,7 @@
<item row="1" column="0">
<widget class="QRadioButton" name="mMapUnitsButton">
<property name="text">
<string>Map units</string>
<string>Use map units if possible</string>
</property>
</widget>
</item>
@@ -1344,7 +1344,7 @@ bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsG

QString residualUnits;
QSettings s;
if ( s.value( "/Plugin-GeoReferencer/Config/ResidualUnits" ) == "mapUnits" )
if ( s.value( "/Plugin-GeoReferencer/Config/ResidualUnits" ) == "mapUnits" && mGeorefTransform.providesAccurateInverseTransformation() )
{
residualUnits = tr( "map units" );
}
@@ -150,6 +150,13 @@ void QgsGeorefTransform::selectTransformParametrisation( TransformParametrisatio
}
}

bool QgsGeorefTransform::providesAccurateInverseTransformation() const
{
return ( mTransformParametrisation == Linear \
|| mTransformParametrisation == Helmert \
|| mTransformParametrisation == PolynomialOrder1 );
}

bool QgsGeorefTransform::parametersInitialized() const
{
return mParametersInitialized;
@@ -82,6 +82,9 @@ class QgsGeorefTransform : public QgsGeorefTransformInterface
//! \brief The transform parametrisation currently in use.
TransformParametrisation transformParametrisation() const;

/**True for linear, Helmert, first order polynomial*/
bool providesAccurateInverseTransformation() const;

//! \returns whether the parameters of this transform have been initialised by \ref updateParametersFromGCPs
bool parametersInitialized() const;

0 comments on commit dcbbbfc

Please sign in to comment.