Commit 0e224d75 authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

COMP: Init KML class and testing.

parent 597be480
......@@ -277,7 +277,13 @@ folder->SetField(field->GetNameRef(),feature->GetFieldAsString(fieldIndex));
template<class TData>
void KMLVectorDataIO<TData>::Write(const VectorDataConstPointerType data)
{
//Create the factory
/* KmlFactory* factory = KmlFactory::GetFactory();
if(factory == NULL)
{
itkExceptionMacro(<<"Impossible to create the KML Factory to write file "<<this->m_FileName);
}
*/
/*
// // try to create an ogr driver
OGRSFDriver * ogrDriver = OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName("ESRI Shapefile");
......
......@@ -31,7 +31,7 @@ KMLVectorDataIOFactory<TData>::KMLVectorDataIOFactory()
{
this->RegisterOverride("otbVectorDataIOBase",
"otbKMLVectorDataIO",
"SHP Vectordata IO",
"KML Vectordata IO",
1,
itk::CreateObjectFunction<KMLVectorDataIO<TData> >::New());
}
......@@ -49,7 +49,7 @@ template<class TData>
const char*
KMLVectorDataIOFactory<TData>::GetDescription() const
{
return "SHP VectorDataIO Factory, allows the loading of SHP vector data into OTB";
return "KML VectorDataIO Factory, allows the loading of KML vector data into OTB";
}
} // end namespace otb
......
......@@ -24,6 +24,7 @@
#include "otbVectorDataIOFactory.h"
#include "otbSHPVectorDataIOFactory.h"
#include "otbKMLVectorDataIOFactory.h"
#include "itkObjectFactoryBase.h"
#include "itkMutexLock.h"
#include "itkMutexLockHolder.h"
......@@ -91,7 +92,7 @@ VectorDataIOFactory<TData>
if( firstTime )
{
itk::ObjectFactoryBase::RegisterFactory( SHPVectorDataIOFactory<TData>::New() );
// itk::ObjectFactoryBase::RegisterFactory( KMLVectorDataIOFactory::New() );
itk::ObjectFactoryBase::RegisterFactory( KMLVectorDataIOFactory<TData>::New() );
firstTime = false;
}
}
......
......@@ -1401,7 +1401,7 @@ ADD_TEST(ioTuVectorDataFileWriterNew ${IO_TESTS15}
# If the file exists, try remove it to prevent test failure
FILE(REMOVE ${TEMP}/ioTvVectorDataFileWriterOutput.shp)
ADD_TEST(ioTvVectorDataFileWriter ${IO_TESTS15}
ADD_TEST(ioTvSHPVectorDataFileWriter ${IO_TESTS15}
otbVectorDataFileWriter
${TEMP}/ioTvVectorDataFileWriterOutput.shp
)
......@@ -1409,7 +1409,7 @@ ADD_TEST(ioTvVectorDataFileWriter ${IO_TESTS15}
# If the file exists, try remove it to prevent test failure
FILE(REMOVE ${TEMP}/ioTvVectorDataFileReaderWriterOutput.shp)
ADD_TEST(ioTvVectorDataFileReaderWriter ${IO_TESTS15}
ADD_TEST(ioTvSHPVectorDataFileReaderWriter ${IO_TESTS15}
otbVectorDataFileReaderWriter
${IMAGEDATA}/TOULOUSE/QuickBird/GIS_FILES/000000128955_01_ORDER_SHAPE.shp
${TEMP}/ioTvVectorDataFileReaderWriterOutput.shp
......@@ -1428,6 +1428,18 @@ ADD_TEST(ioTuKMLVectorDataIOCanWrite ${IO_TESTS15}
otbKMLVectorDataIOTestCanWrite
${TEMP}/simple.kml)
ADD_TEST(ioTvKMLVectorDataFileReader ${IO_TESTS15}
# --compare-ascii ${TOL} ${BASELINE_FILES}/ioSHPVectorDataFileReader.txt
# ${TEMP}/ioSHPVectorDataFileReader.txt
otbVectorDataFileReader
${INPUTDATA}/TOULOUSE/QuickBird/GIS_FILES/000000128955_01_ORDER_SHAPE.shp
${TEMP}/ioSHPVectorDataFileReader.txt)
ADD_TEST(ioTvKMLVectorDataFileWriter ${IO_TESTS15}
otbVectorDataFileWriter
${TEMP}/ioKMLVectorDataFileWriterOutput.kml
)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbIOTESTS16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment