From e2d485d783a3fcb45d1d054274e90476cbfd10df Mon Sep 17 00:00:00 2001 From: Otmane Lahlou <otmane.lahlou@c-s.fr> Date: Fri, 26 Nov 2010 17:54:20 +0100 Subject: [PATCH] ENH: refactoring of the repository OTB-Applications: add a directory Legacy : All the applications were put in Legacy --- Projections/otbImageEnvelope.cxx | 77 -------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 Projections/otbImageEnvelope.cxx diff --git a/Projections/otbImageEnvelope.cxx b/Projections/otbImageEnvelope.cxx deleted file mode 100644 index 79344e9cc0..0000000000 --- a/Projections/otbImageEnvelope.cxx +++ /dev/null @@ -1,77 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#include "otbImage.h" -#include "otbImageToEnvelopeVectorDataFilter.h" -#include "otbVectorData.h" -#include "otbImageFileReader.h" -#include "otbVectorDataFileWriter.h" - -#include "otbCommandLineArgumentParser.h" - -typedef unsigned short PixelType; -typedef otb::Image<PixelType,2> ImageType; -typedef otb::ImageFileReader<ImageType> ReaderType; -typedef otb::VectorData<> VectorDataType; -typedef otb::VectorDataFileWriter<VectorDataType> WriterType; -typedef otb::ImageToEnvelopeVectorDataFilter - <ImageType,VectorDataType> FilterType; - -int main(int argc,char* argv[]) -{ - - // Parse command line parameters - typedef otb::CommandLineArgumentParser ParserType; - ParserType::Pointer parser = ParserType::New(); - - parser->SetProgramDescription("Write a vector file containing a polygon corresponding to the imate envelope."); - parser->AddInputImage(); - parser->AddOption("--OutputVectorData","Vector Data file containg the envelope.","-out",1,true); - - typedef otb::CommandLineArgumentParseResult ParserResultType; - ParserResultType::Pointer parseResult = ParserResultType::New(); - - try - { - parser->ParseCommandLine(argc,argv,parseResult); - } - catch ( itk::ExceptionObject & err ) - { - std::string descriptionException = err.GetDescription(); - if (descriptionException.find("ParseCommandLine(): Help Parser") != std::string::npos) - { - return EXIT_SUCCESS; - } - if (descriptionException.find("ParseCommandLine(): Version Parser") != std::string::npos) - { - return EXIT_SUCCESS; - } - return EXIT_FAILURE; - } - - ReaderType::Pointer reader = ReaderType::New(); - reader->SetFileName(parseResult->GetInputImage()); - FilterType::Pointer filter = FilterType::New(); - filter->SetInput(reader->GetOutput()); - WriterType::Pointer writer = WriterType::New(); - writer->SetInput(filter->GetOutput()); - writer->SetFileName(parseResult->GetParameterString("--OutputVectorData")); - writer->Update(); - - return EXIT_SUCCESS; -} -- GitLab