Skip to content

Commit

Permalink
[processing] add icons for fTools and GDALTools algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Mar 1, 2016
1 parent 9b9c692 commit 11a9a66
Show file tree
Hide file tree
Showing 133 changed files with 657 additions and 29 deletions.
9 changes: 9 additions & 0 deletions python/plugins/processing/algs/gdal/ClipByExtent.py
Expand Up @@ -25,6 +25,10 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm

from processing.core.parameters import ParameterRaster
Expand All @@ -37,6 +41,8 @@

from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class ClipByExtent(GdalAlgorithm):

Expand All @@ -57,6 +63,9 @@ class ClipByExtent(GdalAlgorithm):
COMPRESSTYPE = ['NONE', 'JPEG', 'LZW', 'PACKBITS', 'DEFLATE']
TFW = 'TFW'

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Clip raster by extent')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')
Expand Down
9 changes: 9 additions & 0 deletions python/plugins/processing/algs/gdal/ClipByMask.py
Expand Up @@ -25,6 +25,10 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from osgeo import gdal

from processing.core.parameters import ParameterRaster
Expand All @@ -42,6 +46,8 @@
from processing.tools import dataobjects
from processing.tools.vector import ogrConnectionString

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class ClipByMask(GdalAlgorithm):

Expand All @@ -65,6 +71,9 @@ class ClipByMask(GdalAlgorithm):
COMPRESSTYPE = ['NONE', 'JPEG', 'LZW', 'PACKBITS', 'DEFLATE']
TFW = 'TFW'

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Clip raster by mask layer')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')
Expand Down
7 changes: 7 additions & 0 deletions python/plugins/processing/algs/gdal/GridAverage.py
Expand Up @@ -27,6 +27,8 @@

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterTableField
Expand All @@ -35,6 +37,8 @@
from processing.core.outputs import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class GridAverage(GdalAlgorithm):

Expand All @@ -50,6 +54,9 @@ class GridAverage(GdalAlgorithm):

TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
return "gdalogr:gridaverage"

Expand Down
7 changes: 7 additions & 0 deletions python/plugins/processing/algs/gdal/GridDataMetrics.py
Expand Up @@ -27,6 +27,8 @@

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterTableField
Expand All @@ -35,6 +37,8 @@
from processing.core.outputs import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class GridDataMetrics(GdalAlgorithm):

Expand All @@ -54,6 +58,9 @@ class GridDataMetrics(GdalAlgorithm):
DATA_METRICS = ['Minimum', 'Maximum', 'Range', 'Count', 'Average distance',
'Average distance between points']

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
return "gdalogr:griddatametrics"

Expand Down
7 changes: 7 additions & 0 deletions python/plugins/processing/algs/gdal/GridInvDist.py
Expand Up @@ -28,6 +28,8 @@

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterTableField
Expand All @@ -36,6 +38,8 @@
from processing.core.outputs import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class GridInvDist(GdalAlgorithm):

Expand All @@ -54,6 +58,9 @@ class GridInvDist(GdalAlgorithm):

TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
return "gdalogr:gridinvdist"

Expand Down
7 changes: 7 additions & 0 deletions python/plugins/processing/algs/gdal/GridNearest.py
Expand Up @@ -28,6 +28,8 @@

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterTableField
Expand All @@ -36,6 +38,8 @@
from processing.core.outputs import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class GridNearest(GdalAlgorithm):

Expand All @@ -50,6 +54,9 @@ class GridNearest(GdalAlgorithm):

TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
return "gdalogr:gridnearestneighbor"

Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/gdal/aspect.py
Expand Up @@ -25,6 +25,9 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.parameters import ParameterRaster
Expand All @@ -33,6 +36,8 @@
from processing.core.outputs import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class aspect(GdalAlgorithm):

Expand All @@ -45,8 +50,7 @@ class aspect(GdalAlgorithm):
OUTPUT = 'OUTPUT'

#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
# return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'dem.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Aspect')
Expand Down
8 changes: 7 additions & 1 deletion python/plugins/processing/algs/gdal/buildvrt.py
Expand Up @@ -25,6 +25,9 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.outputs import OutputRaster
Expand All @@ -34,7 +37,7 @@
from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import tempFolder

import os
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class buildvrt(GdalAlgorithm):
Expand All @@ -47,6 +50,9 @@ class buildvrt(GdalAlgorithm):

RESOLUTION_OPTIONS = ['average', 'highest', 'lowest']

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'vrt.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Build Virtual Raster')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
Expand Down
9 changes: 9 additions & 0 deletions python/plugins/processing/algs/gdal/contour.py
Expand Up @@ -25,6 +25,10 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm

from processing.core.parameters import ParameterRaster
Expand All @@ -35,6 +39,8 @@

from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class contour(GdalAlgorithm):

Expand All @@ -44,6 +50,9 @@ class contour(GdalAlgorithm):
FIELD_NAME = 'FIELD_NAME'
EXTRA = 'EXTRA'

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'contour.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Contour')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')
Expand Down
7 changes: 7 additions & 0 deletions python/plugins/processing/algs/gdal/extractprojection.py
Expand Up @@ -27,18 +27,25 @@

import os

from PyQt4.QtGui import QIcon

from osgeo import gdal, osr

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.parameters import ParameterRaster
from processing.core.parameters import ParameterBoolean

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class ExtractProjection(GdalAlgorithm):

INPUT = 'INPUT'
PRJ_FILE = 'PRJ_FILE'

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-export.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Extract projection')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Projections')
Expand Down
8 changes: 8 additions & 0 deletions python/plugins/processing/algs/gdal/fillnodata.py
Expand Up @@ -25,6 +25,9 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm

Expand All @@ -37,6 +40,8 @@

from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class fillnodata(GdalAlgorithm):

Expand All @@ -48,6 +53,9 @@ class fillnodata(GdalAlgorithm):
NO_DEFAULT_MASK = 'NO_DEFAULT_MASK'
OUTPUT = 'OUTPUT'

#def getIcon(self):
# return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'fillnodata.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Fill nodata')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
Expand Down
9 changes: 9 additions & 0 deletions python/plugins/processing/algs/gdal/gdaladdo.py
Expand Up @@ -25,6 +25,10 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.parameters import ParameterRaster
from processing.core.parameters import ParameterBoolean
Expand All @@ -34,6 +38,8 @@

from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class gdaladdo(GdalAlgorithm):

Expand All @@ -57,6 +63,9 @@ class gdaladdo(GdalAlgorithm):
FORMATS = ['Internal (if possible)', 'External (GTiff .ovr)',
'External (ERDAS Imagine .aux)']

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-overview.png'))

def commandLineName(self):
return "gdalogr:overviews"

Expand Down
8 changes: 7 additions & 1 deletion python/plugins/processing/algs/gdal/gdaltindex.py
Expand Up @@ -25,6 +25,9 @@

__revision__ = '$Format:%H$'

import os

from PyQt4.QtGui import QIcon

from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.core.outputs import OutputVector
Expand All @@ -33,7 +36,7 @@
from processing.core.parameters import ParameterString
from processing.algs.gdal.GdalUtils import GdalUtils

import os
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


class gdaltindex(GdalAlgorithm):
Expand All @@ -43,6 +46,9 @@ class gdaltindex(GdalAlgorithm):
FIELD_NAME = 'FIELD_NAME'
PROJ_DIFFERENCE = 'PROJ_DIFFERENCE'

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'tiles.png'))

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Tile Index')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
Expand Down

0 comments on commit 11a9a66

Please sign in to comment.