From ec7d0904f621ed62498a4d5c1ad0ca781147eb59 Mon Sep 17 00:00:00 2001
From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
Date: Sat, 11 Jun 2011 19:15:43 -0700
Subject: [PATCH] BUG: fix type conversion

---
 Code/IO/otbVectorDataFileReader.txx | 6 +++---
 Code/IO/otbVectorDataFileWriter.txx | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/Code/IO/otbVectorDataFileReader.txx b/Code/IO/otbVectorDataFileReader.txx
index 56a71a5c7a..ab4c0848fe 100644
--- a/Code/IO/otbVectorDataFileReader.txx
+++ b/Code/IO/otbVectorDataFileReader.txx
@@ -27,6 +27,7 @@
 #include "otbVectorDataFileReader.h"
 #include "itksys/SystemTools.hxx"
 #include "otbVectorDataAdapter.h"
+#include "otbVectorData.h"
 
 namespace otb
 {
@@ -205,12 +206,11 @@ VectorDataFileReader<TOutputVectorData>
     }
 
   m_VectorDataIO->SetFileName(m_FileName.c_str());
-//  m_VectorDataIO->Read(output);
 
   // Tell the VectorDataIO to read the file
   //
-  typedef VectorDataAdapter<TOutputVectorData, TOutputVectorData> AdapterType; //tmp
-  //typedef VectorDataAdapter<VectorData<double, 3>, TOutputVectorData> AdapterType;
+
+  typedef VectorDataAdapter<VectorData<double, 2>, TOutputVectorData> AdapterType;
   typename AdapterType::InputVectorDataType::Pointer input = AdapterType::InputVectorDataType::New();
 
   m_VectorDataIO->Read(input);
diff --git a/Code/IO/otbVectorDataFileWriter.txx b/Code/IO/otbVectorDataFileWriter.txx
index 00c98d701d..872806b90e 100644
--- a/Code/IO/otbVectorDataFileWriter.txx
+++ b/Code/IO/otbVectorDataFileWriter.txx
@@ -23,6 +23,7 @@
 #include "otbVectorDataFileWriter.h"
 #include "otbVectorDataIOFactory.h"
 #include "otbVectorDataAdapter.h"
+#include "otbVectorData.h"
 
 namespace otb
 {
@@ -190,14 +191,12 @@ VectorDataFileWriter<TInputVectorData>
   //
   m_VectorDataIO->SetFileName(m_FileName.c_str());
 
-  typedef VectorDataAdapter<TInputVectorData,TInputVectorData > AdapterType; //tmp
-  //typedef VectorDataAdapter<TInputVectorData, VectorData<double, 3> > AdapterType;
+  typedef VectorDataAdapter<TInputVectorData, VectorData<double, 2> > AdapterType;
   typename AdapterType::Pointer adapter = AdapterType::New();
   adapter->SetInput(input);
   adapter->Update();
   m_VectorDataIO->Write(adapter->GetOutput());
 
-  //m_VectorDataIO->Write(input);
 }
 
 template <class TInputVectorData>
-- 
GitLab