Skip to content
Permalink
Browse files

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

  • Loading branch information
alexbruy committed Jan 20, 2016
1 parent 51ec2bf commit 3b70b8446542a9aa0670f1975e81b52d53e0c4c6
Showing with 4 additions and 0 deletions.
  1. +4 −0 python/plugins/fTools/tools/doVectorGrid.py
@@ -72,6 +72,9 @@ def updateLayer(self):
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 @@ def compute(self, bound, xOffset, yOffset, polygon):
crs = self.iface.mapCanvas().mapRenderer().destinationCrs()
else:
crs = layer.crs()

if not crs.isValid():
crs = None

0 comments on commit 3b70b84

Please sign in to comment.
You can’t perform that action at this time.