@@ -594,10 +594,21 @@ bool QgsRasterProjector::checkCols()
594
594
QgsPoint mySrcPoint3 = mCPMatrix [r+1 ][c];
595
595
596
596
QgsPoint mySrcApprox (( mySrcPoint1.x () + mySrcPoint3.x () ) / 2 , ( mySrcPoint1.y () + mySrcPoint3.y () ) / 2 );
597
- QgsPoint myDestApprox = mCoordinateTransform .transform ( mySrcApprox, QgsCoordinateTransform::ReverseTransform );
598
- double mySqrDist = myDestApprox.sqrDist ( myDestPoint );
599
- if ( mySqrDist > mSqrTolerance )
600
- return false ;
597
+ try
598
+ {
599
+ QgsPoint myDestApprox = mCoordinateTransform .transform ( mySrcApprox, QgsCoordinateTransform::ReverseTransform );
600
+ double mySqrDist = myDestApprox.sqrDist ( myDestPoint );
601
+ if ( mySqrDist > mSqrTolerance )
602
+ {
603
+ return false ;
604
+ }
605
+ }
606
+ catch ( QgsCsException &e )
607
+ {
608
+ Q_UNUSED ( e );
609
+ // Caught an error in transform
610
+ return false ;
611
+ }
601
612
}
602
613
}
603
614
return true ;
@@ -618,10 +629,21 @@ bool QgsRasterProjector::checkRows()
618
629
QgsPoint mySrcPoint3 = mCPMatrix [r][c+1 ];
619
630
620
631
QgsPoint mySrcApprox (( mySrcPoint1.x () + mySrcPoint3.x () ) / 2 , ( mySrcPoint1.y () + mySrcPoint3.y () ) / 2 );
621
- QgsPoint myDestApprox = mCoordinateTransform .transform ( mySrcApprox, QgsCoordinateTransform::ReverseTransform );
622
- double mySqrDist = myDestApprox.sqrDist ( myDestPoint );
623
- if ( mySqrDist > mSqrTolerance )
624
- return false ;
632
+ try
633
+ {
634
+ QgsPoint myDestApprox = mCoordinateTransform .transform ( mySrcApprox, QgsCoordinateTransform::ReverseTransform );
635
+ double mySqrDist = myDestApprox.sqrDist ( myDestPoint );
636
+ if ( mySqrDist > mSqrTolerance )
637
+ {
638
+ return false ;
639
+ }
640
+ }
641
+ catch ( QgsCsException &e )
642
+ {
643
+ Q_UNUSED ( e );
644
+ // Caught an error in transform
645
+ return false ;
646
+ }
625
647
}
626
648
}
627
649
return true ;
0 commit comments