#include "otbVectorDataFileReader.h" #include "otbImageFileWriter.h" #include "otbVectorData.h" #include "otbVectorDataProjectionFilter.h" #include #include #include "itkRGBAPixel.h" #include "otbImage.h" #include "otbVectorDataToImageFilter.h" int main(int argc, char * argv[]) { //Read the vector data typedef otb::VectorData<> VectorDataType; typedef otb::VectorDataFileReader VectorDataFileReaderType; VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New(); reader->SetFileName(argv[1]); //Reproject the vector data in the proper projection typedef otb::VectorDataProjectionFilter ProjectionFilterType; ProjectionFilterType::Pointer projection = ProjectionFilterType::New(); projection->SetInput(reader->GetOutput()); // projection->Update(); //Convert the vector data into an image typedef itk::RGBAPixel< unsigned char > PixelType; typedef otb::Image ImageType; typedef otb::VectorDataToImageFilter VectorDataToImageFilterType; VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New(); vectorDataRendering->SetInput(projection->GetOutput()); //Save the image in a file typedef otb::ImageFileWriter WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(vectorDataRendering); writer->SetFileName(argv[2]); writer->Update(); return EXIT_SUCCESS; }