32
32
33
33
import copy
34
34
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
-
45
35
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 )
54
44
55
45
56
46
def getBinaryMorphologicalOperation (available_app , original_dom_document ):
@@ -65,7 +55,6 @@ def getBinaryMorphologicalOperation(available_app, original_dom_document):
65
55
remove_other_choices (the_root , 'structype' , 'ball' )
66
56
remove_dependant_choices (the_root , 'filter' , 'dilate' )
67
57
remove_parameter_by_key (the_root , 'structype.ball.yradius' )
68
- #defaultWrite(available_app, the_root)
69
58
the_list = defaultSplit (available_app , the_root , 'filter' )
70
59
return the_list
71
60
@@ -139,6 +128,9 @@ def getOrthoRectification(available_app, original_dom_document):
139
128
remove_independant_choices (the_root , 'outputs.mode' , 'orthofit' )
140
129
merged = copy .deepcopy (the_root )
141
130
131
+
132
+
133
+
142
134
split = split_by_choice (the_root , 'map' )
143
135
the_list = []
144
136
@@ -407,7 +399,6 @@ def getSmoothing(available_app, original_dom_document):
407
399
# the_list.append(split[key])
408
400
#return the_list
409
401
410
-
411
402
def getColorMapping (available_app , original_dom_document ):
412
403
"""
413
404
Remove the option colortolabel
@@ -463,6 +454,7 @@ def getColorMapping(available_app, original_dom_document):
463
454
return the_list
464
455
465
456
457
+
466
458
def getFusionOfClassifications (available_app , original_dom_document ):
467
459
"""
468
460
Split by method of fusion of classification (dempstershafer, majorityvoting)
@@ -492,6 +484,7 @@ def getTrainImagesClassifier(available_app, original_dom_document):
492
484
return the_list
493
485
494
486
487
+
495
488
def getLineSegmentDetection (available_app , original_dom_document ):
496
489
"""
497
490
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):
505
498
return [the_root ]
506
499
507
500
501
+
508
502
def getImageEnvelope (available_app , original_dom_document ):
509
503
"""
510
504
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):
559
553
return [the_root ]
560
554
561
555
556
+
562
557
def getComputeModulusAndPhase (available_app , original_dom_document ):
563
558
"""
564
559
Split the application according the field nbinput.
@@ -575,7 +570,7 @@ def getComputeModulusAndPhase(available_app, original_dom_document):
575
570
the_doc .find ('longname' ).text = '%s (%s)' % (old_app_name , 'OneEntry' )
576
571
defaultWrite ('%s-%s' % (available_app , 'OneEntry' ), the_doc )
577
572
the_list .append (the_doc )
578
- else :
573
+ else :
579
574
the_doc = split [key ]
580
575
old_app_name = the_doc .find ('key' ).text
581
576
the_doc .find ('key' ).text = '%s-%s' % (old_app_name , 'TwoEntries' )
@@ -615,7 +610,7 @@ def getConnectedComponentSegmentation(available_app, original_dom_document):
615
610
The values are picked from the settings.
616
611
"""
617
612
the_root = original_dom_document
618
- deleteGeoidSrtm (the_root )
613
+ deleteGeoidSrtm ( the_root )
619
614
defaultWrite (available_app , the_root )
620
615
return [the_root ]
621
616
@@ -626,7 +621,7 @@ def getKmzExport(available_app, original_dom_document):
626
621
The values are picked from the settings.
627
622
"""
628
623
the_root = original_dom_document
629
- deleteGeoidSrtm (the_root )
624
+ deleteGeoidSrtm ( the_root )
630
625
defaultWrite (available_app , the_root )
631
626
return [the_root ]
632
627
@@ -637,7 +632,7 @@ def getSuperimpose(available_app, original_dom_document):
637
632
The values are picked from the settings.
638
633
"""
639
634
the_root = original_dom_document
640
- deleteGeoidSrtm (the_root )
635
+ deleteGeoidSrtm ( the_root )
641
636
defaultWrite (available_app , the_root )
642
637
return [the_root ]
643
638
@@ -648,12 +643,13 @@ def getStereoFramework(available_app, original_dom_document):
648
643
The values are picked from the settings.
649
644
"""
650
645
the_root = original_dom_document
651
- deleteGeoidSrtm (the_root )
646
+ deleteGeoidSrtm ( the_root )
652
647
defaultWrite (available_app , the_root )
653
648
return [the_root ]
654
649
655
650
656
- def deleteGeoidSrtm (doc ):
651
+
652
+ def deleteGeoidSrtm (doc ) :
657
653
"""
658
654
Delete GEOID and DEM parameter as they are not updated at the creation of the otb algorithms when you launch QGIS.
659
655
The values are picked from the settings.
0 commit comments