Skip to content
Permalink
Browse files

fix bug with extents for raster layers

git-svn-id: http://svn.osgeo.org/qgis/trunk@10072 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer
cfarmer committed Jan 31, 2009
1 parent 9509fef commit 9e67c9d0dbfc222e44caf1be9479162e3cef65a3
Showing with 14 additions and 5 deletions.
  1. +4 −5 python/plugins/ftools/tools/doVectorGrid.py
  2. +10 −0 python/plugins/ftools/tools/ftools_utils.py
@@ -50,10 +50,9 @@ def __init__(self, iface):
self.xMax.setValidator(QDoubleValidator(self.xMax))
self.yMin.setValidator(QDoubleValidator(self.yMin))
self.yMax.setValidator(QDoubleValidator(self.yMax))
layers = ftools_utils.getLayerNames(
[ QGis.Point, QGis.Line, QGis.Polygon ] )
for layer in layers:
self.inShape.addItem( layer )
layermap = QgsMapLayerRegistry.instance().mapLayers()
for name, layer in layermap.iteritems():
self.inShape.addItem( unicode( layer.name() ) )

def offset(self, value):
if self.chkLock.isChecked():
@@ -62,7 +61,7 @@ def offset(self, value):
def updateLayer( self ):
mLayerName = self.inShape.currentText()
if not mLayerName == "":
mLayer = self.getMapLayerByName( unicode( mLayerName ) )
mLayer = ftools_utils.getMapLayerByName( unicode( mLayerName ) )
boundBox = mLayer.extent()
self.updateExtents( boundBox )

@@ -183,6 +183,16 @@ def getVectorLayerByName( myName ):
return layer
else:
return None

# Return QgsMapLayer from a layer name ( as string )
def getMapLayerByName( myName ):
layermap = QgsMapLayerRegistry.instance().mapLayers()
for name, layer in layermap.iteritems():
if layer.name() == myName:
if layer.isValid():
return layer
else:
return None

# Return the field list of a vector layer
def getFieldList( vlayer ):

0 comments on commit 9e67c9d

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