27 #include "../../../common/progress/ProgressManager.h" 28 #include "../../../common/StringUtils.h" 29 #include "../../../dataaccess/dataset/DataSet.h" 30 #include "../../../dataaccess/utils/Utils.h" 31 #include "../../../geometry/Utils.h" 32 #include "../../../maptools/Utils.h" 33 #include "../../../raster/Utils.h" 34 #include "../../../rp/Functions.h" 35 #include "../../../se/ChannelSelection.h" 36 #include "../../../se/CoverageStyle.h" 37 #include "../../../se/RasterSymbolizer.h" 38 #include "../../../raster/RasterSummaryManager.h" 39 #include "../../../se/Rule.h" 40 #include "../../../se/SelectedChannel.h" 41 #include "../../../se/Utils.h" 42 #include "../../widgets/tools/ExtentAcquire.h" 43 #include "../canvas/Canvas.h" 44 #include "../canvas/MapDisplay.h" 45 #include "../progress/ProgressViewerDialog.h" 46 #include "../layer/search/LayerSearchDialog.h" 47 #include "../layer/search/LayerSearchWidget.h" 50 #include "ui_ColorTransformDialogForm.h" 53 #include <QApplication> 54 #include <QGridLayout> 55 #include <QMessageBox> 62 te::qt::widgets::ColorTransformDialog::ColorTransformDialog(
QWidget* parent)
64 m_ui(new
Ui::ColorTransformDialogForm)
70 m_mapDisplay =
nullptr;
72 m_ui->m_rgb2ihsNbitsComboBox->setEnabled(
false);
73 m_ui->m_rgb2hlsNbitsComboBox->setEnabled(
false);
75 fillColorTransformTypes();
78 QGridLayout* outputLayout =
new QGridLayout(m_ui->m_outputWidget);
79 outputLayout->setContentsMargins(0, 0, 0, 0);
81 outputLayout->addWidget(m_outputWidget);
84 connect(m_ui->m_colorTransformTypeComboBox, SIGNAL(activated(
int)),
this, SLOT(colorTransformTypeComboBoxActivated(
int)));
86 connect(m_ui->m_rgbRComboBox, SIGNAL(activated(
int)),
this, SLOT(rgbRComboBoxActivated(
int)));
87 connect(m_ui->m_rgbGComboBox, SIGNAL(activated(
int)),
this, SLOT(rgbGComboBoxActivated(
int)));
88 connect(m_ui->m_rgbBComboBox, SIGNAL(activated(
int)),
this, SLOT(rgbBComboBoxActivated(
int)));
90 connect(m_ui->m_ihsIComboBox, SIGNAL(activated(
int)),
this, SLOT(ihsIComboBoxActivated(
int)));
91 connect(m_ui->m_ihsHComboBox, SIGNAL(activated(
int)),
this, SLOT(ihsHComboBoxActivated(
int)));
92 connect(m_ui->m_ihsSComboBox, SIGNAL(activated(
int)),
this, SLOT(ihsSComboBoxActivated(
int)));
94 connect(m_ui->m_rgb2hlsRComboBox, SIGNAL(activated(
int)),
this, SLOT(rgb2hlsRComboBoxActivated(
int)));
95 connect(m_ui->m_rgb2hlsGComboBox, SIGNAL(activated(
int)),
this, SLOT(rgb2hlsGComboBoxActivated(
int)));
96 connect(m_ui->m_rgb2hlsBComboBox, SIGNAL(activated(
int)),
this, SLOT(rgb2hlsBComboBoxActivated(
int)));
98 connect(m_ui->m_hlsHComboBox, SIGNAL(activated(
int)),
this, SLOT(hlsHComboBoxActivated(
int)));
99 connect(m_ui->m_hlsLComboBox, SIGNAL(activated(
int)),
this, SLOT(hlsLComboBoxActivated(
int)));
100 connect(m_ui->m_hlsSComboBox, SIGNAL(activated(
int)),
this, SLOT(hlsSComboBoxActivated(
int)));
102 connect(m_ui->m_newROIRToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
103 connect(m_ui->m_newROIGToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
104 connect(m_ui->m_newROIBToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
105 connect(m_ui->m_newROIIToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
106 connect(m_ui->m_newROIHToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
107 connect(m_ui->m_newROISToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
108 connect(m_ui->m_newROIRedToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
109 connect(m_ui->m_newROIGreenToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
110 connect(m_ui->m_newROIBlueToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
111 connect(m_ui->m_newROIHueToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
112 connect(m_ui->m_newROILightToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
113 connect(m_ui->m_newROISatToolButton, SIGNAL(clicked()),
this, SLOT(onNewROIPushButtonClicked()));
115 connect(m_ui->m_searchRLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
116 connect(m_ui->m_searchGLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
117 connect(m_ui->m_searchBLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
119 connect(m_ui->m_searchIRGBLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
120 connect(m_ui->m_searchHRGBLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
121 connect(m_ui->m_searchSRGBLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
123 connect(m_ui->m_searchRedLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
124 connect(m_ui->m_searchGreenLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
125 connect(m_ui->m_searchBlueLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
127 connect(m_ui->m_searchHueLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
128 connect(m_ui->m_searchSatLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
129 connect(m_ui->m_searchLightLayerToolButton, SIGNAL(clicked()),
this, SLOT(onSearchLayerToolButtonClicked()));
131 connect(m_ui->m_okPushButton, SIGNAL(clicked()), SLOT(onOkPushButtonClicked()));
134 m_ui->m_newROIRToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
135 m_ui->m_newROIGToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
136 m_ui->m_newROIBToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
137 m_ui->m_newROIIToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
138 m_ui->m_newROIHToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
139 m_ui->m_newROISToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
140 m_ui->m_newROIRedToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
141 m_ui->m_newROIGreenToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
142 m_ui->m_newROIBlueToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
143 m_ui->m_newROIHueToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
144 m_ui->m_newROILightToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
145 m_ui->m_newROISatToolButton->setIcon(QIcon::fromTheme(
"edit-box"));
152 int idx =
m_ui->m_colorTransformTypeComboBox->currentIndex();
154 int type =
m_ui->m_colorTransformTypeComboBox->itemData(idx).toInt();
161 int idx =
m_ui->m_colorTransformTypeComboBox->currentIndex();
163 int type =
m_ui->m_colorTransformTypeComboBox->itemData(idx).toInt();
170 int idx =
m_ui->m_colorTransformTypeComboBox->currentIndex();
172 int type =
m_ui->m_colorTransformTypeComboBox->itemData(idx).toInt();
179 int idx =
m_ui->m_colorTransformTypeComboBox->currentIndex();
181 int type =
m_ui->m_colorTransformTypeComboBox->itemData(idx).toInt();
193 m_ui->m_stackedWidget->setCurrentIndex(index);
195 if (index == 0 || index == 2)
196 m_ui->m_decomposeCheckBox->setChecked(
true);
198 m_ui->m_decomposeCheckBox->setChecked(
false);
206 QVariant varLayer =
m_ui->m_rgbRComboBox->itemData(index, Qt::UserRole);
211 std::unique_ptr<te::da::DataSetType> dsType =
m_layerR->getSchema();
213 std::unique_ptr<te::da::DataSet> dsRaster =
m_layerR->getData();
214 std::unique_ptr<te::rst::Raster> raster = dsRaster->getRaster(rasterProp->
getName());
218 const std::complex<double>* cmin = rsMin->at(0).m_minVal;
219 const std::complex<double>* cmax = rsMax->at(0).m_maxVal;
220 double min = cmin->real();
221 double max = cmax->real();
223 for (
size_t b = 1;
b < raster->getNumberOfBands();
b++)
227 const std::complex<double>* cmin = rsMin->at(
b).m_minVal;
228 const std::complex<double>* cmax = rsMax->at(
b).m_maxVal;
230 min = std::min(min, cmin->real());
231 max = std::max(max, cmax->real());
235 double range = max - min;
236 unsigned int nbits = (
unsigned int)(std::ceil(log(range) / log(2.)));
261 m_ui->m_rgb2ihsNbitsComboBox->setCurrentIndex(i);
267 QVariant varLayer =
m_ui->m_rgbGComboBox->itemData(index, Qt::UserRole);
276 QVariant varLayer =
m_ui->m_rgbBComboBox->itemData(index, Qt::UserRole);
285 QVariant varLayer =
m_ui->m_ihsIComboBox->itemData(index, Qt::UserRole);
294 QVariant varLayer =
m_ui->m_ihsHComboBox->itemData(index, Qt::UserRole);
303 QVariant varLayer =
m_ui->m_ihsSComboBox->itemData(index, Qt::UserRole);
312 QVariant varLayer =
m_ui->m_rgb2hlsRComboBox->itemData(index, Qt::UserRole);
317 std::unique_ptr<te::da::DataSetType> dsType =
m_layerR->getSchema();
319 std::unique_ptr<te::da::DataSet> dsRaster =
m_layerR->getData();
320 std::unique_ptr<te::rst::Raster> raster = dsRaster->getRaster(rasterProp->
getName());
324 const std::complex<double>* cmin = rsMin->at(0).m_minVal;
325 const std::complex<double>* cmax = rsMax->at(0).m_maxVal;
326 double min = cmin->real();
327 double max = cmax->real();
329 for (
size_t b = 1;
b < raster->getNumberOfBands();
b++)
333 const std::complex<double>* cmin = rsMin->at(
b).m_minVal;
334 const std::complex<double>* cmax = rsMax->at(
b).m_maxVal;
335 double min = cmin->real();
336 double max = cmax->real();
338 min = std::min(min, cmin->real());
339 max = std::max(max, cmax->real());
343 double range = max - min;
344 unsigned int nbits = (
unsigned int)(std::ceil(log(range) / log(2.)));
369 m_ui->m_rgb2hlsNbitsComboBox->setCurrentIndex(i);
375 QVariant varLayer =
m_ui->m_rgb2hlsGComboBox->itemData(index, Qt::UserRole);
384 QVariant varLayer =
m_ui->m_rgb2hlsBComboBox->itemData(index, Qt::UserRole);
393 QVariant varLayer =
m_ui->m_hlsHComboBox->itemData(index, Qt::UserRole);
402 QVariant varLayer =
m_ui->m_hlsLComboBox->itemData(index, Qt::UserRole);
411 QVariant varLayer =
m_ui->m_hlsSComboBox->itemData(index, Qt::UserRole);
419 if ((
m_ui->m_stackedWidget->currentIndex() == 0 && (
m_ui->m_newROIRToolButton->isChecked() ||
m_ui->m_newROIGToolButton->isChecked() ||
m_ui->m_newROIBToolButton->isChecked())) ||
420 (
m_ui->m_stackedWidget->currentIndex() == 1 && (
m_ui->m_newROIIToolButton->isChecked() ||
m_ui->m_newROIHToolButton->isChecked() ||
m_ui->m_newROISToolButton->isChecked())) ||
421 (
m_ui->m_stackedWidget->currentIndex() == 2 && (
m_ui->m_newROIRedToolButton->isChecked() ||
m_ui->m_newROIGreenToolButton->isChecked() ||
m_ui->m_newROIBlueToolButton->isChecked())) ||
422 (
m_ui->m_stackedWidget->currentIndex() == 3 && (
m_ui->m_newROIHueToolButton->isChecked() ||
m_ui->m_newROILightToolButton->isChecked() ||
m_ui->m_newROISatToolButton->isChecked())))
443 QMessageBox::information(
this, tr(
"Color Transform"), tr(
"Input image is empty."));
450 QMessageBox::information(
this, tr(
"Color Transform"), tr(
"Output image is not defined."));
456 QMessageBox::information(
this, tr(
"Color Transform"), tr(
"Error to execute the color transformation."));
472 bool needRemap =
false;
484 converter->setTargetSRID(
m_layerR->getSRID());
492 QMessageBox::warning(
this, tr(
"Warning"), tr(
"ROI is invalid."));
520 dlg->getWidget()->filterOnlyByRaster();
524 int idx =
m_ui->m_colorTransformTypeComboBox->currentIndex();
525 int type =
m_ui->m_colorTransformTypeComboBox->itemData(idx).toInt();
527 std::list<te::map::AbstractLayerPtr> layerList = dlg->getWidget()->getSelecteds();
529 if(layerList.empty())
532 std::list<te::map::AbstractLayerPtr>::iterator it = layerList.begin();
538 while(it != layerList.end())
542 std::unique_ptr<te::da::DataSetType> dst = l->getSchema();
548 if(
m_ui->m_rgbRComboBox->findText(l->getTitle().c_str()) == -1)
550 m_ui->m_rgbRComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
551 m_ui->m_rgbRComboBox->setCurrentIndex(
m_ui->m_rgbRComboBox->findText(l->getTitle().c_str()));
554 if(
m_ui->m_rgbGComboBox->findText(l->getTitle().c_str()) == -1)
556 m_ui->m_rgbGComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
557 m_ui->m_rgbGComboBox->setCurrentIndex(
m_ui->m_rgbGComboBox->findText(l->getTitle().c_str()));
560 if(
m_ui->m_rgbBComboBox->findText(l->getTitle().c_str()) == -1)
562 m_ui->m_rgbBComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
563 m_ui->m_rgbBComboBox->setCurrentIndex(
m_ui->m_rgbBComboBox->findText(l->getTitle().c_str()));
568 if(
m_ui->m_ihsIComboBox->findText(l->getTitle().c_str()) == -1)
570 m_ui->m_ihsIComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
571 m_ui->m_ihsIComboBox->setCurrentIndex(
m_ui->m_ihsIComboBox->findText(l->getTitle().c_str()));
574 if(
m_ui->m_ihsHComboBox->findText(l->getTitle().c_str()) == -1)
576 m_ui->m_ihsHComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
577 m_ui->m_ihsHComboBox->setCurrentIndex(
m_ui->m_ihsHComboBox->findText(l->getTitle().c_str()));
580 if(
m_ui->m_ihsSComboBox->findText(l->getTitle().c_str()) == -1)
582 m_ui->m_ihsSComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
583 m_ui->m_ihsSComboBox->setCurrentIndex(
m_ui->m_ihsSComboBox->findText(l->getTitle().c_str()));
588 if(
m_ui->m_rgb2hlsRComboBox->findText(l->getTitle().c_str()) == -1)
590 m_ui->m_rgb2hlsRComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
591 m_ui->m_rgb2hlsRComboBox->setCurrentIndex(
m_ui->m_rgb2hlsRComboBox->findText(l->getTitle().c_str()));
594 if(
m_ui->m_rgb2hlsGComboBox->findText(l->getTitle().c_str()) == -1)
596 m_ui->m_rgb2hlsGComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
597 m_ui->m_rgb2hlsGComboBox->setCurrentIndex(
m_ui->m_rgb2hlsGComboBox->findText(l->getTitle().c_str()));
600 if(
m_ui->m_rgb2hlsBComboBox->findText(l->getTitle().c_str()) == -1)
602 m_ui->m_rgb2hlsBComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
603 m_ui->m_rgb2hlsBComboBox->setCurrentIndex(
m_ui->m_rgb2hlsBComboBox->findText(l->getTitle().c_str()));
608 if(
m_ui->m_hlsHComboBox->findText(l->getTitle().c_str()) == -1)
610 m_ui->m_hlsHComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
611 m_ui->m_hlsHComboBox->setCurrentIndex(
m_ui->m_hlsHComboBox->findText(l->getTitle().c_str()));
614 if(
m_ui->m_hlsLComboBox->findText(l->getTitle().c_str()) == -1)
616 m_ui->m_hlsLComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
617 m_ui->m_hlsLComboBox->setCurrentIndex(
m_ui->m_hlsLComboBox->findText(l->getTitle().c_str()));
620 if(
m_ui->m_hlsSComboBox->findText(l->getTitle().c_str()) == -1)
622 m_ui->m_hlsSComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
623 m_ui->m_hlsSComboBox->setCurrentIndex(
m_ui->m_hlsSComboBox->findText(l->getTitle().c_str()));
663 QApplication::setOverrideCursor(Qt::WaitCursor);
681 if (!
m_ui->m_decomposeCheckBox->isChecked())
692 for (std::size_t t = 0; t < 3; ++t)
694 std::map<std::string, std::string> rinfo;
696 double index = (double)t + (
double)1;
708 QApplication::restoreOverrideCursor();
710 QMessageBox::information(
this, tr(
"Color Transform"), tr(
"Color Transform ended sucessfully"));
714 QApplication::restoreOverrideCursor();
716 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
721 catch (
const std::exception& e)
723 QApplication::restoreOverrideCursor();
725 QMessageBox::warning(
this, tr(
"Color Transform"), e.what());
731 QApplication::restoreOverrideCursor();
733 QMessageBox::warning(
this, tr(
"Color Transform"), tr(
"An exception has occurred!"));
747 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
748 std::vector< std::map<std::string, std::string> > outputRastersInfos;
750 if (!
m_ui->m_decomposeCheckBox->isChecked())
756 for (std::size_t t = 0; t < 3; ++t)
758 std::map<std::string, std::string> rinfo;
760 double index = (double)t + (
double)1;
762 outputRastersInfos.push_back(rinfo);
769 unsigned int rBand =
m_ui->m_rgbRBandComboBox->currentText().toUInt();
770 unsigned int gBand =
m_ui->m_rgbGBandComboBox->currentText().toUInt();
771 unsigned int bBand =
m_ui->m_rgbBBandComboBox->currentText().toUInt();
773 int nbits =
getNBits(
m_ui->m_rgb2ihsNbitsComboBox->currentIndex());
775 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
777 bool res =
te::rp::ConvertRGB2IHS(*inputRRaster, rBand, *inputGRaster, gBand, *inputBRaster, bBand, minValue, maxValue, *outputRaster);
779 std::vector<unsigned int> rasterBands;
780 rasterBands.push_back(0);
781 rasterBands.push_back(1);
782 rasterBands.push_back(2);
784 if (
m_ui->m_decomposeCheckBox->isChecked())
808 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
809 std::vector< std::map<std::string, std::string> > outputRastersInfos;
811 if (!
m_ui->m_decomposeCheckBox->isChecked())
817 for (std::size_t t = 0; t < 3; ++t)
819 std::map<std::string, std::string> rinfo;
821 double index = (double)t + (
double)1;
824 outputRastersInfos.push_back(rinfo);
831 unsigned int iBand =
m_ui->m_ihsIBandComboBox->currentText().toUInt();
832 unsigned int hBand =
m_ui->m_ihsHBandComboBox->currentText().toUInt();
833 unsigned int sBand =
m_ui->m_ihsSBandComboBox->currentText().toUInt();
835 int nbits =
getNBits(
m_ui->m_ihs2rgbNbitsComboBox->currentIndex());
839 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
841 bool res =
te::rp::ConvertIHS2RGB(*inputIRaster, iBand, *inputHRaster, hBand, *inputSRaster, sBand, minValue, maxValue, *outputRaster);
843 std::vector<unsigned int> rasterBands;
844 rasterBands.push_back(0);
845 rasterBands.push_back(1);
846 rasterBands.push_back(2);
848 if (
m_ui->m_decomposeCheckBox->isChecked())
871 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
872 std::vector< std::map<std::string, std::string> > outputRastersInfos;
874 if (!
m_ui->m_decomposeCheckBox->isChecked())
880 for (std::size_t t = 0; t < 3; ++t)
882 std::map<std::string, std::string> rinfo;
884 double index = (double)t + (
double)1;
886 outputRastersInfos.push_back(rinfo);
893 unsigned int rBand =
m_ui->m_rgb2hlsRBandComboBox->currentText().toUInt();
894 unsigned int gBand =
m_ui->m_rgb2hlsGBandComboBox->currentText().toUInt();
895 unsigned int bBand =
m_ui->m_rgb2hlsBBandComboBox->currentText().toUInt();
897 int nbits =
getNBits(
m_ui->m_rgb2hlsNbitsComboBox->currentIndex());
901 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
903 bool res =
te::rp::ConvertRGB2HLS(*inputRRaster, rBand, *inputGRaster, gBand, *inputBRaster, bBand, minValue, maxValue, *outputRaster);
905 std::vector<unsigned int> rasterBands;
906 rasterBands.push_back(0);
907 rasterBands.push_back(1);
908 rasterBands.push_back(2);
910 if (
m_ui->m_decomposeCheckBox->isChecked())
934 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
935 std::vector< std::map<std::string, std::string> > outputRastersInfos;
937 if (!
m_ui->m_decomposeCheckBox->isChecked())
943 for (std::size_t t = 0; t < 3; ++t)
945 std::map<std::string, std::string> rinfo;
947 double index = (double)t + (
double)1;
950 outputRastersInfos.push_back(rinfo);
957 unsigned int hBand =
m_ui->m_hlsHBandComboBox->currentText().toUInt();
958 unsigned int lBand =
m_ui->m_hlsLBandComboBox->currentText().toUInt();
959 unsigned int sBand =
m_ui->m_hlsSBandComboBox->currentText().toUInt();
961 int nbits =
getNBits(
m_ui->m_hls2rgbNbitsComboBox->currentIndex());
963 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
965 bool res =
te::rp::ConvertHLS2RGB(*inputHRaster, hBand, *inputLRaster, lBand, *inputSRaster, sBand, minValue, maxValue, *outputRaster);
967 std::vector<unsigned int> rasterBands;
968 rasterBands.push_back(0);
969 rasterBands.push_back(1);
970 rasterBands.push_back(2);
972 if (
m_ui->m_decomposeCheckBox->isChecked())
1002 nbits =
getNBits(
m_ui->m_ihs2rgbNbitsComboBox->currentIndex());
1004 nbits =
getNBits(
m_ui->m_hls2rgbNbitsComboBox->currentIndex());
1008 if (nbits == 10 || nbits == 16)
1010 else if (nbits == 24 || nbits == 32)
1032 std::vector<te::rst::BandProperty*>
bands;
1034 for (std::size_t t = 0; t < 3; ++t)
1038 bProp->
m_type = dataType;
1040 bands.push_back(bProp);
1042 if (t >= 2 ||
m_ui->m_decomposeCheckBox->isChecked())
1068 nbits =
getNBits(
m_ui->m_ihs2rgbNbitsComboBox->currentIndex());
1070 nbits =
getNBits(
m_ui->m_hls2rgbNbitsComboBox->currentIndex());
1074 if (nbits == 10 || nbits == 16)
1076 else if (nbits == 24 || nbits == 32)
1081 std::string type =
"MEM";
1095 std::map<std::string, std::string> info;
1096 info[
"MEM_RASTER_NROWS"] = boost::lexical_cast<std::string>(inputRaster->
getNumberOfRows());
1097 info[
"MEM_RASTER_NCOLS"] = boost::lexical_cast<std::string>(inputRaster->
getNumberOfColumns());
1098 info[
"MEM_RASTER_DATATYPE"] = boost::lexical_cast<std::string>(inputRaster->
getBandDataType(0));
1099 info[
"MEM_RASTER_NBANDS"] = boost::lexical_cast<std::string>(inputRaster->
getNumberOfBands());
1102 std::vector<te::rst::BandProperty*>
bands;
1104 for (std::size_t t = 0; t < 3; ++t)
1108 bProp->
m_type = dataType;
1110 bands.push_back(bProp);
1128 m_ui->m_colorTransformTypeComboBox->clear();
1139 if (
m_ui->m_colorTransformTypeComboBox->currentIndex() == 0)
1140 varLayer =
m_ui->m_rgbRComboBox->itemData(
m_ui->m_rgbRComboBox->currentIndex(), Qt::UserRole);
1142 varLayer =
m_ui->m_rgb2hlsRComboBox->itemData(
m_ui->m_rgb2hlsRComboBox->currentIndex(), Qt::UserRole);
1145 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1148 return ds->getRaster(rpos).release();
1154 if (
m_ui->m_colorTransformTypeComboBox->currentIndex() == 0)
1155 varLayer =
m_ui->m_rgbGComboBox->itemData(
m_ui->m_rgbGComboBox->currentIndex(), Qt::UserRole);
1157 varLayer =
m_ui->m_rgb2hlsGComboBox->itemData(
m_ui->m_rgb2hlsGComboBox->currentIndex(), Qt::UserRole);
1160 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1163 return ds->getRaster(rpos).release();
1169 if (
m_ui->m_colorTransformTypeComboBox->currentIndex() == 0)
1170 varLayer =
m_ui->m_rgbBComboBox->itemData(
m_ui->m_rgbBComboBox->currentIndex(), Qt::UserRole);
1172 varLayer =
m_ui->m_rgb2hlsBComboBox->itemData(
m_ui->m_rgb2hlsBComboBox->currentIndex(), Qt::UserRole);
1175 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1178 return ds->getRaster(rpos).release();
1183 QVariant varLayer =
m_ui->m_ihsIComboBox->itemData(
m_ui->m_ihsIComboBox->currentIndex(), Qt::UserRole);
1185 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1188 return ds->getRaster(rpos).release();
1194 if (
m_ui->m_colorTransformTypeComboBox->currentIndex() == 1)
1195 varLayer =
m_ui->m_ihsHComboBox->itemData(
m_ui->m_ihsHComboBox->currentIndex(), Qt::UserRole);
1197 varLayer =
m_ui->m_hlsHComboBox->itemData(
m_ui->m_hlsHComboBox->currentIndex(), Qt::UserRole);
1200 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1203 return ds->getRaster(rpos).release();
1209 if (
m_ui->m_colorTransformTypeComboBox->currentIndex() == 1)
1210 varLayer =
m_ui->m_ihsSComboBox->itemData(
m_ui->m_ihsSComboBox->currentIndex(), Qt::UserRole);
1212 varLayer =
m_ui->m_hlsSComboBox->itemData(
m_ui->m_hlsSComboBox->currentIndex(), Qt::UserRole);
1215 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1218 return ds->getRaster(rpos).release();
1223 QVariant varLayer =
m_ui->m_hlsLComboBox->itemData(
m_ui->m_hlsLComboBox->currentIndex(), Qt::UserRole);
1225 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1228 return ds->getRaster(rpos).release();
1263 QVariant varLayer = layer->itemData(index, Qt::UserRole);
1267 std::unique_ptr<te::da::DataSet>
ds = l->getData();
1269 std::unique_ptr<te::rst::Raster>
rst = ds->getRaster(rpos);
1276 for(std::size_t t = 0; t < rst->getNumberOfBands(); ++t)
1277 band->addItem(QString::number(t));
1285 QApplication::setOverrideCursor(Qt::WaitCursor);
1290 bool needRemap =
false;
1300 converter->setTargetSRID(
m_layerR->getSRID());
1306 std::unique_ptr<te::da::DataSetType> dsType =
m_layerR->getSchema();
1308 std::unique_ptr<te::da::DataSet> dsRasterR =
m_layerR->getData();
1309 std::unique_ptr<te::rst::Raster> rasterR = dsRasterR->getRaster(rasterProp->
getName());
1311 std::unique_ptr<te::da::DataSet> dsRasterG =
m_layerG->getData();
1312 std::unique_ptr<te::rst::Raster> rasterG = dsRasterG->getRaster(rasterProp->
getName());
1314 std::unique_ptr<te::da::DataSet> dsRasterB =
m_layerB->getData();
1315 std::unique_ptr<te::rst::Raster> rasterB = dsRasterB->getRaster(rasterProp->
getName());
1317 std::map<std::string, std::string> info;
1318 info[
"FORCE_MEM_DRIVER"] =
"TRUE";
1326 QApplication::restoreOverrideCursor();
1350 QApplication::setOverrideCursor(Qt::WaitCursor);
1356 std::string type =
"MEM";
1357 std::map<std::string, std::string> info;
1360 info[
"MEM_RASTER_DATATYPE"] = dataType;
1364 std::vector<te::rst::BandProperty*>
bands;
1366 for (std::size_t t = 0; t < 3; ++t)
1370 bProp->
m_type = dataType;
1372 bands.push_back(bProp);
1383 QApplication::restoreOverrideCursor();
1388 unsigned int rBand =
m_ui->m_rgbRBandComboBox->currentText().toUInt();
1389 unsigned int gBand =
m_ui->m_rgbGBandComboBox->currentText().toUInt();
1390 unsigned int bBand =
m_ui->m_rgbBBandComboBox->currentText().toUInt();
1392 int nbits =
getNBits(
m_ui->m_rgb2ihsNbitsComboBox->currentIndex());
1393 double minValue = 0;
1396 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
1402 QApplication::restoreOverrideCursor();
1404 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1408 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
1410 if (!
m_ui->m_newROIRToolButton->isChecked() || !
m_ui->m_newROIGToolButton->isChecked() || !
m_ui->m_newROIBToolButton->isChecked())
1412 std::vector< std::map<std::string, std::string> > outputRastersInfos;
1414 for (std::size_t t = 0; t < 3; ++t)
1416 outputRastersInfos.push_back(info);
1419 std::vector<unsigned int> rasterBands;
1420 rasterBands.push_back(0);
1421 rasterBands.push_back(1);
1422 rasterBands.push_back(2);
1425 std::string type =
"MEM";
1431 QApplication::restoreOverrideCursor();
1437 if (
m_ui->m_newROIRToolButton->isChecked() &&
m_ui->m_newROIGToolButton->isChecked() &&
m_ui->m_newROIBToolButton->isChecked())
1438 abs = outputRaster->
clone();
1439 else if (
m_ui->m_newROIRToolButton->isChecked())
1440 abs = outputRastersPtrs[0]->clone();
1441 else if (
m_ui->m_newROIGToolButton->isChecked())
1442 abs = outputRastersPtrs[1]->clone();
1443 else if (
m_ui->m_newROIBToolButton->isChecked())
1444 abs = outputRastersPtrs[2]->clone();
1454 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1457 delete outputRaster;
1465 QApplication::setOverrideCursor(Qt::WaitCursor);
1470 int nbits =
getNBits(
m_ui->m_ihs2rgbNbitsComboBox->currentIndex());
1472 if (nbits == 10 || nbits == 16)
1474 else if (nbits == 24 || nbits == 32)
1478 std::string type =
"MEM";
1479 std::map<std::string, std::string> info;
1482 info[
"MEM_RASTER_DATATYPE"] = dataType;
1486 std::vector<te::rst::BandProperty*>
bands;
1488 for (std::size_t t = 0; t < 3; ++t)
1492 bProp->
m_type = dataType;
1494 bands.push_back(bProp);
1505 QApplication::restoreOverrideCursor();
1510 unsigned int iBand =
m_ui->m_ihsIBandComboBox->currentText().toUInt();
1511 unsigned int hBand =
m_ui->m_ihsHBandComboBox->currentText().toUInt();
1512 unsigned int sBand =
m_ui->m_ihsSBandComboBox->currentText().toUInt();
1514 double minValue = 0;
1517 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
1523 QApplication::restoreOverrideCursor();
1525 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1529 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
1531 if (!
m_ui->m_newROIIToolButton->isChecked() || !
m_ui->m_newROIHToolButton->isChecked() || !
m_ui->m_newROISToolButton->isChecked())
1533 std::vector< std::map<std::string, std::string> > outputRastersInfos;
1535 for (std::size_t t = 0; t < 3; ++t)
1537 outputRastersInfos.push_back(info);
1540 std::vector<unsigned int> rasterBands;
1541 rasterBands.push_back(0);
1542 rasterBands.push_back(1);
1543 rasterBands.push_back(2);
1546 std::string type =
"MEM";
1552 QApplication::restoreOverrideCursor();
1558 if (
m_ui->m_newROIIToolButton->isChecked() &&
m_ui->m_newROIHToolButton->isChecked() &&
m_ui->m_newROISToolButton->isChecked())
1559 abs = outputRaster->
clone();
1560 else if (
m_ui->m_newROIIToolButton->isChecked())
1561 abs = outputRastersPtrs[0]->clone();
1562 else if (
m_ui->m_newROIHToolButton->isChecked())
1563 abs = outputRastersPtrs[1]->clone();
1564 else if (
m_ui->m_newROISToolButton->isChecked())
1565 abs = outputRastersPtrs[2]->clone();
1575 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1578 delete outputRaster;
1586 QApplication::setOverrideCursor(Qt::WaitCursor);
1592 std::string type =
"MEM";
1593 std::map<std::string, std::string> info;
1596 info[
"MEM_RASTER_DATATYPE"] = dataType;
1600 std::vector<te::rst::BandProperty*>
bands;
1602 for (std::size_t t = 0; t < 3; ++t)
1606 bProp->
m_type = dataType;
1608 bands.push_back(bProp);
1619 QApplication::restoreOverrideCursor();
1624 unsigned int rBand =
m_ui->m_rgb2hlsRBandComboBox->currentText().toUInt();
1625 unsigned int gBand =
m_ui->m_rgb2hlsGBandComboBox->currentText().toUInt();
1626 unsigned int bBand =
m_ui->m_rgb2hlsBBandComboBox->currentText().toUInt();
1628 int nbits =
getNBits(
m_ui->m_rgb2hlsNbitsComboBox->currentIndex());
1629 double minValue = 0;
1632 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
1638 QApplication::restoreOverrideCursor();
1640 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1644 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
1646 if (!
m_ui->m_newROIRedToolButton->isChecked() || !
m_ui->m_newROIGreenToolButton->isChecked() || !
m_ui->m_newROIBlueToolButton->isChecked())
1648 std::vector< std::map<std::string, std::string> > outputRastersInfos;
1650 for (std::size_t t = 0; t < 3; ++t)
1652 outputRastersInfos.push_back(info);
1655 std::vector<unsigned int> rasterBands;
1656 rasterBands.push_back(0);
1657 rasterBands.push_back(1);
1658 rasterBands.push_back(2);
1661 std::string type =
"MEM";
1667 QApplication::restoreOverrideCursor();
1673 if (
m_ui->m_newROIRedToolButton->isChecked() &&
m_ui->m_newROIGreenToolButton->isChecked() &&
m_ui->m_newROIBlueToolButton->isChecked())
1674 abs = outputRaster->
clone();
1675 else if (
m_ui->m_newROIRedToolButton->isChecked())
1676 abs = outputRastersPtrs[0]->clone();
1677 else if (
m_ui->m_newROIGreenToolButton->isChecked())
1678 abs = outputRastersPtrs[1]->clone();
1679 else if (
m_ui->m_newROIBlueToolButton->isChecked())
1680 abs = outputRastersPtrs[2]->clone();
1690 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1693 delete outputRaster;
1701 QApplication::setOverrideCursor(Qt::WaitCursor);
1706 int nbits =
getNBits(
m_ui->m_hls2rgbNbitsComboBox->currentIndex());
1708 if (nbits == 10 || nbits == 16)
1710 else if (nbits == 24 || nbits == 32)
1714 std::string type =
"MEM";
1715 std::map<std::string, std::string> info;
1718 info[
"MEM_RASTER_DATATYPE"] = dataType;
1722 std::vector<te::rst::BandProperty*>
bands;
1724 for (std::size_t t = 0; t < 3; ++t)
1728 bProp->
m_type = dataType;
1730 bands.push_back(bProp);
1741 QApplication::restoreOverrideCursor();
1746 unsigned int hBand =
m_ui->m_hlsHBandComboBox->currentText().toUInt();
1747 unsigned int lBand =
m_ui->m_hlsLBandComboBox->currentText().toUInt();
1748 unsigned int sBand =
m_ui->m_hlsSBandComboBox->currentText().toUInt();
1750 double minValue = 0;
1753 double maxValue = (double)(pow(2.0, (
double)nbits)) - 1;
1759 QApplication::restoreOverrideCursor();
1761 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1765 std::vector< boost::shared_ptr< te::rst::Raster > > outputRastersPtrs;
1767 if (!
m_ui->m_newROIHueToolButton->isChecked() || !
m_ui->m_newROILightToolButton->isChecked() || !
m_ui->m_newROISatToolButton->isChecked())
1769 std::vector< std::map<std::string, std::string> > outputRastersInfos;
1771 for (std::size_t t = 0; t < 3; ++t)
1773 outputRastersInfos.push_back(info);
1776 std::vector<unsigned int> rasterBands;
1777 rasterBands.push_back(0);
1778 rasterBands.push_back(1);
1779 rasterBands.push_back(2);
1782 std::string type =
"MEM";
1788 QApplication::restoreOverrideCursor();
1794 if (
m_ui->m_newROIHueToolButton->isChecked() &&
m_ui->m_newROILightToolButton->isChecked() &&
m_ui->m_newROISatToolButton->isChecked())
1795 abs = outputRaster->
clone();
1796 else if (
m_ui->m_newROIHueToolButton->isChecked())
1797 abs = outputRastersPtrs[0]->clone();
1798 else if (
m_ui->m_newROILightToolButton->isChecked())
1799 abs = outputRastersPtrs[1]->clone();
1800 else if (
m_ui->m_newROISatToolButton->isChecked())
1801 abs = outputRastersPtrs[2]->clone();
1811 QMessageBox::critical(
this, tr(
"Color Transform"), tr(
"Color Transform execution error.") + (
" " +
te::rp::Module::getLastLogStr()).c_str());
1814 delete outputRaster;
1819 QApplication::setOverrideCursor(Qt::WaitCursor);
1841 const std::complex<double>* cmin = rsMin->at(
b).m_minVal;
1842 const std::complex<double>* cmax = rsMax->at(
b).m_maxVal;
1843 double min = cmin->real();
1844 double max = cmax->real();
1851 bool cancel =
false;
1861 delete canvasInstance;
1864 QApplication::restoreOverrideCursor();
1877 canvasInstance.setPolygonContourWidth(2);
1880 canvasInstance.draw(
m_geom);
1889 canvasInstance.
clear();
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
TEDATAACCESSEXPORT te::rst::RasterProperty * GetFirstRasterProperty(const DataSetType *dt)
bool intersects(const Envelope &rhs) const
It returns true if the envelopes "spatially intersects".
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
A raster band description.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
GeomType getGeomTypeId() const _NOEXCEPT_OP(true)
It returns the geometry subclass type identifier.
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
virtual Raster * trim(const te::gm::Envelope *env, const std::map< std::string, std::string > &rinfo) const
Subsetting operation for trimming (cropping) the raster.
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
bool ConvertIHS2RGB(const te::rst::Raster &inputIHSRaster, const unsigned int intensityBandIdx, const unsigned int hueBandIdx, const unsigned int saturationBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputRGBRaster)
IHS to RGB conversion.
TESEEXPORT Style * CreateCoverageStyle(const std::vector< te::rst::BandProperty * > &properties)
Try creates an appropriate coverage style based on given band properties.
double m_min
Minimum pixel value (default is std::numeric_limits<double>::max() which means no value set)...
double m_urx
Upper right corner x-coordinate.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
static te::dt::Date ds(2010, 01, 01)
int m_type
The data type of the elements in the band ( See te::dt namespace basic data types for reference )...
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
#define TE_TR(message)
It marks a string in order to get translated.
bool DecomposeBands(const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< std::map< std::string, std::string > > &outputRastersInfos, const std::string &outputDataSourceType, std::vector< boost::shared_ptr< te::rst::Raster > > &outputRastersPtrs)
Decompose a multi-band raster into a set of one-band rasters.
double m_max
Maximum pixel value (default is std::numeric_limits<double>::max() which means no value set)...
static const std::string getLastLogStr()
Returns the last log string generated by this module.
bool ConvertRGB2IHS(const te::rst::Raster &inputRGBRaster, const unsigned int redBandIdx, const unsigned int greenBandIdx, const unsigned int blueBandIdx, const double rgbRangeMin, const double rgbRangeMax, te::rst::Raster &outputIHSRaster)
RGB to IHS conversion.
bool ConvertHLS2RGB(const te::rst::Raster &inputHLSRaster, const unsigned int hueBandIdx, const unsigned int lightBandIdx, const unsigned int saturationBandIdx, const double, const double rgbRangeMax, te::rst::Raster &outputRGBRaster)
HLS to RGB conversion.
TEMAPEXPORT void DrawRaster(te::da::DataSetType *type, te::da::DataSourcePtr ds, Canvas *canvas, const te::gm::Envelope &bbox, int bboxSRID, const te::gm::Envelope &visibleArea, int srid, te::se::CoverageStyle *style, te::map::RasterContrast *rc, const double &scale, bool *cancel)
double m_llx
Lower left corner x-coordinate.
static RasterSummaryManager & getInstance()
It returns a reference to the singleton instance.
const Envelope * getMBR() const _NOEXCEPT_OP(true)
It returns the minimum bounding rectangle for the geometry in an internal representation.
virtual bool isValid() const _NOEXCEPT_OP(false)
It tells if the geometry is well formed.
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
virtual int getSRID() const
It return the Spatial Reference System used by the Map Display.
BandProperty * getProperty()
Returns the band property.
virtual int getBandDataType(std::size_t i) const =0
Returns the data type in a particular band (or dimension).
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
boost::ptr_vector< BandSummary > RasterSummary
RasterSummary is just a typedef of a boost::ptr_vector.
virtual AbstractData * clone() const =0
It returns a clone of this object.
A base class for values that can be retrieved from the data access module.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
Grid * getGrid()
It returns the raster grid.
Utility functions for the data access module.
bool ConvertRGB2HLS(const te::rst::Raster &inputRGBRaster, const unsigned int redBandIdx, const unsigned int greenBandIdx, const unsigned int blueBandIdx, const double, const double rgbRangeMax, te::rst::Raster &outputHLSRaster)
RGB to HLS conversion.
double m_lly
Lower left corner y-coordinate.
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
TEMAPEXPORT te::rst::Raster * GetRaster(AbstractLayer *layer)
It gets the raster referenced by the given data set layer.
int getSRID() const
Returns the raster spatial reference system identifier.
double m_ury
Upper right corner y-coordinate.
static Raster * make()
It creates and returns an empty raster with default raster driver.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
A rectified grid is the spatial support for raster data.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
bool isValid() const
It tells if the rectangle is valid or not.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
const std::string & getName() const
It returns the property name.