Skip to content

Commit

Permalink
[processing/otb]remove unused code and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
amondot authored and volaya committed Nov 4, 2015
1 parent 3472ac8 commit 85bea7d
Showing 1 changed file with 22 additions and 26 deletions.
Expand Up @@ -32,25 +32,15 @@

import copy

try:
import processing
except ImportError as e:
raise Exception("Processing must be installed and available in PYTHONPATH")

try:
import otbApplication
except ImportError as e:
raise Exception("OTB python plugins must be installed and available in PYTHONPATH")

from processing.algs.otb.OTBUtils import (renameValueField,
remove_dependant_choices,
remove_other_choices,
remove_parameter_by_key,
defaultSplit,
split_by_choice,
defaultWrite,
remove_choice,
remove_independant_choices)
remove_dependant_choices,
remove_other_choices,
remove_parameter_by_key,
defaultSplit,
split_by_choice,
defaultWrite,
remove_choice,
remove_independant_choices )


def getBinaryMorphologicalOperation(available_app, original_dom_document):
Expand All @@ -65,7 +55,6 @@ def getBinaryMorphologicalOperation(available_app, original_dom_document):
remove_other_choices(the_root, 'structype', 'ball')
remove_dependant_choices(the_root, 'filter', 'dilate')
remove_parameter_by_key(the_root, 'structype.ball.yradius')
#defaultWrite(available_app, the_root)
the_list = defaultSplit(available_app, the_root, 'filter')
return the_list

Expand Down Expand Up @@ -139,6 +128,9 @@ def getOrthoRectification(available_app, original_dom_document):
remove_independant_choices(the_root, 'outputs.mode', 'orthofit')
merged = copy.deepcopy(the_root)




split = split_by_choice(the_root, 'map')
the_list = []

Expand Down Expand Up @@ -407,7 +399,6 @@ def getSmoothing(available_app, original_dom_document):
# the_list.append(split[key])
#return the_list


def getColorMapping(available_app, original_dom_document):
"""
Remove the option colortolabel
Expand Down Expand Up @@ -463,6 +454,7 @@ def getColorMapping(available_app, original_dom_document):
return the_list



def getFusionOfClassifications(available_app, original_dom_document):
"""
Split by method of fusion of classification (dempstershafer, majorityvoting)
Expand Down Expand Up @@ -492,6 +484,7 @@ def getTrainImagesClassifier(available_app, original_dom_document):
return the_list



def getLineSegmentDetection(available_app, original_dom_document):
"""
Delete GEOID and DEM parameter as they are not updated at the creation of the otb algorithms when you launch QGIS.
Expand All @@ -505,6 +498,7 @@ def getLineSegmentDetection(available_app, original_dom_document):
return [the_root]



def getImageEnvelope(available_app, original_dom_document):
"""
Delete GEOID and DEM parameter as they are not updated at the creation of the otb algorithms when you launch QGIS.
Expand Down Expand Up @@ -559,6 +553,7 @@ def getReadImageInfo(available_app, original_dom_document):
return [the_root]



def getComputeModulusAndPhase(available_app, original_dom_document):
"""
Split the application according the field nbinput.
Expand All @@ -575,7 +570,7 @@ def getComputeModulusAndPhase(available_app, original_dom_document):
the_doc.find('longname').text = '%s (%s)' % (old_app_name, 'OneEntry')
defaultWrite('%s-%s' % (available_app, 'OneEntry'), the_doc)
the_list.append(the_doc)
else:
else :
the_doc = split[key]
old_app_name = the_doc.find('key').text
the_doc.find('key').text = '%s-%s' % (old_app_name, 'TwoEntries')
Expand Down Expand Up @@ -615,7 +610,7 @@ def getConnectedComponentSegmentation(available_app, original_dom_document):
The values are picked from the settings.
"""
the_root = original_dom_document
deleteGeoidSrtm(the_root)
deleteGeoidSrtm( the_root )
defaultWrite(available_app, the_root)
return [the_root]

Expand All @@ -626,7 +621,7 @@ def getKmzExport(available_app, original_dom_document):
The values are picked from the settings.
"""
the_root = original_dom_document
deleteGeoidSrtm(the_root)
deleteGeoidSrtm( the_root )
defaultWrite(available_app, the_root)
return [the_root]

Expand All @@ -637,7 +632,7 @@ def getSuperimpose(available_app, original_dom_document):
The values are picked from the settings.
"""
the_root = original_dom_document
deleteGeoidSrtm(the_root)
deleteGeoidSrtm( the_root )
defaultWrite(available_app, the_root)
return [the_root]

Expand All @@ -648,12 +643,13 @@ def getStereoFramework(available_app, original_dom_document):
The values are picked from the settings.
"""
the_root = original_dom_document
deleteGeoidSrtm(the_root)
deleteGeoidSrtm( the_root )
defaultWrite(available_app, the_root)
return [the_root]


def deleteGeoidSrtm(doc):

def deleteGeoidSrtm(doc) :
"""
Delete GEOID and DEM parameter as they are not updated at the creation of the otb algorithms when you launch QGIS.
The values are picked from the settings.
Expand Down

0 comments on commit 85bea7d

Please sign in to comment.