2016-02-29 15:32:02 +02:00
# -*- coding: utf-8 -*-
"""
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Name : GdalTools
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
2016-04-22 10:38:48 +02:00
from qgis . PyQt . QtCore import QCoreApplication , QSettings , QLocale , QFileInfo , QTranslator
from qgis . PyQt . QtWidgets import QMessageBox , QMenu , QAction
from qgis . PyQt . QtGui import QIcon
2016-02-29 15:32:02 +02:00
from qgis . core import QGis
import qgis . utils
# are all dependencies satisfied?
valid = True
# Import required modules
req_mods = { " osgeo " : " osgeo [python-gdal] " }
try :
2016-03-21 04:54:20 +01:00
from osgeo import gdal # NOQA
from osgeo import ogr # NOQA
2016-02-29 15:32:02 +02:00
except ImportError as e :
valid = False
# if the plugin is shipped with QGis catch the exception and
# display an error message
import os . path
qgisUserPluginPath = qgis . utils . home_plugin_path
if not os . path . dirname ( __file__ ) . startswith ( qgisUserPluginPath ) :
title = QCoreApplication . translate ( " GdalTools " , " Plugin error " )
message = QCoreApplication . translate ( " GdalTools " , u ' Unable to load {0} plugin. \n The required " {1} " module is missing. \n Install it and try again. ' )
import qgis . utils
QMessageBox . warning ( qgis . utils . iface . mainWindow ( ) , title , message . format ( " GdalTools " , 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 error_mod in req_mods :
error_str = error_str . replace ( error_mod , req_mods [ error_mod ] )
raise ImportError ( error_str )
class GdalTools :
def __init__ ( self , iface ) :
if not valid :
return
# Save reference to the QGIS interface
self . iface = iface
try :
self . QgisVersion = unicode ( QGis . QGIS_VERSION_INT )
except :
self . QgisVersion = unicode ( QGis . qgisVersion ) [ 0 ]
if QGis . QGIS_VERSION [ 0 : 3 ] < " 1.5 " :
# For i18n support
userPluginPath = qgis . utils . home_plugin_path + " /GdalTools "
systemPluginPath = qgis . utils . sys_plugin_path + " /GdalTools "
overrideLocale = QSettings ( ) . value ( " locale/overrideFlag " , False , type = bool )
if not overrideLocale :
localeFullName = QLocale . system ( ) . name ( )
else :
localeFullName = QSettings ( ) . value ( " locale/userLocale " , " " , type = str )
if QFileInfo ( userPluginPath ) . exists ( ) :
translationPath = userPluginPath + " /i18n/GdalTools_ " + localeFullName + " .qm "
else :
translationPath = systemPluginPath + " /i18n/GdalTools_ " + localeFullName + " .qm "
self . localePath = translationPath
if QFileInfo ( self . localePath ) . exists ( ) :
self . translator = QTranslator ( )
self . translator . load ( self . localePath )
QCoreApplication . installTranslator ( self . translator )
# The list of actions added to menus, so we can remove them when unloading the plugin
self . _menuActions = [ ]
def initGui ( self ) :
if not valid :
return
if int ( self . QgisVersion ) < 1 :
QMessageBox . warning (
self . iface . getMainWindow ( ) , " Gdal Tools " ,
QCoreApplication . translate ( " GdalTools " , " QGIS 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
2016-03-21 04:54:20 +01:00
from . tools . GdalTools_utils import GdalConfig , LayerRegistry
2016-02-29 15:32:02 +02:00
self . GdalVersionNum = GdalConfig . versionNum ( )
LayerRegistry . setIface ( self . iface )
# 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 :
if a . menu ( ) is not None and a . menu ( ) . title ( ) == rasterText :
rasterMenu = a . menu ( )
break
if rasterMenu is None :
# no Raster menu, create and insert it before the Help menu
self . menu = QMenu ( rasterText , self . iface . mainWindow ( ) )
lastAction = actions [ len ( actions ) - 1 ]
menu_bar . insertMenu ( lastAction , self . menu )
else :
self . menu = rasterMenu
self . _menuActions . append ( self . menu . addSeparator ( ) )
# projections menu (Warp (Reproject), Assign projection)
self . projectionsMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Projections " ) , self . iface . mainWindow ( ) )
self . projectionsMenu . setObjectName ( " projectionsMenu " )
self . warp = QAction ( QIcon ( " :/icons/warp.png " ) , QCoreApplication . translate ( " GdalTools " , " Warp (Reproject)... " ) , self . iface . mainWindow ( ) )
self . warp . setObjectName ( " warp " )
self . warp . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Warp an image into a new coordinate system " ) )
2016-03-21 04:54:20 +01:00
self . warp . triggered . connect ( self . doWarp )
2016-02-29 15:32:02 +02:00
self . projection = QAction ( QIcon ( " :icons/projection-add.png " ) , QCoreApplication . translate ( " GdalTools " , " Assign Projection... " ) , self . iface . mainWindow ( ) )
self . projection . setObjectName ( " projection " )
self . projection . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Add projection info to the raster " ) )
2016-03-21 04:54:20 +01:00
self . projection . triggered . connect ( self . doProjection )
2016-02-29 15:32:02 +02:00
self . extractProj = QAction ( QIcon ( " :icons/projection-export.png " ) , QCoreApplication . translate ( " GdalTools " , " Extract Projection... " ) , self . iface . mainWindow ( ) )
self . extractProj . setObjectName ( " extractProj " )
self . extractProj . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Extract projection information from raster(s) " ) )
2016-03-21 04:54:20 +01:00
self . extractProj . triggered . connect ( self . doExtractProj )
2016-02-29 15:32:02 +02:00
self . projectionsMenu . addActions ( [ self . warp , self . projection , self . extractProj ] )
# conversion menu (Rasterize (Vector to raster), Polygonize (Raster to vector), Translate, RGB to PCT, PCT to RGB)
self . conversionMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Conversion " ) , self . iface . mainWindow ( ) )
self . conversionMenu . setObjectName ( " conversionMenu " )
if self . GdalVersionNum > = 1300 :
self . rasterize = QAction ( QIcon ( " :/icons/rasterize.png " ) , QCoreApplication . translate ( " GdalTools " , " Rasterize (Vector to Raster)... " ) , self . iface . mainWindow ( ) )
self . rasterize . setObjectName ( " rasterize " )
self . rasterize . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Burns vector geometries into a raster " ) )
2016-03-21 04:54:20 +01:00
self . rasterize . triggered . connect ( self . doRasterize )
2016-02-29 15:32:02 +02:00
self . conversionMenu . addAction ( self . rasterize )
if self . GdalVersionNum > = 1600 :
self . polygonize = QAction ( QIcon ( " :/icons/polygonize.png " ) , QCoreApplication . translate ( " GdalTools " , " Polygonize (Raster to Vector)... " ) , self . iface . mainWindow ( ) )
self . polygonize . setObjectName ( " polygonize " )
self . polygonize . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Produces a polygon feature layer from a raster " ) )
2016-03-21 04:54:20 +01:00
self . polygonize . triggered . connect ( self . doPolygonize )
2016-02-29 15:32:02 +02:00
self . conversionMenu . addAction ( self . polygonize )
self . translate = QAction ( QIcon ( " :/icons/translate.png " ) , QCoreApplication . translate ( " GdalTools " , " Translate (Convert Format)... " ) , self . iface . mainWindow ( ) )
self . translate . setObjectName ( " translate " )
self . translate . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Converts raster data between different formats " ) )
2016-03-21 04:54:20 +01:00
self . translate . triggered . connect ( self . doTranslate )
2016-02-29 15:32:02 +02:00
self . paletted = QAction ( QIcon ( " :icons/24-to-8-bits.png " ) , QCoreApplication . translate ( " GdalTools " , " RGB to PCT... " ) , self . iface . mainWindow ( ) )
self . paletted . setObjectName ( " paletted " )
self . paletted . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Convert a 24bit RGB image to 8bit paletted " ) )
2016-03-21 04:54:20 +01:00
self . paletted . triggered . connect ( self . doPaletted )
2016-02-29 15:32:02 +02:00
self . rgb = QAction ( QIcon ( " :icons/8-to-24-bits.png " ) , QCoreApplication . translate ( " GdalTools " , " PCT to RGB... " ) , self . iface . mainWindow ( ) )
self . rgb . setObjectName ( " rgb " )
self . rgb . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Convert an 8bit paletted image to 24bit RGB " ) )
2016-03-21 04:54:20 +01:00
self . rgb . triggered . connect ( self . doRGB )
2016-02-29 15:32:02 +02:00
self . conversionMenu . addActions ( [ self . translate , self . paletted , self . rgb ] )
# extraction menu (Clipper, Contour)
self . extractionMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Extraction " ) , self . iface . mainWindow ( ) )
self . extractionMenu . setObjectName ( " extractionMenu " )
if self . GdalVersionNum > = 1600 :
self . contour = QAction ( QIcon ( " :/icons/contour.png " ) , QCoreApplication . translate ( " GdalTools " , " Contour... " ) , self . iface . mainWindow ( ) )
self . contour . setObjectName ( " contour " )
self . contour . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Builds vector contour lines from a DEM " ) )
2016-03-21 04:54:20 +01:00
self . contour . triggered . connect ( self . doContour )
2016-02-29 15:32:02 +02:00
self . extractionMenu . addAction ( self . contour )
self . clipper = QAction ( QIcon ( " :icons/raster-clip.png " ) , QCoreApplication . translate ( " GdalTools " , " Clipper... " ) , self . iface . mainWindow ( ) )
self . clipper . setObjectName ( " clipper " )
#self.clipper.setStatusTip( QCoreApplication.translate( "GdalTools", "Converts raster data between different formats") )
2016-03-21 04:54:20 +01:00
self . clipper . triggered . connect ( self . doClipper )
2016-02-29 15:32:02 +02:00
self . extractionMenu . addActions ( [ self . clipper ] )
# analysis menu (DEM (Terrain model), Grid (Interpolation), Near black, Proximity (Raster distance), Sieve)
self . analysisMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Analysis " ) , self . iface . mainWindow ( ) )
self . analysisMenu . setObjectName ( " analysisMenu " )
if self . GdalVersionNum > = 1600 :
self . sieve = QAction ( QIcon ( " :/icons/sieve.png " ) , QCoreApplication . translate ( " GdalTools " , " Sieve... " ) , self . iface . mainWindow ( ) )
self . sieve . setObjectName ( " sieve " )
self . sieve . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Removes small raster polygons " ) )
2016-03-21 04:54:20 +01:00
self . sieve . triggered . connect ( self . doSieve )
2016-02-29 15:32:02 +02:00
self . analysisMenu . addAction ( self . sieve )
if self . GdalVersionNum > = 1500 :
self . nearBlack = QAction ( QIcon ( " :/icons/nearblack.png " ) , QCoreApplication . translate ( " GdalTools " , " Near Black... " ) , self . iface . mainWindow ( ) )
self . nearBlack . setObjectName ( " nearBlack " )
self . nearBlack . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Convert nearly black/white borders to exact value " ) )
2016-03-21 04:54:20 +01:00
self . nearBlack . triggered . connect ( self . doNearBlack )
2016-02-29 15:32:02 +02:00
self . analysisMenu . addAction ( self . nearBlack )
if self . GdalVersionNum > = 1700 :
self . fillNodata = QAction ( QIcon ( " :/icons/fillnodata.png " ) , QCoreApplication . translate ( " GdalTools " , " Fill nodata... " ) , self . iface . mainWindow ( ) )
self . fillNodata . setObjectName ( " fillNodata " )
self . fillNodata . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Fill raster regions by interpolation from edges " ) )
2016-03-21 04:54:20 +01:00
self . fillNodata . triggered . connect ( self . doFillNodata )
2016-02-29 15:32:02 +02:00
self . analysisMenu . addAction ( self . fillNodata )
if self . GdalVersionNum > = 1600 :
self . proximity = QAction ( QIcon ( " :/icons/proximity.png " ) , QCoreApplication . translate ( " GdalTools " , " Proximity (Raster Distance)... " ) , self . iface . mainWindow ( ) )
self . proximity . setObjectName ( " proximity " )
self . proximity . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Produces a raster proximity map " ) )
2016-03-21 04:54:20 +01:00
self . proximity . triggered . connect ( self . doProximity )
2016-02-29 15:32:02 +02:00
self . analysisMenu . addAction ( self . proximity )
if self . GdalVersionNum > = 1500 :
self . grid = QAction ( QIcon ( " :/icons/grid.png " ) , QCoreApplication . translate ( " GdalTools " , " Grid (Interpolation)... " ) , self . iface . mainWindow ( ) )
self . grid . setObjectName ( " grid " )
self . grid . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Create raster from the scattered data " ) )
2016-03-21 04:54:20 +01:00
self . grid . triggered . connect ( self . doGrid )
2016-02-29 15:32:02 +02:00
self . analysisMenu . addAction ( self . grid )
if self . GdalVersionNum > = 1700 :
self . dem = QAction ( QIcon ( " :icons/dem.png " ) , QCoreApplication . translate ( " GdalTools " , " DEM (Terrain Models)... " ) , self . iface . mainWindow ( ) )
self . dem . setObjectName ( " dem " )
self . dem . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Tool to analyze and visualize DEMs " ) )
2016-03-21 04:54:20 +01:00
self . dem . triggered . connect ( self . doDEM )
2016-02-29 15:32:02 +02:00
self . analysisMenu . addAction ( self . dem )
#self.analysisMenu.addActions( [ ] )
# miscellaneous menu (Build overviews (Pyramids), Tile index, Information, Merge, Build Virtual Raster (Catalog))
self . miscellaneousMenu = QMenu ( QCoreApplication . translate ( " GdalTools " , " Miscellaneous " ) , self . iface . mainWindow ( ) )
self . miscellaneousMenu . setObjectName ( " miscellaneousMenu " )
if self . GdalVersionNum > = 1600 :
self . buildVRT = QAction ( QIcon ( " :/icons/vrt.png " ) , QCoreApplication . translate ( " GdalTools " , " Build Virtual Raster (Catalog)... " ) , self . iface . mainWindow ( ) )
self . buildVRT . setObjectName ( " buildVRT " )
self . buildVRT . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Builds a VRT from a list of datasets " ) )
2016-03-21 04:54:20 +01:00
self . buildVRT . triggered . connect ( self . doBuildVRT )
2016-02-29 15:32:02 +02:00
self . miscellaneousMenu . addAction ( self . buildVRT )
self . merge = QAction ( QIcon ( " :/icons/merge.png " ) , QCoreApplication . translate ( " GdalTools " , " Merge... " ) , self . iface . mainWindow ( ) )
self . merge . setObjectName ( " merge " )
self . merge . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Build a quick mosaic from a set of images " ) )
2016-03-21 04:54:20 +01:00
self . merge . triggered . connect ( self . doMerge )
2016-02-29 15:32:02 +02:00
self . info = QAction ( QIcon ( " :/icons/raster-info.png " ) , QCoreApplication . translate ( " GdalTools " , " Information... " ) , self . iface . mainWindow ( ) )
self . info . setObjectName ( " info " )
self . info . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Lists information about raster dataset " ) )
2016-03-21 04:54:20 +01:00
self . info . triggered . connect ( self . doInfo )
2016-02-29 15:32:02 +02:00
self . overview = QAction ( QIcon ( " :icons/raster-overview.png " ) , QCoreApplication . translate ( " GdalTools " , " Build Overviews (Pyramids)... " ) , self . iface . mainWindow ( ) )
self . overview . setObjectName ( " overview " )
self . overview . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Builds or rebuilds overview images " ) )
2016-03-21 04:54:20 +01:00
self . overview . triggered . connect ( self . doOverview )
2016-02-29 15:32:02 +02:00
self . tileindex = QAction ( QIcon ( " :icons/tiles.png " ) , QCoreApplication . translate ( " GdalTools " , " Tile Index... " ) , self . iface . mainWindow ( ) )
self . tileindex . setObjectName ( " tileindex " )
self . tileindex . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Build a shapefile as a raster tileindex " ) )
2016-03-21 04:54:20 +01:00
self . tileindex . triggered . connect ( self . doTileIndex )
2016-02-29 15:32:02 +02:00
self . miscellaneousMenu . addActions ( [ self . merge , self . info , self . overview , self . tileindex ] )
self . _menuActions . append ( self . menu . addMenu ( self . projectionsMenu ) )
self . _menuActions . append ( self . menu . addMenu ( self . conversionMenu ) )
self . _menuActions . append ( self . menu . addMenu ( self . extractionMenu ) )
if not self . analysisMenu . isEmpty ( ) :
self . _menuActions . append ( self . menu . addMenu ( self . analysisMenu ) )
self . _menuActions . append ( self . menu . addMenu ( self . miscellaneousMenu ) )
self . settings = QAction ( QCoreApplication . translate ( " GdalTools " , " GdalTools Settings... " ) , self . iface . mainWindow ( ) )
self . settings . setObjectName ( " settings " )
self . settings . setStatusTip ( QCoreApplication . translate ( " GdalTools " , " Various settings for Gdal Tools " ) )
2016-03-21 04:54:20 +01:00
self . settings . triggered . connect ( self . doSettings )
2016-02-29 15:32:02 +02:00
self . menu . addAction ( self . settings )
self . _menuActions . append ( self . settings )
def unload ( self ) :
if not valid :
return
for a in self . _menuActions :
self . menu . removeAction ( a )
def doBuildVRT ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doBuildVRT import GdalToolsDialog as BuildVRT
2016-02-29 15:32:02 +02:00
d = BuildVRT ( self . iface )
self . runToolDialog ( d )
def doContour ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doContour import GdalToolsDialog as Contour
2016-02-29 15:32:02 +02:00
d = Contour ( self . iface )
self . runToolDialog ( d )
def doRasterize ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doRasterize import GdalToolsDialog as Rasterize
2016-02-29 15:32:02 +02:00
d = Rasterize ( self . iface )
self . runToolDialog ( d )
def doPolygonize ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doPolygonize import GdalToolsDialog as Polygonize
2016-02-29 15:32:02 +02:00
d = Polygonize ( self . iface )
self . runToolDialog ( d )
def doMerge ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doMerge import GdalToolsDialog as Merge
2016-02-29 15:32:02 +02:00
d = Merge ( self . iface )
self . runToolDialog ( d )
def doSieve ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doSieve import GdalToolsDialog as Sieve
2016-02-29 15:32:02 +02:00
d = Sieve ( self . iface )
self . runToolDialog ( d )
def doProximity ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doProximity import GdalToolsDialog as Proximity
2016-02-29 15:32:02 +02:00
d = Proximity ( self . iface )
self . runToolDialog ( d )
def doNearBlack ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doNearBlack import GdalToolsDialog as NearBlack
2016-02-29 15:32:02 +02:00
d = NearBlack ( self . iface )
self . runToolDialog ( d )
def doFillNodata ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doFillNodata import GdalToolsDialog as FillNodata
2016-02-29 15:32:02 +02:00
d = FillNodata ( self . iface )
self . runToolDialog ( d )
def doWarp ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doWarp import GdalToolsDialog as Warp
2016-02-29 15:32:02 +02:00
d = Warp ( self . iface )
self . runToolDialog ( d )
def doGrid ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doGrid import GdalToolsDialog as Grid
2016-02-29 15:32:02 +02:00
d = Grid ( self . iface )
self . runToolDialog ( d )
def doTranslate ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doTranslate import GdalToolsDialog as Translate
2016-02-29 15:32:02 +02:00
d = Translate ( self . iface )
self . runToolDialog ( d )
def doInfo ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doInfo import GdalToolsDialog as Info
2016-02-29 15:32:02 +02:00
d = Info ( self . iface )
self . runToolDialog ( d )
def doProjection ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doProjection import GdalToolsDialog as Projection
2016-02-29 15:32:02 +02:00
d = Projection ( self . iface )
self . runToolDialog ( d )
def doOverview ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doOverview import GdalToolsDialog as Overview
2016-02-29 15:32:02 +02:00
d = Overview ( self . iface )
self . runToolDialog ( d )
def doClipper ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doClipper import GdalToolsDialog as Clipper
2016-02-29 15:32:02 +02:00
d = Clipper ( self . iface )
self . runToolDialog ( d )
def doPaletted ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doRgbPct import GdalToolsDialog as RgbPct
2016-02-29 15:32:02 +02:00
d = RgbPct ( self . iface )
self . runToolDialog ( d )
def doRGB ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doPctRgb import GdalToolsDialog as PctRgb
2016-02-29 15:32:02 +02:00
d = PctRgb ( self . iface )
self . runToolDialog ( d )
def doTileIndex ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doTileIndex import GdalToolsDialog as TileIndex
2016-02-29 15:32:02 +02:00
d = TileIndex ( self . iface )
self . runToolDialog ( d )
def doExtractProj ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doExtractProj import GdalToolsDialog as ExtractProj
2016-02-29 15:32:02 +02:00
d = ExtractProj ( self . iface )
d . exec_ ( )
def doDEM ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doDEM import GdalToolsDialog as DEM
2016-02-29 15:32:02 +02:00
d = DEM ( self . iface )
self . runToolDialog ( d )
def runToolDialog ( self , dlg ) :
dlg . show_ ( )
dlg . exec_ ( )
del dlg
def doSettings ( self ) :
2016-03-21 04:54:20 +01:00
from . tools . doSettings import GdalToolsSettingsDialog as Settings
2016-02-29 15:32:02 +02:00
d = Settings ( self . iface )
d . exec_ ( )