[processing] all gdal algs now have the same icon

Did some code cleaning in gdal package
This commit is contained in:
Victor Olaya 2014-06-02 00:35:49 +02:00
parent 45c0be1059
commit 4eab185528
54 changed files with 75 additions and 234 deletions

View File

@ -1,8 +1,5 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB ICON_FILES icons/*.png)
ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(pyogr)
PLUGIN_INSTALL(processing ./algs/gdal ${PY_FILES})
PLUGIN_INSTALL(processing ./algs/gdal/icons ${ICON_FILES})
PLUGIN_INSTALL(processing ./algs/gdal ${PY_FILES})

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtGui
from qgis.core import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterExtent import ParameterExtent
@ -39,7 +39,7 @@ from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class ClipByExtent(GeoAlgorithm):
class ClipByExtent(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
@ -47,10 +47,6 @@ class ClipByExtent(GeoAlgorithm):
PROJWIN = 'PROJWIN'
EXTRA = 'EXTRA'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/raster-clip.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Clip raster by extent'
self.group = '[GDAL] Extraction'

View File

@ -30,7 +30,7 @@ from PyQt4 import QtGui
from osgeo import gdal
from qgis.core import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterVector import ParameterVector
@ -42,7 +42,7 @@ from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class ClipByMask(GeoAlgorithm):
class ClipByMask(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
@ -52,10 +52,6 @@ class ClipByMask(GeoAlgorithm):
KEEP_RESOLUTION = 'KEEP_RESOLUTION'
EXTRA = 'EXTRA'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/raster-clip.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Clip raster by mask layer'
self.group = '[GDAL] Extraction'

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -39,7 +39,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class ColorRelief(GeoAlgorithm):
class ColorRelief(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'

View File

@ -28,14 +28,15 @@ __revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.script.ScriptAlgorithm import ScriptAlgorithm
from processing.core.GeoAlgorithm import GeoAlgorithm
class GdalAlgorithm(ScriptAlgorithm):
"""Just a ScriptAlgorithm that automatically takes its icon
filename for the script filename.
"""
class GdalAlgorithm(GeoAlgorithm):
def getIcon(self):
filename = os.path.basename(self.descriptionFile[:-2] + 'png')
filepath = os.path.dirname(__file__) + '/icons/' + filename
return QtGui.QIcon(filepath)
return QtGui.QIcon(os.path.dirname(__file__) + '/../../images/gdal.png')
class GdalScriptAlgorithm(ScriptAlgorithm):
def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + '/../../images/gdal.png')

View File

@ -32,8 +32,7 @@ from PyQt4.QtGui import *
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.core.ProcessingLog import ProcessingLog
from processing.script.WrongScriptException import WrongScriptException
from GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalScriptAlgorithm
from GdalUtils import GdalUtils
from nearblack import nearblack
@ -103,7 +102,7 @@ class GdalOgrAlgorithmProvider(AlgorithmProvider):
return 'gdalogr'
def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/icons/gdalicon.png')
return QIcon(os.path.dirname(__file__) + '/../../images/gdal.png')
def _loadAlgorithms(self):
self.algs = self.preloadedAlgs
@ -131,7 +130,7 @@ class GdalOgrAlgorithmProvider(AlgorithmProvider):
try:
fullpath = os.path.join(self.scriptsFolder(),
descriptionFile)
alg = GdalAlgorithm(fullpath)
alg = GdalScriptAlgorithm(fullpath)
self.preloadedAlgs.append(alg)
except WrongScriptException, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterVector import ParameterVector
from processing.parameters.ParameterTableField import ParameterTableField
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,7 +37,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class GridAverage(GeoAlgorithm):
class GridAverage(GdalAlgorithm):
INPUT = 'INPUT'
Z_FIELD = 'Z_FIELD'
@ -48,10 +48,6 @@ class GridAverage(GeoAlgorithm):
NODATA = 'NODATA'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Grid (Moving average)'
self.group = '[GDAL] Analysis'

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterVector import ParameterVector
from processing.parameters.ParameterTableField import ParameterTableField
from processing.parameters.ParameterSelection import ParameterSelection
@ -38,7 +38,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class GridDataMetrics(GeoAlgorithm):
class GridDataMetrics(GdalAlgorithm):
INPUT = 'INPUT'
Z_FIELD = 'Z_FIELD'
@ -53,10 +53,6 @@ class GridDataMetrics(GeoAlgorithm):
DATA_METRICS = ['Minimum', 'Maximum', 'Range', 'Count', 'Average distance',
'Average distance between points']
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Grid (Data metrics)'
self.group = '[GDAL] Analysis'

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterVector import ParameterVector
from processing.parameters.ParameterTableField import ParameterTableField
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,7 +37,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class GridInvDist(GeoAlgorithm):
class GridInvDist(GdalAlgorithm):
INPUT = 'INPUT'
Z_FIELD = 'Z_FIELD'
@ -51,10 +51,6 @@ class GridInvDist(GeoAlgorithm):
NODATA = 'NODATA'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Grid (Inverse distance to a power)'
self.group = '[GDAL] Analysis'

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterVector import ParameterVector
from processing.parameters.ParameterTableField import ParameterTableField
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,7 +37,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class GridNearest(GeoAlgorithm):
class GridNearest(GdalAlgorithm):
INPUT = 'INPUT'
Z_FIELD = 'Z_FIELD'
@ -47,10 +47,6 @@ class GridNearest(GeoAlgorithm):
NODATA = 'NODATA'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Grid (Nearest neighbor)'
self.group = '[GDAL] Analysis'

View File

@ -38,11 +38,11 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.tools import dataobjects
class OgrAlgorithm(GeoAlgorithm):
class OgrAlgorithm(GdalAlgorithm):
DB = 'DB'

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,7 +37,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class aspect(GeoAlgorithm):
class aspect(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtGui
from qgis.core import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterNumber import ParameterNumber
@ -40,7 +40,7 @@ from processing.outputs.OutputVector import OutputVector
from processing.algs.gdal.GdalUtils import GdalUtils
class contour(GeoAlgorithm):
class contour(GdalAlgorithm):
INPUT_RASTER = 'INPUT_RASTER'
OUTPUT_VECTOR = 'OUTPUT_VECTOR'
@ -48,10 +48,6 @@ class contour(GeoAlgorithm):
FIELD_NAME = 'FIELD_NAME'
EXTRA = 'EXTRA'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/contour.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Contour'
self.group = '[GDAL] Extraction'

View File

@ -30,20 +30,16 @@ import os
from osgeo import gdal, osr
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
class ExtractProjection(GeoAlgorithm):
class ExtractProjection(GdalAlgorithm):
INPUT = 'INPUT'
PRJ_FILE = 'PRJ_FILE'
def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/icons/projection-export.png'
)
def defineCharacteristics(self):
self.name = 'Extract projection'
self.group = '[GDAL] Projections'

View File

@ -25,10 +25,8 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui, QtCore
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterNumber import ParameterNumber
@ -40,7 +38,7 @@ from processing.tools.system import *
from processing.algs.gdal.GdalUtils import GdalUtils
class fillnodata(GeoAlgorithm):
class fillnodata(GdalAlgorithm):
INPUT = 'INPUT'
DISTANCE = 'DISTANCE'
@ -50,10 +48,6 @@ class fillnodata(GeoAlgorithm):
NO_DEFAULT_MASK = 'NO_DEFAULT_MASK'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/fillnodata.png'
# return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Fill nodata'
self.group = '[GDAL] Analysis'

View File

@ -25,11 +25,10 @@ __copyright__ = '(C) 2013, Alexander Bruy'
__revision__ = '$Format:%H$'
import os
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterNumber import ParameterNumber
@ -40,15 +39,12 @@ from processing.tools.system import *
from processing.algs.gdal.GdalUtils import GdalUtils
class gdal2xyz(GeoAlgorithm):
class gdal2xyz(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# return QIcon(os.path.dirname(__file__) + "/icons/gdal2xyz.png")
def defineCharacteristics(self):
self.name = 'gdal2xyz'
self.group = '[GDAL] Conversion'

View File

@ -25,11 +25,7 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterSelection import ParameterSelection
@ -39,7 +35,7 @@ from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class gdaladdo(GeoAlgorithm):
class gdaladdo(GdalAlgorithm):
INPUT = 'INPUT'
LEVELS = 'LEVELS'
@ -61,10 +57,6 @@ class gdaladdo(GeoAlgorithm):
FORMATS = ['Internal (if possible)', 'External (GTiff .ovr)',
'External (ERDAS Imagine .aux)']
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/raster-overview.png'
return QtGui.QIcon(filepath)
def commandLineName(self):
return "gdalogr:overviews"

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,7 +37,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class hillshade(GeoAlgorithm):
class hillshade(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'
@ -49,10 +49,6 @@ class hillshade(GeoAlgorithm):
ALTITUDE = 'ALTITUDE'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Hillshade'
self.group = '[GDAL] Analysis'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -25,26 +25,20 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.outputs.OutputHTML import OutputHTML
from processing.algs.gdal.GdalUtils import GdalUtils
class information(GeoAlgorithm):
class information(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
NOGCP = 'NOGCP'
NOMETADATA = 'NOMETADATA'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/raster-info.png'
return QtGui.QIcon(filepath)
def commandLineName(self):
return "gdalorg:rasterinfo"

View File

@ -25,32 +25,22 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.outputs.OutputRaster import OutputRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterMultipleInput import ParameterMultipleInput
from processing.tools.system import *
from processing.algs.gdal.GdalUtils import GdalUtils
class merge(GeoAlgorithm):
class merge(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
PCT = 'PCT'
SEPARATE = 'SEPARATE'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/merge.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Merge'
self.group = '[GDAL] Miscellaneous'

View File

@ -25,29 +25,21 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterNumber import ParameterNumber
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class nearblack(GeoAlgorithm):
class nearblack(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
NEAR = 'NEAR'
WHITE = 'WHITE'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/nearblack.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Near black'
self.group = '[GDAL] Analysis'

View File

@ -25,7 +25,6 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import tempfile
try:
from osgeo import gdal, ogr, osr

View File

@ -25,29 +25,21 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.tools.system import *
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterSelection import ParameterSelection
from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class pct2rgb(GeoAlgorithm):
class pct2rgb(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
NBAND = 'NBAND'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/8-to-24-bits.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'PCT to RGB'
self.group = '[GDAL] Conversion'

View File

@ -25,26 +25,21 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
from PyQt4 import QtGui, QtCore
from processing.core.GeoAlgorithm import GeoAlgorithm
from PyQt4 import QtCore
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterString import ParameterString
from processing.outputs.OutputVector import OutputVector
from processing.tools.system import *
from processing.algs.gdal.GdalUtils import GdalUtils
class polygonize(GeoAlgorithm):
class polygonize(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
FIELD = 'FIELD'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/polygonize.png'
return QtGui.QIcon(filepath)
def commandLineName(self):
return "gdalogr:polygonize"

View File

@ -25,9 +25,7 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterSelection import ParameterSelection
@ -37,7 +35,7 @@ from processing.tools.system import *
from processing.algs.gdal.GdalUtils import GdalUtils
class proximity(GeoAlgorithm):
class proximity(GdalAlgorithm):
INPUT = 'INPUT'
VALUES = 'VALUES'
@ -49,10 +47,6 @@ class proximity(GeoAlgorithm):
DISTUNITS = ['GEO', 'PIXEL']
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/proximity.png'
return QtGui.QIcon(filepath)
def commandLineName(self):
return "gdalogr:proximity"

View File

@ -25,10 +25,7 @@ __copyright__ = '(C) 2013, Alexander Bruy'
__revision__ = '$Format:%H$'
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.tools.system import *
from processing.parameters.ParameterVector import ParameterVector
from processing.parameters.ParameterTableField import ParameterTableField
@ -38,7 +35,7 @@ from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class rasterize(GeoAlgorithm):
class rasterize(GdalAlgorithm):
INPUT = 'INPUT'
FIELD = 'FIELD'
@ -47,10 +44,6 @@ class rasterize(GeoAlgorithm):
HEIGHT = 'HEIGHT'
OUTPUT = 'OUTPUT'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/rasterize.png'
return QtGui.QIcon(filepath)
def commandLineName(self):
return "gdalogr:rasterize"

View File

@ -26,28 +26,20 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterNumber import ParameterNumber
from processing.outputs.OutputRaster import OutputRaster
from processing.tools.system import *
from processing.algs.gdal.GdalUtils import GdalUtils
class rgb2pct(GeoAlgorithm):
class rgb2pct(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
NCOLORS = 'NCOLORS'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/24-to-8-bits.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'RGB to PCT'

View File

@ -26,9 +26,7 @@ __copyright__ = '(C) 2013, Alexander Bruy'
__revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,17 +35,13 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class roughness(GeoAlgorithm):
class roughness(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'
COMPUTE_EDGES = 'COMPUTE_EDGES'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Roughness'
self.group = '[GDAL] Analysis'

View File

@ -1,3 +0,0 @@
FILE(GLOB PY_FILES *.py)
PLUGIN_INSTALL(processing ./gdal/algs/scripts ${PY_FILES})

View File

@ -25,10 +25,8 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui, QtCore
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterSelection import ParameterSelection
@ -40,7 +38,7 @@ from processing.tools.system import *
from processing.algs.gdal.GdalUtils import GdalUtils
class sieve(GeoAlgorithm):
class sieve(GdalAlgorithm):
INPUT = 'INPUT'
THRESHOLD = 'THRESHOLD'
@ -49,10 +47,6 @@ class sieve(GeoAlgorithm):
PIXEL_CONNECTIONS = ['4', '8']
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/sieve.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Sieve'
self.group = '[GDAL] Analysis'

View File

@ -26,9 +26,7 @@ __copyright__ = '(C) 2013, Alexander Bruy'
__revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,7 +35,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class slope(GeoAlgorithm):
class slope(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'
@ -47,10 +45,6 @@ class slope(GeoAlgorithm):
SCALE = 'SCALE'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Slope'
self.group = '[GDAL] Analysis'

View File

@ -26,9 +26,7 @@ __copyright__ = '(C) 2013, Alexander Bruy'
__revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,17 +35,13 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class tpi(GeoAlgorithm):
class tpi(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'
COMPUTE_EDGES = 'COMPUTE_EDGES'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'TPI (Topographic Position Index)'
self.group = '[GDAL] Analysis'

View File

@ -25,10 +25,8 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from qgis.core import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterString import ParameterString
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterNumber import ParameterNumber
@ -41,7 +39,7 @@ from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class translate(GeoAlgorithm):
class translate(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
@ -54,10 +52,6 @@ class translate(GeoAlgorithm):
SDS = 'SDS'
EXTRA = 'EXTRA'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/translate.png'
return QtGui.QIcon(filepath)
def commandLineName(self):
return "gdalogr:translate"

View File

@ -28,7 +28,7 @@ __revision__ = '$Format:%H$'
from PyQt4.QtGui import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterBoolean import ParameterBoolean
from processing.parameters.ParameterNumber import ParameterNumber
@ -37,17 +37,13 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import *
class tri(GeoAlgorithm):
class tri(GdalAlgorithm):
INPUT = 'INPUT'
BAND = 'BAND'
COMPUTE_EDGES = 'COMPUTE_EDGES'
OUTPUT = 'OUTPUT'
#def getIcon(self):
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
# return QIcon(filepath)
def defineCharacteristics(self):
self.name = 'TRI (Terrain Ruggedness Index)'
self.group = '[GDAL] Analysis'

View File

@ -25,10 +25,8 @@ __copyright__ = '(C) 2012, Victor Olaya'
__revision__ = '$Format:%H$'
import os
from PyQt4 import QtGui
from qgis.core import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterSelection import ParameterSelection
from processing.parameters.ParameterCrs import ParameterCrs
@ -38,7 +36,7 @@ from processing.outputs.OutputRaster import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils
class warp(GeoAlgorithm):
class warp(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
@ -49,10 +47,6 @@ class warp(GeoAlgorithm):
TR = 'TR'
EXTRA = 'EXTRA'
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/self.png'
return QtGui.QIcon(filepath)
def defineCharacteristics(self):
self.name = 'Warp (reproject)'
self.group = '[GDAL] Projections'

View File

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 734 B