Skip to content

Commit 85bea7d

Browse files
amondotvolaya
authored andcommittedNov 4, 2015
[processing/otb]remove unused code and imports
1 parent 3472ac8 commit 85bea7d

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed
 

‎python/plugins/processing/algs/otb/maintenance/OTBSpecific_XMLcreation.py

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,15 @@
3232

3333
import copy
3434

35-
try:
36-
import processing
37-
except ImportError as e:
38-
raise Exception("Processing must be installed and available in PYTHONPATH")
39-
40-
try:
41-
import otbApplication
42-
except ImportError as e:
43-
raise Exception("OTB python plugins must be installed and available in PYTHONPATH")
44-
4535
from processing.algs.otb.OTBUtils import (renameValueField,
46-
remove_dependant_choices,
47-
remove_other_choices,
48-
remove_parameter_by_key,
49-
defaultSplit,
50-
split_by_choice,
51-
defaultWrite,
52-
remove_choice,
53-
remove_independant_choices)
36+
remove_dependant_choices,
37+
remove_other_choices,
38+
remove_parameter_by_key,
39+
defaultSplit,
40+
split_by_choice,
41+
defaultWrite,
42+
remove_choice,
43+
remove_independant_choices )
5444

5545

5646
def getBinaryMorphologicalOperation(available_app, original_dom_document):
@@ -65,7 +55,6 @@ def getBinaryMorphologicalOperation(available_app, original_dom_document):
6555
remove_other_choices(the_root, 'structype', 'ball')
6656
remove_dependant_choices(the_root, 'filter', 'dilate')
6757
remove_parameter_by_key(the_root, 'structype.ball.yradius')
68-
#defaultWrite(available_app, the_root)
6958
the_list = defaultSplit(available_app, the_root, 'filter')
7059
return the_list
7160

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

131+
132+
133+
142134
split = split_by_choice(the_root, 'map')
143135
the_list = []
144136

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

410-
411402
def getColorMapping(available_app, original_dom_document):
412403
"""
413404
Remove the option colortolabel
@@ -463,6 +454,7 @@ def getColorMapping(available_app, original_dom_document):
463454
return the_list
464455

465456

457+
466458
def getFusionOfClassifications(available_app, original_dom_document):
467459
"""
468460
Split by method of fusion of classification (dempstershafer, majorityvoting)
@@ -492,6 +484,7 @@ def getTrainImagesClassifier(available_app, original_dom_document):
492484
return the_list
493485

494486

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

507500

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

561555

556+
562557
def getComputeModulusAndPhase(available_app, original_dom_document):
563558
"""
564559
Split the application according the field nbinput.
@@ -575,7 +570,7 @@ def getComputeModulusAndPhase(available_app, original_dom_document):
575570
the_doc.find('longname').text = '%s (%s)' % (old_app_name, 'OneEntry')
576571
defaultWrite('%s-%s' % (available_app, 'OneEntry'), the_doc)
577572
the_list.append(the_doc)
578-
else:
573+
else :
579574
the_doc = split[key]
580575
old_app_name = the_doc.find('key').text
581576
the_doc.find('key').text = '%s-%s' % (old_app_name, 'TwoEntries')
@@ -615,7 +610,7 @@ def getConnectedComponentSegmentation(available_app, original_dom_document):
615610
The values are picked from the settings.
616611
"""
617612
the_root = original_dom_document
618-
deleteGeoidSrtm(the_root)
613+
deleteGeoidSrtm( the_root )
619614
defaultWrite(available_app, the_root)
620615
return [the_root]
621616

@@ -626,7 +621,7 @@ def getKmzExport(available_app, original_dom_document):
626621
The values are picked from the settings.
627622
"""
628623
the_root = original_dom_document
629-
deleteGeoidSrtm(the_root)
624+
deleteGeoidSrtm( the_root )
630625
defaultWrite(available_app, the_root)
631626
return [the_root]
632627

@@ -637,7 +632,7 @@ def getSuperimpose(available_app, original_dom_document):
637632
The values are picked from the settings.
638633
"""
639634
the_root = original_dom_document
640-
deleteGeoidSrtm(the_root)
635+
deleteGeoidSrtm( the_root )
641636
defaultWrite(available_app, the_root)
642637
return [the_root]
643638

@@ -648,12 +643,13 @@ def getStereoFramework(available_app, original_dom_document):
648643
The values are picked from the settings.
649644
"""
650645
the_root = original_dom_document
651-
deleteGeoidSrtm(the_root)
646+
deleteGeoidSrtm( the_root )
652647
defaultWrite(available_app, the_root)
653648
return [the_root]
654649

655650

656-
def deleteGeoidSrtm(doc):
651+
652+
def deleteGeoidSrtm(doc) :
657653
"""
658654
Delete GEOID and DEM parameter as they are not updated at the creation of the otb algorithms when you launch QGIS.
659655
The values are picked from the settings.

0 commit comments

Comments
 (0)
Please sign in to comment.