Skip to content
Permalink
Browse files

[processing] improved version detection mechanism for OTB

  • Loading branch information
volaya committed Jan 13, 2016
1 parent 7a87999 commit 864e1921e6e4e6b4d99d50122c772c530c4478a4
Showing with 159 additions and 127 deletions.
  1. +7 −10 python/plugins/processing/algs/otb/OTBAlgorithm.py
  2. +17 −9 python/plugins/processing/algs/otb/OTBAlgorithmProvider.py
  3. +1 −1 python/plugins/processing/algs/otb/OTBSpecific_XMLLoading.py
  4. +132 −106 python/plugins/processing/algs/otb/OTBUtils.py
  5. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/BandMath.xml
  6. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/BandMathX.xml
  7. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/BinaryMorphologicalOperation-closing.xml
  8. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/BinaryMorphologicalOperation-dilate.xml
  9. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/BinaryMorphologicalOperation-erode.xml
  10. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/BinaryMorphologicalOperation-opening.xml
  11. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ClassificationMapRegularization.xml
  12. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ColorMapping-continuous.xml
  13. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ColorMapping-custom.xml
  14. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ColorMapping-image.xml
  15. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ColorMapping-optimal.xml
  16. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/CompareImages.xml
  17. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ComputeConfusionMatrix-raster.xml
  18. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ComputeConfusionMatrix-vector.xml
  19. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ComputeImagesStatistics.xml
  20. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ComputeModulusAndPhase-OneEntry.xml
  21. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ComputeModulusAndPhase-TwoEntries.xml
  22. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ComputeOGRLayersFeaturesStatistics.xml
  23. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ComputePolylineFeatureFromImage.xml
  24. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ConcatenateImages.xml
  25. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ConcatenateVectorData.xml
  26. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ConnectedComponentSegmentation.xml
  27. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Convert.xml
  28. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/DEMConvert.xml
  29. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Despeckle-frost.xml
  30. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Despeckle-lee.xml
  31. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/DimensionalityReduction-ica.xml
  32. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/DimensionalityReduction-maf.xml
  33. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/DimensionalityReduction-napca.xml
  34. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/DimensionalityReduction-pca.xml
  35. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/EdgeExtraction-gradient.xml
  36. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/EdgeExtraction-sobel.xml
  37. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/EdgeExtraction-touzi.xml
  38. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ExtractROI-fit.xml
  39. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ExtractROI-standard.xml
  40. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/FusionOfClassifications-dempstershafer.xml
  41. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/FusionOfClassifications-majorityvoting.xml
  42. 0 ...on/plugins/processing/algs/otb/description/{ → 5.0.0}/GrayScaleMorphologicalOperation-closing.xml
  43. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/GrayScaleMorphologicalOperation-dilate.xml
  44. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/GrayScaleMorphologicalOperation-erode.xml
  45. 0 ...on/plugins/processing/algs/otb/description/{ → 5.0.0}/GrayScaleMorphologicalOperation-opening.xml
  46. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/HaralickTextureExtraction.xml
  47. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/HooverCompareSegmentation.xml
  48. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ImageClassifier.xml
  49. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ImageEnvelope.xml
  50. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/KMeansClassification.xml
  51. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/KmzExport.xml
  52. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/LSMSSegmentation.xml
  53. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/LSMSSmallRegionsMerging.xml
  54. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/LSMSVectorization.xml
  55. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/LineSegmentDetection.xml
  56. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/LocalStatisticExtraction.xml
  57. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/MeanShiftSmoothing.xml
  58. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/MultivariateAlterationDetector.xml
  59. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/OGRLayerClassifier.xml
  60. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/OpticalCalibration.xml
  61. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/OrthoRectification-epsg.xml
  62. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/OrthoRectification-fit-to-ortho.xml
  63. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/OrthoRectification-lambert-WGS84.xml
  64. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/OrthoRectification-utm.xml
  65. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Pansharpening-bayes.xml
  66. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Pansharpening-lmvm.xml
  67. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Pansharpening-rcs.xml
  68. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/RadiometricIndices.xml
  69. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Rasterization-image.xml
  70. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Rasterization-manual.xml
  71. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/ReadImageInfo.xml
  72. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Rescale.xml
  73. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/RigidTransformResample-id.xml
  74. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/RigidTransformResample-rotation.xml
  75. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/RigidTransformResample-translation.xml
  76. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/SFSTextureExtraction.xml
  77. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/SOMClassification.xml
  78. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Segmentation-cc.xml
  79. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Segmentation-edison.xml
  80. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Segmentation-meanshift.xml
  81. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Segmentation-mprofiles.xml
  82. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Segmentation-watershed.xml
  83. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Smoothing-anidif.xml
  84. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Smoothing-gaussian.xml
  85. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Smoothing-mean.xml
  86. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/SplitImage.xml
  87. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/StereoFramework.xml
  88. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/Superimpose.xml
  89. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TileFusion.xml
  90. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-ann.xml
  91. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-bayes.xml
  92. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-boost.xml
  93. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-dt.xml
  94. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-gbt.xml
  95. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-knn.xml
  96. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-libsvm.xml
  97. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-rf.xml
  98. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainImagesClassifier-svm.xml
  99. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/TrainOGRLayersClassifier.xml
  100. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/VectorDataExtractROI.xml
  101. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/VectorDataReprojection-image.xml
  102. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/VectorDataReprojection-user.xml
  103. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/VectorDataTransform.xml
  104. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BandMath.html
  105. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BandMathX.html
  106. 0 .../plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BinaryMorphologicalOperation-closing.html
  107. 0 ...n/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BinaryMorphologicalOperation-dilate.html
  108. 0 ...on/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BinaryMorphologicalOperation-erode.html
  109. 0 .../plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BinaryMorphologicalOperation-opening.html
  110. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BinaryMorphologicalOperation.html
  111. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BlockMatching.html
  112. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/BundleToPerfectSensor.html
  113. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ClassificationMapRegularization.html
  114. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ColorMapping-continuous.html
  115. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ColorMapping-custom.html
  116. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ColorMapping-image.html
  117. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ColorMapping-optimal.html
  118. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ColorMapping.html
  119. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/CompareImages.html
  120. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ComputeConfusionMatrix-raster.html
  121. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ComputeConfusionMatrix-vector.html
  122. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ComputeConfusionMatrix.html
  123. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ComputeImagesStatistics.html
  124. 0 ...on/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ComputeOGRLayersFeaturesStatistics.html
  125. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ComputePolylineFeatureFromImage.html
  126. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ConcatenateImages.html
  127. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ConcatenateVectorData.html
  128. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ConnectedComponentSegmentation.html
  129. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Convert.html
  130. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ConvertCartoToGeoPoint.html
  131. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ConvertSensorToGeoPoint.html
  132. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/CookBook.css
  133. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DEMConvert.html
  134. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DSFuzzyModelEstimation.html
  135. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Despeckle-frost.html
  136. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Despeckle-lee.html
  137. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Despeckle.html
  138. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DimensionalityReduction-ica.html
  139. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DimensionalityReduction-maf.html
  140. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DimensionalityReduction-napca.html
  141. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DimensionalityReduction-pca.html
  142. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DimensionalityReduction.html
  143. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DisparityMapToElevationMap.html
  144. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/DownloadSRTMTiles.html
  145. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/EdgeExtraction-gradient.html
  146. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/EdgeExtraction-sobel.html
  147. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/EdgeExtraction-touzi.html
  148. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/EdgeExtraction.html
  149. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ExtractROI-fit.html
  150. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ExtractROI-standard.html
  151. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ExtractROI.html
  152. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/FineRegistration.html
  153. 0 ...lugins/processing/algs/otb/description/{ → 5.0.0}/doc/FusionOfClassifications-dempstershafer.html
  154. 0 ...lugins/processing/algs/otb/description/{ → 5.0.0}/doc/FusionOfClassifications-majorityvoting.html
  155. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/FusionOfClassifications.html
  156. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/GeneratePlyFile.html
  157. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/GenerateRPCSensorModel.html
  158. 0 ...ugins/processing/algs/otb/description/{ → 5.0.0}/doc/GrayScaleMorphologicalOperation-closing.html
  159. 0 ...lugins/processing/algs/otb/description/{ → 5.0.0}/doc/GrayScaleMorphologicalOperation-dilate.html
  160. 0 ...plugins/processing/algs/otb/description/{ → 5.0.0}/doc/GrayScaleMorphologicalOperation-erode.html
  161. 0 ...ugins/processing/algs/otb/description/{ → 5.0.0}/doc/GrayScaleMorphologicalOperation-opening.html
  162. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/GrayScaleMorphologicalOperation.html
  163. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/GridBasedImageResampling.html
  164. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/HaralickTextureExtraction.html
  165. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/HomologousPointsExtraction.html
  166. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/HooverCompareSegmentation.html
  167. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/HyperspectralUnmixing.html
  168. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ImageClassifier.html
  169. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ImageEnvelope.html
  170. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/KMeansClassification.html
  171. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/KmzExport.html
  172. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/LSMSSegmentation.html
  173. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/LSMSSmallRegionsMerging.html
  174. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/LSMSVectorization.html
  175. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/LineSegmentDetection.html
  176. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/LocalStatisticExtraction.html
  177. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/MeanShiftSmoothing.html
  178. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/MultiResolutionPyramid.html
  179. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/MultivariateAlterationDetector.html
  180. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OGRLayerClassifier.html
  181. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OSMDownloader.html
  182. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ObtainUTMZoneFromGeoPoint.html
  183. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OpticalCalibration.html
  184. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OrthoRectification-epsg.html
  185. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OrthoRectification-fit-to-ortho.html
  186. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OrthoRectification-lambert-WGS84.html
  187. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OrthoRectification-utm.html
  188. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/OrthoRectification.html
  189. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Pansharpening-bayes.html
  190. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Pansharpening-lmvm.html
  191. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Pansharpening-rcs.html
  192. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Pansharpening.html
  193. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/PixelValue.html
  194. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Quicklook.html
  195. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/RadiometricIndices.html
  196. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Rasterization-image.html
  197. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Rasterization-manual.html
  198. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Rasterization.html
  199. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/ReadImageInfo.html
  200. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/RefineSensorModel.html
  201. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Rescale.html
  202. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/RigidTransformResample-id.html
  203. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/RigidTransformResample-rotation.html
  204. 0 ...on/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/RigidTransformResample-translation.html
  205. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/RigidTransformResample.html
  206. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/SFSTextureExtraction.html
  207. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/SOMClassification.html
  208. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/SarRadiometricCalibration.html
  209. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Segmentation-cc.html
  210. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Segmentation-meanshift.html
  211. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Segmentation-mprofiles.html
  212. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Segmentation-watershed.html
  213. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Segmentation.html
  214. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Smoothing-anidif.html
  215. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Smoothing-gaussian.html
  216. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Smoothing-mean.html
  217. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Smoothing.html
  218. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/SplitImage.html
  219. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/StereoFramework.html
  220. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/StereoRectificationGridGenerator.html
  221. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/Superimpose.html
  222. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TestApplication.html
  223. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TileFusion.html
  224. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-ann.html
  225. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-bayes.html
  226. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-boost.html
  227. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-dt.html
  228. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-gbt.html
  229. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-knn.html
  230. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-libsvm.html
  231. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-rf.html
  232. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier-svm.html
  233. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainImagesClassifier.html
  234. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/TrainOGRLayersClassifier.html
  235. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VectorDataDSValidation.html
  236. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VectorDataExtractROI.html
  237. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VectorDataReprojection-image.html
  238. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VectorDataReprojection-user.html
  239. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VectorDataReprojection.html
  240. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VectorDataSetField.html
  241. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VectorDataTransform.html
  242. 0 python/plugins/processing/algs/otb/description/{ → 5.0.0}/doc/VertexComponentAnalysis.html
  243. +2 −1 python/plugins/processing/tests/PackagingTests.py
@@ -43,7 +43,7 @@
from processing.core.ProcessingLog import ProcessingLog
from processing.core.parameters import getParameterFromString
from processing.core.outputs import getOutputFromString
from OTBUtils import OTBUtils
import OTBUtils
from processing.core.parameters import ParameterExtent
from processing.tools.system import getTempFilename
import xml.etree.ElementTree as ET
@@ -77,12 +77,16 @@ def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'otb.png'))

def help(self):
folder = os.path.join(OTBUtils.otbDescriptionPath(), 'doc')
version = OTBUtils.getInstalledVersion()
folder = OTBUtils.compatibleDescriptionPath(version)
if folder is None:
return False, None
folder = os.path.join(folder, 'doc')
helpfile = os.path.join(unicode(folder), self.appkey + ".html")
if os.path.exists(helpfile):
return False, helpfile
else:
raise False
return False, None

def adapt_list_to_string(self, c_list):
a_list = c_list[1:]
@@ -166,16 +170,9 @@ def defineCharacteristicsFromFile(self):
self.tr('Could not open OTB algorithm: %s\n%s' % (self.descriptionFile, line)))
raise e

def checkBeforeOpeningParametersDialog(self):
return OTBUtils.checkOtbConfiguration()

def processAlgorithm(self, progress):
currentOs = os.name

msg = OTBUtils.checkOtbConfiguration()
if msg:
raise GeoAlgorithmExecutionException(msg)

path = OTBUtils.otbPath()

commands = []
@@ -32,7 +32,7 @@
from PyQt4.QtGui import QIcon
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.core.ProcessingConfig import ProcessingConfig, Setting
from OTBUtils import OTBUtils
import OTBUtils
from OTBAlgorithm import OTBAlgorithm
from processing.core.ProcessingLog import ProcessingLog

@@ -45,7 +45,6 @@ class OTBAlgorithmProvider(AlgorithmProvider):
def __init__(self):
AlgorithmProvider.__init__(self)
self.activate = True
self.createAlgsList()

def getDescription(self):
return self.tr("Orfeo Toolbox (Image analysis)")
@@ -57,18 +56,29 @@ def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'otb.png'))

def _loadAlgorithms(self):
self.algs = self.preloadedAlgs
self.algs = []

version = OTBUtils.getInstalledVersion(True)
if version is None:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with OTB installation: OTB was not found or is not correctly installed'))
return

folder = OTBUtils.compatibleDescriptionPath(version)
if folder is None:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with OTB installation: installed OTB version (%s) is not supported' % version))
return



def createAlgsList(self):
self.preloadedAlgs = []
folder = OTBUtils.otbDescriptionPath()
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith("xml"):
try:
alg = OTBAlgorithm(os.path.join(folder, descriptionFile))

if alg.name.strip() != "":
self.preloadedAlgs.append(alg)
self.algs.append(alg)
else:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr("Could not open OTB algorithm: %s" % descriptionFile))
@@ -102,5 +112,3 @@ def unload(self):
ProcessingConfig.removeSetting(OTBUtils.OTB_FOLDER)
ProcessingConfig.removeSetting(OTBUtils.OTB_LIB_FOLDER)

def canBeActivated(self):
return not bool(OTBUtils.checkOtbConfiguration())
@@ -44,7 +44,7 @@

from processing.core.ProcessingConfig import ProcessingConfig

from OTBUtils import OTBUtils
import OTBUtils


def adaptBinaryMorphologicalOperation(commands_list):
@@ -39,125 +39,151 @@
import logging
import xml.etree.ElementTree as ET
import traceback
from processing.gui.SilentProgress import SilentProgress


class OTBUtils:
OTB_FOLDER = "OTB_FOLDER"
OTB_LIB_FOLDER = "OTB_LIB_FOLDER"
OTB_SRTM_FOLDER = "OTB_SRTM_FOLDER"
OTB_GEOID_FILE = "OTB_GEOID_FILE"

OTB_FOLDER = "OTB_FOLDER"
OTB_LIB_FOLDER = "OTB_LIB_FOLDER"
OTB_SRTM_FOLDER = "OTB_SRTM_FOLDER"
OTB_GEOID_FILE = "OTB_GEOID_FILE"

@staticmethod
def findOtbPath():
folder = None
#try to configure the path automatically
if isMac():
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "bin")
if os.path.exists(os.path.join(testfolder, "otbcli")):
folder = testfolder
else:
testfolder = "/usr/local/bin"
if os.path.exists(os.path.join(testfolder, "otbcli")):
folder = testfolder
elif isWindows():
testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()),
os.pardir, "bin")
if os.path.exists(os.path.join(testfolder, "otbcli.bat")):
folder = testfolder
def findOtbPath():
folder = None
#try to configure the path automatically
if isMac():
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "bin")
if os.path.exists(os.path.join(testfolder, "otbcli")):
folder = testfolder
else:
testfolder = "/usr/bin"
testfolder = "/usr/local/bin"
if os.path.exists(os.path.join(testfolder, "otbcli")):
folder = testfolder
return folder

@staticmethod
def otbPath():
folder = OTBUtils.findOtbPath()
if folder is None:
folder = ProcessingConfig.getSetting(OTBUtils.OTB_FOLDER)
return folder

@staticmethod
def findOtbLibPath():
folder = None
#try to configure the path automatically
if isMac():
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "lib/otb/applications")
if os.path.exists(testfolder):
folder = testfolder
else:
testfolder = "/usr/local/lib/otb/applications"
if os.path.exists(testfolder):
folder = testfolder
elif isWindows():
testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()), "orfeotoolbox", "applications")
if os.path.exists(testfolder):
folder = testfolder
elif isWindows():
testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()),
os.pardir, "bin")
if os.path.exists(os.path.join(testfolder, "otbcli.bat")):
folder = testfolder
else:
testfolder = "/usr/bin"
if os.path.exists(os.path.join(testfolder, "otbcli")):
folder = testfolder
return folder


def otbPath():
folder = findOtbPath()
if folder is None:
folder = ProcessingConfig.getSetting(OTB_FOLDER)
return folder


def findOtbLibPath():
folder = None
#try to configure the path automatically
if isMac():
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "lib/otb/applications")
if os.path.exists(testfolder):
folder = testfolder
else:
testfolder = "/usr/lib/otb/applications"
testfolder = "/usr/local/lib/otb/applications"
if os.path.exists(testfolder):
folder = testfolder
return folder

@staticmethod
def otbLibPath():
folder = OTBUtils.findOtbLibPath()
if folder is None:
folder = ProcessingConfig.getSetting(OTBUtils.OTB_LIB_FOLDER)
return folder

@staticmethod
def otbSRTMPath():
folder = ProcessingConfig.getSetting(OTBUtils.OTB_SRTM_FOLDER)
if folder is None:
folder = ""
return folder

@staticmethod
def otbGeoidPath():
filepath = ProcessingConfig.getSetting(OTBUtils.OTB_GEOID_FILE)
if filepath is None:
filepath = ""
return filepath

@staticmethod
def otbDescriptionPath():
return os.path.join(os.path.dirname(__file__), "description")

@staticmethod
def executeOtb(commands, progress):
loglines = []
loglines.append(OTBUtils.tr("OTB execution console output"))
os.putenv('ITK_AUTOLOAD_PATH', OTBUtils.otbLibPath())
fused_command = ''.join(['"%s" ' % re.sub(r'^"|"$', '', c) for c in commands])
proc = subprocess.Popen(fused_command, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull), stderr=subprocess.STDOUT, universal_newlines=True).stdout
for line in iter(proc.readline, ""):
if "[*" in line:
idx = line.find("[*")
perc = int(line[idx - 4:idx - 2].strip(" "))
if perc != 0:
progress.setPercentage(perc)
else:
loglines.append(line)
progress.setConsoleInfo(line)
elif isWindows():
testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()), "orfeotoolbox", "applications")
if os.path.exists(testfolder):
folder = testfolder
else:
testfolder = "/usr/lib/otb/applications"
if os.path.exists(testfolder):
folder = testfolder
return folder


def otbLibPath():
folder = findOtbLibPath()
if folder is None:
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
return folder


def otbSRTMPath():
folder = ProcessingConfig.getSetting(OTB_SRTM_FOLDER)
if folder is None:
folder = ""
return folder


def otbGeoidPath():
filepath = ProcessingConfig.getSetting(OTB_GEOID_FILE)
if filepath is None:
filepath = ""
return filepath


def otbDescriptionPath():
return os.path.join(os.path.dirname(__file__), "description")

_installedVersion = None
_installedVersionFound = False


def getInstalledVersion(runOtb=False):
global _installedVersion
global _installedVersionFound

if _installedVersionFound and not runOtb:
return _installedVersion

commands =[os.path.join(otbPath(), "otbcli_Smoothing")]
progress = SilentProgress()
out = executeOtb(commands, progress, False)
for line in out:
if "version" in line:
_installedVersionFound = True
_installedVersion = line.split("version")[-1].strip()
break
return _installedVersion

def compatibleDescriptionPath(version):
supportedVersions = {"5.0.0": "5.0.0"}
if version is None:
return None
if version not in supportedVersions:
lastVersion = sorted(supportedVersions.keys())[-1]
if version > lastVersion:
version = lastVersion
else:
return None

return os.path.join(otbDescriptionPath(), supportedVersions[version])

def executeOtb(commands, progress, addToLog = True):
loglines = []
loglines.append(tr("OTB execution console output"))
os.putenv('ITK_AUTOLOAD_PATH', otbLibPath())
fused_command = ''.join(['"%s" ' % re.sub(r'^"|"$', '', c) for c in commands])
proc = subprocess.Popen(fused_command, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull), stderr=subprocess.STDOUT, universal_newlines=True).stdout
for line in iter(proc.readline, ""):
if "[*" in line:
idx = line.find("[*")
perc = int(line[idx - 4:idx - 2].strip(" "))
if perc != 0:
progress.setPercentage(perc)
else:
loglines.append(line)
progress.setConsoleInfo(line)

if addToLog:
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)

@staticmethod
def checkOtbConfiguration():
path = OTBUtils.otbPath()
libpath = OTBUtils.otbLibPath()
configurationOk = bool(path) and bool(libpath)
if not configurationOk:
return OTBUtils.tr('OTB folder is not configured. Please configure it '
'before running OTB algorithms.')

@staticmethod
def tr(string, context=''):
if context == '':
context = 'OTBUtils'
return QCoreApplication.translate(context, string)
return loglines


def tr(string, context=''):
if context == '':
context = 'OTBUtils'
return QCoreApplication.translate(context, string)


def get_choices_of(doc, parameter):