Commit 7661fed4 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

TEST: VectorDataToImageFilter test

parent 6f840247
......@@ -24,6 +24,9 @@ SET(COMMON_TESTS5 ${CXX_TEST_PATH}/otbCommonTests5)
SET(COMMON_TESTS6 ${CXX_TEST_PATH}/otbCommonTests6)
SET(COMMON_TESTS7 ${CXX_TEST_PATH}/otbCommonTests7)
SET(COMMON_TESTS8 ${CXX_TEST_PATH}/otbCommonTests8)
IF(OTB_USE_MAPNIK)
SET(COMMON_TESTS9 ${CXX_TEST_PATH}/otbCommonTests9)
ENDIF(OTB_USE_MAPNIK)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbCommonTests1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -699,6 +702,31 @@ ADD_TEST(coTuVectorImageToASImageAdaptorNew ${COMMON_TESTS8}
)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbCommonTests9 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF(OTB_USE_MAPNIK)
# ------------- otb::QuickLookImageGenerator ----------------------------
ADD_TEST(coTuVectorDataToImageFilterNew ${COMMON_TESTS9}
otbVectorDataToImageFilterNew
)
IF(OTB_DATA_USE_LARGEINPUT)
ADD_TEST(coTvVectorDataToImageFilter ${COMMON_TESTS9}
--compare-image ${TOL}
${BASELINE}/coTvVectorDataToImageFilter.png
${TEMP}/coTvVectorDataToImageFilter.png
otbVectorDataToImageFilter
${LARGEDATA}/VECTOR/MidiPyrenees/roads.shp
${TEMP}/coTvVectorDataToImageFilter.png
)
ENDIF(OTB_DATA_USE_LARGEINPUT)
ENDIF(OTB_USE_MAPNIK)
# ------- Fichiers sources CXX -----------------------------------
SET(BasicCommon_SRCS1
otbSystemTest.cxx
......@@ -803,6 +831,14 @@ otbImageRegionNonUniformMultidimensionalSplitter.cxx
otbVectorImageToASImageAdaptorNew.cxx
)
IF(OTB_USE_MAPNIK)
SET(BasicCommon_SRCS9
otbVectorDataToImageFilterNew.cxx
otbVectorDataToImageFilter.cxx
)
ENDIF(OTB_USE_MAPNIK)
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
# ${TIFF_LIBRARY}
......@@ -831,4 +867,10 @@ TARGET_LINK_LIBRARIES(otbCommonTests7 OTBIO)
ADD_EXECUTABLE(otbCommonTests8 otbCommonTests8.cxx ${BasicCommon_SRCS8})
TARGET_LINK_LIBRARIES(otbCommonTests8 OTBIO)
IF(OTB_USE_MAPNIK)
ADD_EXECUTABLE(otbCommonTests9 otbCommonTests9.cxx ${BasicCommon_SRCS9})
#TODO this line should be refined when we will like to have this capability with windows
TARGET_LINK_LIBRARIES(otbCommonTests9 OTBIO ${MAPNIK_LIBRARY}/libmapnik.so)
ENDIF(OTB_USE_MAPNIK)
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
/*=========================================================================
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.
=========================================================================*/
// this file defines the otbCommonTest for the test driver
// and all it expects is that you have a function called RegisterTests
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(otbVectorDataToImageFilterNew);
REGISTER_TEST(otbVectorDataToImageFilter);
}
/*=========================================================================
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 "otbVectorDataFileReader.h"
#include "otbImageFileWriter.h"
#include "otbVectorData.h"
......@@ -14,7 +32,7 @@
// ./mapnikOTBClasses ~/OTB/trunk/OTB-Data/Input/ToulouseRoad-examples.shp output.png
// ./mapnikOTBClasses ~/OTB/trunk/OTB-Data/LargeInput/VECTOR/MidiPyrenees/roads.shp output.png
int main(int argc, char * argv[])
int otbVectorDataToImageFilter(int argc, char * argv[])
{
//Read the vector data
......
/*=========================================================================
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 "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbVectorData.h"
#include "otbVectorDataToImageFilter.h"
int otbVectorDataToImageFilterNew(int argc, char * argv[])
{
typedef otb::VectorData<> VectorDataType;
typedef itk::RGBAPixel< unsigned char > PixelType;
typedef otb::Image<PixelType,2> ImageType;
typedef otb::VectorDataToImageFilter<VectorDataType, ImageType> VectorDataToImageFilterType;
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
return EXIT_SUCCESS;
}
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