Skip to content

Commit

Permalink
Saving gcps should ALWAYS use source pixel coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 14, 2022
1 parent e255484 commit 634acee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/georeferencer/qgsgeorefmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,11 +1309,13 @@ void QgsGeoreferencerMainWindow::saveGCPs()
points << "mapX,mapY,pixelX,pixelY,enable,dX,dY,residual" << endl;
for ( QgsGeorefDataPoint *pt : std::as_const( mPoints ) )
{
const QgsPointXY sourcePixel = mGeorefTransform.toSourcePixel( pt->sourceCoords() );

points << QStringLiteral( "%1,%2,%3,%4,%5,%6,%7,%8" )
.arg( qgsDoubleToString( pt->transCoords().x() ),
qgsDoubleToString( pt->transCoords().y() ),
qgsDoubleToString( pt->sourceCoords().x() ),
qgsDoubleToString( pt->sourceCoords().y() ) )
qgsDoubleToString( sourcePixel.x() ),
qgsDoubleToString( sourcePixel.y() ) )
.arg( pt->isEnabled() )
.arg( qgsDoubleToString( pt->residual().x() ),
qgsDoubleToString( pt->residual().y() ),
Expand Down

0 comments on commit 634acee

Please sign in to comment.