2010-06-04 00:31:48 +00:00
# -*- coding: utf-8 -*-
"""
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2010-11-15 00:13:59 +00:00
Name : GdalTools
2010-06-04 00:31:48 +00:00
Description : Integrate gdal tools into qgis
Date : 17 / Sep / 09
copyright : ( C ) 2009 by Lorenzo Masini ( Faunalia )
email : lorenxo86 @gmail.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* This program is free software ; you can redistribute it and / or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation ; either version 2 of the License , or *
* ( at your option ) any later version . *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
"""
# Import the PyQt and QGIS libraries
from PyQt4 . QtCore import *
from PyQt4 . QtGui import *
from qgis . core import *
# Initialize Qt resources from file resources_rc.py
import resources_rc
2012-04-15 13:22:35 +02:00
# are all dependecies satisfied?
valid = True
2010-06-04 00:31:48 +00:00
2012-04-15 13:22:35 +02:00
# Import required modules
req_mods = { " osgeo " : " osgeo [python-gdal] " }
2010-06-07 19:52:27 +00:00
try :
2010-06-10 15:38:52 +00:00
from osgeo import gdal
from osgeo import ogr
2010-06-07 19:52:27 +00:00
except ImportError , e :
2012-04-15 13:22:35 +02:00
valid = False
2012-04-26 09:32:37 +03:00
# if the plugin is shipped with QGis catch the exception and
2012-04-15 13:22:35 +02:00
# display an error message
import os . path
qgisUserPluginPath = os . path . abspath ( os . path . join ( str ( QgsApplication . qgisSettingsDirPath ( ) ) , " python " ) )
if not os . path . dirname ( __file__ ) . startswith ( qgisUserPluginPath ) :
title = QCoreApplication . translate ( " GdalTools " , " Plugin error " )
message = QCoreApplication . translate ( " GdalTools " , u ' Unable to load % 1 plugin. \n The required " % 2 " module is missing. \n Install it and try again. ' )
import qgis . utils
QMessageBox . warning ( qgis . utils . iface . mainWindow ( ) , title , message . arg ( " GdalTools " ) . arg ( req_mods [ " osgeo " ] ) )
else :
# if a module is missing show a more friendly module's name
error_str = e . args [ 0 ]
error_mod = error_str . replace ( " No module named " , " " )
if req_mods . has_key ( error_mod ) :
error_str = error_str . replace ( error_mod , req_mods [ error_mod ] )
raise ImportError ( error_str )
2010-06-04 00:31:48 +00:00
class GdalTools :
def __init__ ( self , iface ) :
2012-04-15 13:22:35 +02:00
if not valid : return
2010-06-04 00:31:48 +00:00
# Save reference to the QGIS interface
self . iface = iface
try :
self . QgisVersion = unicode ( QGis . QGIS_VERSION_INT )
except :
self . QgisVersion = unicode ( QGis . qgisVersion ) [ 0 ]
2010-06-10 15:38:52 +00:00
if QGis . QGIS_VERSION [ 0 : 3 ] < " 1.5 " :
# For i18n support
userPluginPath = QFileInfo ( QgsApplication . qgisUserDbFilePath ( ) ) . path ( ) + " /python/plugins/GdalTools "
systemPluginPath = QgsApplication . prefixPath ( ) + " /python/plugins/GdalTools "
2010-06-04 00:31:48 +00:00
2010-06-10 15:38:52 +00:00
overrideLocale = QSettings ( ) . value ( " locale/overrideFlag " , QVariant ( False ) ) . toBool ( )
if not overrideLocale :
localeFullName = QLocale . system ( ) . name ( )
else :
localeFullName = QSettings ( ) . value ( " locale/userLocale " , QVariant ( " " ) ) . toString ( )
2010-06-04 00:31:48 +00:00
2010-06-10 15:38:52 +00:00
if QFileInfo ( userPluginPath ) . exists ( ) :
translationPath = userPluginPath + " /i18n/GdalTools_ " + localeFullName + " .qm "
else :
translationPath = systemPluginPath + " /i18n/GdalTools_ " + localeFullName + " .qm "
2010-06-04 00:31:48 +00:00
2010-06-10 15:38:52 +00:00
self . localePath = translationPath
if QFileInfo ( self . localePath ) . exists ( ) :
self . translator = QTranslator ( )
self . translator . load ( self . localePath )
QCoreApplication . installTranslator ( self . translator )
2010-06-04 00:31:48 +00:00
def initGui ( self ) :
2012-04-15 13:22:35 +02:00
if not valid : return
2010-06-04 00:31:48 +00:00
if int ( self . QgisVersion ) < 1 :
QMessageBox . warning ( self . iface . getMainWindow ( ) , " Gdal Tools " ,
QCoreApplication . translate ( " GdalTools " , " Quantum GIS version detected: " ) + unicode ( self . QgisVersion ) + " .xx \n "
+ QCoreApplication . translate ( " GdalTools " , " This version of Gdal Tools requires at least QGIS version 1.0.0 \n Plugin will not be enabled. " ) )
return None
2011-03-14 16:01:10 +00:00
from tools . GdalTools_utils import Version , GdalConfig , LayerRegistry
2010-06-10 15:38:52 +00:00
self . GdalVersion = Version ( GdalConfig . version ( ) )
2011-03-14 16:01:10 +00:00
LayerRegistry . setIface ( self . iface )
2010-06-04 00:31:48 +00:00
2010-11-15 00:13:59 +00:00
# find the Raster menu
rasterMenu = None
menu_bar = self . iface . mainWindow ( ) . menuBar ( )
actions = menu_bar . actions ( )
rasterText = QCoreApplication . translate ( " QgisApp " , " &Raster " )
for a in actions :
2011-03-13 01:16:00 +00:00
if a . menu ( ) != None and a . menu ( ) . title ( ) == rasterText :
2010-11-15 00:13:59 +00:00
rasterMenu = a . menu ( )
break
if rasterMenu == None :
# no Raster menu, create and insert it before the Help menu
2012-01-26 00:54:56 +01:00
self . menu = QMenu ( rasterText , self . iface . mainWindow ( ) )
2010-11-15 00:13:59 +00:00
lastAction = actions [ len ( actions ) - 1 ]
menu_bar . insertMenu ( lastAction , self . menu )
else :
self . menu = rasterMenu
self . menu . addSeparator ( )
2010-06-04 00:31:48 +00:00
2011-08-09 10:44:11 +03:00
# projections menu (Warp (Reproject), Assign projection)
2012-01-26 00:54:56 +01:00
self . projectionsMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Projections " ) , self . iface . mainWindow ( ) )
2010-06-04 00:31:48 +00:00
2011-08-09 10:44:11 +03:00
self . warp = QAction ( QIcon ( " :/icons/warp.png " ) , QCoreApplication . translate ( " GdalTools " , " Warp (Reproject) " ) , self . iface . mainWindow ( ) )
self . warp . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Warp an image into a new coordinate system " ) )
QObject . connect ( self . warp , SIGNAL ( " triggered() " ) , self . doWarp )
self . projection = QAction ( QIcon ( " :icons/projection-add.png " ) , QCoreApplication . translate ( " GdalTools " , " Assign projection " ) , self . iface . mainWindow ( ) )
self . projection . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Add projection info to the raster " ) )
QObject . connect ( self . projection , SIGNAL ( " triggered() " ) , self . doProjection )
2011-08-20 11:54:03 +03:00
self . extractProj = QAction ( QIcon ( " :icons/projection-export.png " ) , QCoreApplication . translate ( " GdalTools " , " Extract projection " ) , self . iface . mainWindow ( ) )
2011-08-09 11:21:13 +03:00
self . extractProj . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Extract projection information from raster(s) " ) )
QObject . connect ( self . extractProj , SIGNAL ( " triggered() " ) , self . doExtractProj )
self . projectionsMenu . addActions ( [ self . warp , self . projection , self . extractProj ] )
2011-08-09 10:44:11 +03:00
# conversion menu (Rasterize (Vector to raster), Polygonize (Raster to vector), Translate, RGB to PCT, PCT to RGB)
2012-01-26 00:54:56 +01:00
self . conversionMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Conversion " ) , self . iface . mainWindow ( ) )
2010-06-04 00:31:48 +00:00
if self . GdalVersion > = " 1.3 " :
2011-03-18 15:22:22 +00:00
self . rasterize = QAction ( QIcon ( " :/icons/rasterize.png " ) , QCoreApplication . translate ( " GdalTools " , " Rasterize (Vector to raster) " ) , self . iface . mainWindow ( ) )
2010-06-04 00:31:48 +00:00
self . rasterize . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Burns vector geometries into a raster " ) )
QObject . connect ( self . rasterize , SIGNAL ( " triggered() " ) , self . doRasterize )
2011-08-09 10:44:11 +03:00
self . conversionMenu . addAction ( self . rasterize )
2010-06-04 00:31:48 +00:00
if self . GdalVersion > = " 1.6 " :
2011-03-18 15:22:22 +00:00
self . polygonize = QAction ( QIcon ( " :/icons/polygonize.png " ) , QCoreApplication . translate ( " GdalTools " , " Polygonize (Raster to vector) " ) , self . iface . mainWindow ( ) )
2010-06-04 00:31:48 +00:00
self . polygonize . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Produces a polygon feature layer from a raster " ) )
QObject . connect ( self . polygonize , SIGNAL ( " triggered() " ) , self . doPolygonize )
2011-08-09 10:44:11 +03:00
self . conversionMenu . addAction ( self . polygonize )
2010-06-04 00:31:48 +00:00
2011-08-09 10:44:11 +03:00
self . translate = QAction ( QIcon ( " :/icons/translate.png " ) , QCoreApplication . translate ( " GdalTools " , " Translate (Convert format) " ) , self . iface . mainWindow ( ) )
self . translate . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Converts raster data between different formats " ) )
QObject . connect ( self . translate , SIGNAL ( " triggered() " ) , self . doTranslate )
2011-12-16 14:07:13 +02:00
self . paletted = QAction ( QIcon ( " :icons/24-to-8-bits.png " ) , QCoreApplication . translate ( " GdalTools " , " RGB to PCT " ) , self . iface . mainWindow ( ) )
2011-08-09 10:44:11 +03:00
self . paletted . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Convert a 24bit RGB image to 8bit paletted " ) )
QObject . connect ( self . paletted , SIGNAL ( " triggered() " ) , self . doPaletted )
2011-12-16 14:07:13 +02:00
self . rgb = QAction ( QIcon ( " :icons/8-to-24-bits.png " ) , QCoreApplication . translate ( " GdalTools " , " PCT to RGB " ) , self . iface . mainWindow ( ) )
2011-08-09 10:44:11 +03:00
self . rgb . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Convert an 8bit paletted image to 24bit RGB " ) )
QObject . connect ( self . rgb , SIGNAL ( " triggered() " ) , self . doRGB )
self . conversionMenu . addActions ( [ self . translate , self . paletted , self . rgb ] )
# extraction menu (Clipper, Contour)
2012-01-26 00:54:56 +01:00
self . extractionMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Extraction " ) , self . iface . mainWindow ( ) )
2011-08-09 10:44:11 +03:00
if self . GdalVersion > = " 1.6 " :
self . contour = QAction ( QIcon ( " :/icons/contour.png " ) , QCoreApplication . translate ( " GdalTools " , " Contour " ) , self . iface . mainWindow ( ) )
self . contour . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Builds vector contour lines from a DEM " ) )
QObject . connect ( self . contour , SIGNAL ( " triggered() " ) , self . doContour )
self . extractionMenu . addAction ( self . contour )
self . clipper = QAction ( QIcon ( " :icons/raster-clip.png " ) , QCoreApplication . translate ( " GdalTools " , " Clipper " ) , self . iface . mainWindow ( ) )
#self.clipper.setStatusTip( QCoreApplication.translate( "GdalTools", "Converts raster data between different formats") )
QObject . connect ( self . clipper , SIGNAL ( " triggered() " ) , self . doClipper )
self . extractionMenu . addActions ( [ self . clipper ] )
# analysis menu (DEM (Terrain model), Grid (Interpolation), Near black, Proximity (Raster distance), Sieve)
2012-01-26 00:54:56 +01:00
self . analysisMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Analysis " ) , self . iface . mainWindow ( ) )
2010-06-04 00:31:48 +00:00
if self . GdalVersion > = " 1.6 " :
self . sieve = QAction ( QIcon ( " :/icons/sieve.png " ) , QCoreApplication . translate ( " GdalTools " , " Sieve " ) , self . iface . mainWindow ( ) )
self . sieve . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Removes small raster polygons " ) )
QObject . connect ( self . sieve , SIGNAL ( " triggered() " ) , self . doSieve )
2011-08-09 10:44:11 +03:00
self . analysisMenu . addAction ( self . sieve )
2010-06-04 00:31:48 +00:00
if self . GdalVersion > = " 1.5 " :
self . nearBlack = QAction ( QIcon ( " :/icons/nearblack.png " ) , QCoreApplication . translate ( " GdalTools " , " Near black " ) , self . iface . mainWindow ( ) )
self . nearBlack . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Convert nearly black/white borders to exact value " ) )
QObject . connect ( self . nearBlack , SIGNAL ( " triggered() " ) , self . doNearBlack )
2011-08-09 10:44:11 +03:00
self . analysisMenu . addAction ( self . nearBlack )
2010-06-04 00:31:48 +00:00
2011-11-13 12:22:11 +02:00
if self . GdalVersion > = " 1.7 " :
self . fillNodata = QAction ( QIcon ( " :/icons/fillnodata.png " ) , QCoreApplication . translate ( " GdalTools " , " Fill nodata " ) , self . iface . mainWindow ( ) )
self . fillNodata . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Fill raster regions by interpolation from edges " ) )
QObject . connect ( self . fillNodata , SIGNAL ( " triggered() " ) , self . doFillNodata )
self . analysisMenu . addAction ( self . fillNodata )
2011-08-09 19:22:28 +03:00
if self . GdalVersion > = " 1.6 " :
self . proximity = QAction ( QIcon ( " :/icons/proximity.png " ) , QCoreApplication . translate ( " GdalTools " , " Proximity (Raster distance) " ) , self . iface . mainWindow ( ) )
self . proximity . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Produces a raster proximity map " ) )
QObject . connect ( self . proximity , SIGNAL ( " triggered() " ) , self . doProximity )
self . analysisMenu . addAction ( self . proximity )
2010-06-04 00:31:48 +00:00
if self . GdalVersion > = " 1.5 " :
2011-03-18 15:22:22 +00:00
self . grid = QAction ( QIcon ( " :/icons/grid.png " ) , QCoreApplication . translate ( " GdalTools " , " Grid (Interpolation) " ) , self . iface . mainWindow ( ) )
2010-06-04 00:31:48 +00:00
self . grid . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Create raster from the scattered data " ) )
QObject . connect ( self . grid , SIGNAL ( " triggered() " ) , self . doGrid )
2011-08-09 10:44:11 +03:00
self . analysisMenu . addAction ( self . grid )
2010-06-04 00:31:48 +00:00
2011-08-09 10:44:11 +03:00
if self . GdalVersion > = " 1.7 " :
self . dem = QAction ( QIcon ( " :icons/dem.png " ) , QCoreApplication . translate ( " GdalTools " , " DEM (Terrain models) " ) , self . iface . mainWindow ( ) )
self . dem . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Tool to analyze and visualize DEMs " ) )
QObject . connect ( self . dem , SIGNAL ( " triggered() " ) , self . doDEM )
self . analysisMenu . addAction ( self . dem )
#self.analysisMenu.addActions( [ ] )
# miscellaneous menu (Build overviews (Pyramids), Tile index, Information, Merge, Build Virtual Raster (Catalog))
2012-01-26 00:54:56 +01:00
self . miscellaneousMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Miscellaneous " ) , self . iface . mainWindow ( ) )
2011-08-09 10:44:11 +03:00
if self . GdalVersion > = " 1.6 " :
self . buildVRT = QAction ( QIcon ( " :/icons/vrt.png " ) , QCoreApplication . translate ( " GdalTools " , " Build Virtual Raster (Catalog) " ) , self . iface . mainWindow ( ) )
self . buildVRT . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Builds a VRT from a list of datasets " ) )
QObject . connect ( self . buildVRT , SIGNAL ( " triggered() " ) , self . doBuildVRT )
self . miscellaneousMenu . addAction ( self . buildVRT )
self . merge = QAction ( QIcon ( " :/icons/merge.png " ) , QCoreApplication . translate ( " GdalTools " , " Merge " ) , self . iface . mainWindow ( ) )
self . merge . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Build a quick mosaic from a set of images " ) )
QObject . connect ( self . merge , SIGNAL ( " triggered() " ) , self . doMerge )
2010-06-04 00:31:48 +00:00
self . info = QAction ( QIcon ( " :/icons/raster-info.png " ) , QCoreApplication . translate ( " GdalTools " , " Information " ) , self . iface . mainWindow ( ) )
self . info . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Lists information about raster dataset " ) )
QObject . connect ( self . info , SIGNAL ( " triggered() " ) , self . doInfo )
2011-03-18 15:22:22 +00:00
self . overview = QAction ( QIcon ( " :icons/raster-overview.png " ) , QCoreApplication . translate ( " GdalTools " , " Build overviews (Pyramids) " ) , self . iface . mainWindow ( ) )
2010-06-04 00:31:48 +00:00
self . overview . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Builds or rebuilds overview images " ) )
QObject . connect ( self . overview , SIGNAL ( " triggered() " ) , self . doOverview )
2012-04-26 09:32:37 +03:00
self . tileindex = QAction ( QIcon ( " :icons/tiles.png " ) , QCoreApplication . translate ( " GdalTools " , " Tile index " ) , self . iface . mainWindow ( ) )
2011-03-15 11:40:45 +00:00
self . tileindex . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Build a shapefile as a raster tileindex " ) )
2011-02-08 00:09:24 +00:00
QObject . connect ( self . tileindex , SIGNAL ( " triggered() " ) , self . doTileIndex )
2011-08-09 10:44:11 +03:00
self . miscellaneousMenu . addActions ( [ self . merge , self . info , self . overview , self . tileindex ] )
self . menu . addMenu ( self . projectionsMenu )
self . menu . addMenu ( self . conversionMenu )
self . menu . addMenu ( self . extractionMenu )
if not self . analysisMenu . isEmpty ( ) :
self . menu . addMenu ( self . analysisMenu )
self . menu . addMenu ( self . miscellaneousMenu )
2011-03-15 11:40:45 +00:00
2010-06-04 00:31:48 +00:00
self . settings = QAction ( QCoreApplication . translate ( " GdalTools " , " GdalTools settings " ) , self . iface . mainWindow ( ) )
self . settings . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Various settings for Gdal Tools " ) )
QObject . connect ( self . settings , SIGNAL ( " triggered() " ) , self . doSettings )
self . menu . addAction ( self . settings )
def unload ( self ) :
2012-04-15 13:22:35 +02:00
if not valid : return
2010-06-04 00:31:48 +00:00
pass
def doBuildVRT ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doBuildVRT import GdalToolsDialog as BuildVRT
d = BuildVRT ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doContour ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doContour import GdalToolsDialog as Contour
d = Contour ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doRasterize ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doRasterize import GdalToolsDialog as Rasterize
d = Rasterize ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doPolygonize ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doPolygonize import GdalToolsDialog as Polygonize
d = Polygonize ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doMerge ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doMerge import GdalToolsDialog as Merge
d = Merge ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doSieve ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doSieve import GdalToolsDialog as Sieve
d = Sieve ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doProximity ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doProximity import GdalToolsDialog as Proximity
d = Proximity ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doNearBlack ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doNearBlack import GdalToolsDialog as NearBlack
d = NearBlack ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2011-11-13 12:22:11 +02:00
def doFillNodata ( self ) :
from tools . doFillNodata import GdalToolsDialog as FillNodata
d = FillNodata ( self . iface )
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doWarp ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doWarp import GdalToolsDialog as Warp
d = Warp ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doGrid ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doGrid import GdalToolsDialog as Grid
d = Grid ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doTranslate ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doTranslate import GdalToolsDialog as Translate
d = Translate ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doInfo ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doInfo import GdalToolsDialog as Info
d = Info ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doProjection ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doProjection import GdalToolsDialog as Projection
d = Projection ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doOverview ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doOverview import GdalToolsDialog as Overview
d = Overview ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doClipper ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doClipper import GdalToolsDialog as Clipper
d = Clipper ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doPaletted ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doRgbPct import GdalToolsDialog as RgbPct
d = RgbPct ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
def doRGB ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doPctRgb import GdalToolsDialog as PctRgb
d = PctRgb ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2010-06-04 00:31:48 +00:00
2011-02-08 00:09:24 +00:00
def doTileIndex ( self ) :
from tools . doTileIndex import GdalToolsDialog as TileIndex
d = TileIndex ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
2011-02-08 00:09:24 +00:00
2011-08-09 11:21:13 +03:00
def doExtractProj ( self ) :
from tools . doExtractProj import GdalToolsDialog as ExtractProj
d = ExtractProj ( self . iface )
d . exec_ ( )
2011-03-15 11:40:45 +00:00
def doDEM ( self ) :
from tools . doDEM import GdalToolsDialog as DEM
d = DEM ( self . iface )
2011-03-21 23:54:27 +00:00
self . runToolDialog ( d )
def runToolDialog ( self , dlg ) :
dlg . show_ ( )
dlg . exec_ ( )
del dlg
2011-03-15 11:40:45 +00:00
2010-06-04 00:31:48 +00:00
def doSettings ( self ) :
2010-06-10 15:38:52 +00:00
from tools . doSettings import GdalToolsSettingsDialog as Settings
d = Settings ( self . iface )
2010-06-04 00:31:48 +00:00
d . exec_ ( )