Skip to content

Commit

Permalink
[fTools] warn if layer and project CRS are different (fix #10059)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jan 20, 2016
1 parent 51ec2bf commit 3b70b84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/plugins/fTools/tools/doVectorGrid.py
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 3b70b84

Please sign in to comment.