From df25faaf546b916c3b2ed8606ed8c3ac1bb63bc2 Mon Sep 17 00:00:00 2001 From: Mickael Savinaud <mickael.savinaud@c-s.fr> Date: Thu, 25 Jun 2015 14:45:24 +0200 Subject: [PATCH] ENH: move the input parameter of the app from inputfilename to inputvectordata one, to support a better intagration in QGIS processing framework --- .../app/otbComputeOGRLayersFeaturesStatistics.cxx | 2 +- .../AppClassification/app/otbOGRLayerClassifier.cxx | 10 +++++----- .../app/otbTrainOGRLayersClassifier.cxx | 10 +++++----- .../AppVectorDataTranslation/app/otbRasterization.cxx | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx b/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx index 10c2b5116c..f3e716b926 100644 --- a/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx @@ -54,7 +54,7 @@ private: SetDocSeeAlso("OGRLayerClassifier,TrainOGRLayersClassifier"); AddDocTag(Tags::Segmentation); - AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile"); + AddParameter(ParameterType_InputVectorData, "inshp", "Name of the input shapefile"); SetParameterDescription("inshp","Name of the input shapefile"); AddParameter(ParameterType_InputFilename, "outstats", "XML file containing mean and variance of each feature."); diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index 21cdb07bcd..0eda56b748 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -63,7 +63,7 @@ private: SetDocSeeAlso("ComputeOGRLayersFeaturesStatistics,TrainOGRLayersClassifier"); AddDocTag(Tags::Segmentation); - AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile"); + AddParameter(ParameterType_InputVectorData, "inshp", "Name of the input shapefile"); SetParameterDescription("inshp","Name of the input shapefile"); AddParameter(ParameterType_InputFilename, "instats", "XML file containing mean and variance of each feature."); @@ -122,8 +122,8 @@ private: void DoExecute() { - - #ifdef OTB_USE_LIBSVM + + #ifdef OTB_USE_LIBSVM clock_t tic = clock(); std::string shapefile = GetParameterString("inshp").c_str(); @@ -221,8 +221,8 @@ private: otbAppLogINFO( "Elapsed: "<< ((double)(toc - tic) / CLOCKS_PER_SEC)<<" seconds."); #else - otbAppLogFATAL("Module LIBSVM is not installed. You should consider turning OTB_USE_LIBSVM on during cmake configuration."); - #endif + otbAppLogFATAL("Module LIBSVM is not installed. You should consider turning OTB_USE_LIBSVM on during cmake configuration."); + #endif } diff --git a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx index e0a044ae5e..96dfef7564 100644 --- a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx @@ -63,7 +63,7 @@ private: SetDocSeeAlso("OGRLayerClassifier,ComputeOGRLayersFeaturesStatistics"); AddDocTag(Tags::Segmentation); - AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile"); + AddParameter(ParameterType_InputVectorData, "inshp", "Name of the input shapefile"); SetParameterDescription("inshp","Name of the input shapefile"); AddParameter(ParameterType_InputFilename, "instats", "XML file containing mean and variance of each feature."); @@ -121,7 +121,7 @@ private: void DoExecute() { - #ifdef OTB_USE_LIBSVM + #ifdef OTB_USE_LIBSVM clock_t tic = clock(); std::string shapefile = GetParameterString("inshp"); @@ -203,9 +203,9 @@ private: otbAppLogINFO( "Elapsed: "<< ((double)(toc - tic) / CLOCKS_PER_SEC)<<" seconds."); #else - otbAppLogFATAL("Module LIBSVM is not installed. You should consider turning OTB_USE_LIBSVM on during cmake configuration."); - #endif - + otbAppLogFATAL("Module LIBSVM is not installed. You should consider turning OTB_USE_LIBSVM on during cmake configuration."); + #endif + } }; diff --git a/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx b/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx index 8b66ad3b14..588940de96 100644 --- a/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx +++ b/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx @@ -70,7 +70,7 @@ private: AddDocTag(Tags::Vector); - AddParameter(ParameterType_InputFilename, "in", "Input vector dataset"); + AddParameter(ParameterType_InputVectorData, "in", "Input vector dataset"); SetParameterDescription( "in", "The input vector dataset to be rasterized" ); AddParameter(ParameterType_OutputImage, "out", "Ouptut image"); -- GitLab