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;
103 itkSetMacro(AllTouchedMode,
bool);
104 itkGetConstReferenceMacro(AllTouchedMode,
bool);
105 itkBooleanMacro(AllTouchedMode);
122 unsigned int previousBandVectorSize = m_BandsToBurn.size();
123 if (previousBandVectorSize != 0)
125 if (burnValuesPix.Size() != previousBandVectorSize)
127 itkExceptionMacro(<<
"The color added does not have the same number of elements than the previous "
129 <<
"( Previous color size : " << previousBandVectorSize <<
", new one size :" << burnValuesPix.Size() <<
")");
137 m_BandsToBurn.clear();
138 for (
unsigned int idx = 0; idx < burnValuesPix.Size(); ++idx)
140 m_BandsToBurn.push_back(idx + 1);
141 m_BurnValues.push_back(
static_cast<double>(burnValuesPix.GetElement(idx)));
146 void GenerateData()
override;
151 if (m_OGRDataSourcePointer !=
nullptr)
153 GDALClose(m_OGRDataSourcePointer);
157 void GenerateOutputInformation()
override;
159 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
163 void operator=(
const Self&) =
delete;
180 #ifndef OTB_MANUAL_INSTANTIATION