[fTools] warn if layer and project CRS are different (fix #10059)

This commit is contained in:
Alexander Bruy 2016-01-20 15:38:00 +02:00
parent 51ec2bfba6
commit 3b70b84465

View File

@ -72,6 +72,9 @@ class Dialog(QDialog, Ui_Dialog):
mLayerName = self.inShape.currentText()
if not mLayerName == "":
mLayer = ftools_utils.getMapLayerByName(unicode(mLayerName))
if mLayer.crs() != self.iface.mapCanvas().mapRenderer().destinationCrs():
QMessageBox.warning(self, self.tr("Vector grid"), self.tr("Layer and project have different CRS!\nResults may be wrong."))
# get layer extents
boundBox = mLayer.extent()
# if "align extents and resolution..." button is checked
@ -166,6 +169,7 @@ class Dialog(QDialog, Ui_Dialog):
crs = self.iface.mapCanvas().mapRenderer().destinationCrs()
else:
crs = layer.crs()
if not crs.isValid():
crs = None