21 #ifndef otbRasterizeVectorDataFilter_h
22 #define otbRasterizeVectorDataFilter_h
24 #include "itkUnaryFunctorImageFilter.h"
25 #include "itkImageToImageFilter.h"
26 #include "itkCastImageFilter.h"
33 #include "ogr_srs_api.h"
62 template <
class TVectorData,
class TInputImage,
class TOutputImage = TInputImage>
68 typedef itk::CastImageFilter<TInputImage, TOutputImage>
Superclass;
100 itkSetMacro(AllTouchedMode,
bool);
101 itkGetConstReferenceMacro(AllTouchedMode,
bool);
102 itkBooleanMacro(AllTouchedMode);
119 unsigned int previousBandVectorSize = m_BandsToBurn.size();
120 if (previousBandVectorSize != 0)
122 if (burnValuesPix.Size() != previousBandVectorSize)
124 itkExceptionMacro(<<
"The color added does not have the same number of elements than the previous "
126 <<
"( Previous color size : " << previousBandVectorSize <<
", new one size :" << burnValuesPix.Size() <<
")");
134 m_BandsToBurn.clear();
135 for (
unsigned int idx = 0; idx < burnValuesPix.Size(); ++idx)
137 m_BandsToBurn.push_back(idx + 1);
138 m_BurnValues.push_back(
static_cast<double>(burnValuesPix.GetElement(idx)));
143 void GenerateData()
override;
148 if (m_OGRDataSourcePointer !=
nullptr)
150 GDALClose(m_OGRDataSourcePointer);
154 void GenerateOutputInformation()
override;
156 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
177 #ifndef OTB_MANUAL_INSTANTIATION
Burn geometries from the specified VectorData into raster.
OutputImageType::RegionType OutputImageRegionType
const DataObjectType * GetInput(unsigned int idx)
std::vector< double > m_FullBurnValues
TInputImage InputImageType
InputImageType::PixelType InputImagePixelType
OutputImageType::Pointer OutputImagePointer
std::vector< OGRLayerH > m_SrcDataSetLayers
OutputImageType::PixelType OutputImagePixelType
InputImageType::ConstPointer InputImagePointer
const InputImageType * GetInput()
itk::CastImageFilter< TInputImage, TOutputImage > Superclass
TVectorData VectorDataType
itk::DataObject DataObjectType
~RasterizeVectorDataFilter() override
RasterizeVectorDataFilter Self
VectorDataType::DataNodePointerType DataNodePointerType
std::vector< double > m_BurnValues
RasterizeVectorDataFilter(const Self &)=delete
GDALDataset * m_OGRDataSourcePointer
OutputImageType::InternalPixelType OutputImageInternalPixelType
itk::SmartPointer< Self > Pointer
std::vector< int > m_BandsToBurn
itk::SmartPointer< const Self > ConstPointer
InputImageType::PointType InputPointType
void operator=(const Self &)=delete
TOutputImage OutputImageType
InputImageType::IndexType InputIndexType
InputImageType::RegionType InputImageRegionType
void AddColor(const OutputImagePixelType &burnValuesPix)
VectorDataType::DataTreeType DataTreeType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.