Skip to content

Commit 59a0e2f

Browse files
mj10777nyalldawson
authored andcommittedDec 5, 2016
Fix #15829 georeferencer - resolve logical error during loadGCPs
1 parent be4c815 commit 59a0e2f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed
 

‎src/plugins/georeferencer/qgsgeorefplugingui.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,20 +1258,31 @@ bool QgsGeorefPluginGui::loadGCPs( /*bool verbose*/ )
12581258

12591259
QgsPoint mapCoords( ls.at( 0 ).toDouble(), ls.at( 1 ).toDouble() ); // map x,y
12601260
QgsPoint pixelCoords( ls.at( 2 ).toDouble(), ls.at( 3 ).toDouble() ); // pixel x,y
1261+
QgsGeorefDataPoint* pnt;
12611262
if ( ls.count() == 5 )
12621263
{
12631264
bool enable = ls.at( 4 ).toInt();
1264-
addPoint( pixelCoords, mapCoords, enable, false/*, verbose*/ ); // enabled
1265+
pnt = new QgsGeorefDataPoint( mCanvas, mIface->mapCanvas(), pixelCoords, mapCoords, enable );
12651266
}
12661267
else
1267-
addPoint( pixelCoords, mapCoords, true, false );
1268+
pnt = new QgsGeorefDataPoint( mCanvas, mIface->mapCanvas(), pixelCoords, mapCoords, true );
1269+
1270+
mPoints.append( pnt );
1271+
connect( mCanvas, SIGNAL( extentsChanged() ), pnt, SLOT( updateCoords() ) );
1272+
mGCPsDirty = true;
12681273

12691274
++i;
12701275
}
12711276

12721277
mInitialPoints = mPoints;
12731278
// showMessageInLog(tr("GCP points loaded from"), mGCPpointsFileName);
1274-
mCanvas->refresh();
1279+
if ( mGCPsDirty )
1280+
{
1281+
mGCPListWidget->setGCPList( &mPoints );
1282+
updateGeorefTransform();
1283+
mCanvas->refresh();
1284+
mIface->mapCanvas()->refresh();
1285+
}
12751286

12761287
return true;
12771288
}

0 commit comments

Comments
 (0)
Please sign in to comment.