RasterToVectorDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/attributefill/RasterToVectorDialog.cpp
22 
23  \brief Raster to vector attributefill dialog.
24 */
25 
26 // TerraLib
27 #include "../../core/filesystem/FileSystem.h"
28 #include "../../core/logger/Logger.h"
29 #include "../../core/translator/Translator.h"
30 #include "../../common/progress/ProgressManager.h"
31 #include "../../dataaccess/dataset/DataSetTypeConverter.h"
32 #include "../../dataaccess/datasource/DataSourceInfoManager.h"
33 #include "../../dataaccess/datasource/DataSourceFactory.h"
34 #include "../../dataaccess/datasource/DataSourceManager.h"
35 #include "../../dataaccess/utils/Utils.h"
36 #include "../../datatype/Enums.h"
37 #include "../../geometry/GeometryProperty.h"
38 #include "../../maptools/AbstractLayer.h"
39 #include "../../qt/widgets/datasource/selector/DataSourceSelectorDialog.h"
40 #include "../../qt/widgets/layer/utils/DataSet2Layer.h"
41 #include "../../qt/widgets/progress/ProgressViewerDialog.h"
42 #include "../../qt/widgets/Utils.h"
43 #include "../../qt/widgets/utils/FileDialog.h"
44 #include "../../raster/Band.h"
45 #include "../../raster/BandProperty.h"
46 #include "../../raster/Grid.h"
47 #include "../../raster/RasterProperty.h"
48 #include "../Config.h"
49 #include "../Exception.h"
50 #include "../RasterToVector.h"
51 #include "RasterToVectorDialog.h"
52 #include "ui_RasterToVectorDialogForm.h"
53 
54 // Qt
55 #include <QFileDialog>
56 #include <QIntValidator>
57 #include <QMessageBox>
58 
59 // Boost
60 #include <boost/filesystem.hpp>
61 #include <boost/lexical_cast.hpp>
62 #include <boost/uuid/random_generator.hpp>
63 #include <boost/uuid/uuid_io.hpp>
64 
66  : QDialog(parent, f),
67  m_ui(new Ui::RasterToVectorDialogForm),
68  m_layers(std::list<te::map::AbstractLayerPtr>())
69 {
70  // add controls
71  m_ui->setupUi(this);
72 
73  m_ui->m_noDataLineEdit->setValidator( new QIntValidator);
74 
75  // add icons
76  m_ui->m_imgLabel->setPixmap(QIcon::fromTheme("raster-vector-hint").pixmap(112,48));
77  m_ui->m_targetDatasourceToolButton->setIcon(QIcon::fromTheme("datasource"));
78 
79  connect(m_ui->m_inRasterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onRasterComboBoxChanged(int)));
80  connect(m_ui->m_inVectorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onVectorComboBoxChanged(int)));
81 
82  connect(m_ui->m_noDataCheckBox, SIGNAL(toggled(bool)), m_ui->m_noDataLineEdit, SLOT(setEnabled(bool)));
83 
84  connect(m_ui->m_targetDatasourceToolButton, SIGNAL(pressed()), this, SLOT(onTargetDatasourceToolButtonPressed()));
85  connect(m_ui->m_targetFileToolButton, SIGNAL(pressed()), this, SLOT(onTargetFileToolButtonPressed()));
86 
87  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
88  connect(m_ui->m_cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancelPushButtonClicked()));
89 
90  m_ui->m_helpPushButton->setNameSpace("dpi.inpe.br.plugins");
91  m_ui->m_helpPushButton->setPageReference("plugins/attributefill/attrfill_raster_to_vector.html");
92 
93 }
94 
96 
97 void te::attributefill::RasterToVectorDialog::setLayers(std::list<te::map::AbstractLayerPtr> layers)
98 {
99  m_layers = layers;
100 
101  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
102 
103  while(it != m_layers.end())
104  {
105  std::unique_ptr<te::da::DataSetType> dsType = it->get()->getSchema();
106  if (dsType->hasRaster())
107  {
108  m_ui->m_inRasterComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
109  }
110  if (dsType->hasGeom())
111  {
112  te::gm::GeometryProperty* geomProp = te::da::GetFirstGeomProperty(dsType.get());
113  if (geomProp->getGeometryType() == te::gm::PolygonType ||
114  geomProp->getGeometryType() == te::gm::MultiPolygonType ||
115  geomProp->getGeometryType() == te::gm::PointType ||
117  {
118  m_ui->m_inVectorComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
119  }
120  }
121  ++it;
122  }
123 }
124 
126 {
127  return m_outLayer;
128 }
129 
131 {
132  std::vector<unsigned int> vecBands;
133 
134  for(int i = 0; i < m_ui->m_bandsListWidget->count(); ++i)
135  {
136  if(m_ui->m_bandsListWidget->isItemSelected(m_ui->m_bandsListWidget->item(i)))
137  {
138  vecBands.push_back(i);
139  }
140  }
141  return vecBands;
142 }
143 
144 std::vector<te::stat::StatisticalSummary> te::attributefill::RasterToVectorDialog::getSelectedStatistics()
145 {
146  std::vector<te::stat::StatisticalSummary> vecStatistics;
147 
148  for(int i = 0; i < m_ui->m_statisticsListWidget->count(); ++i)
149  {
150  if(m_ui->m_statisticsListWidget->isItemSelected(m_ui->m_statisticsListWidget->item(i)))
151  {
152  switch(i)
153  {
154  case 0:
155  vecStatistics.push_back(te::stat::MIN_VALUE);
156  break;
157  case 1:
158  vecStatistics.push_back(te::stat::MAX_VALUE);
159  break;
160  case 2:
161  vecStatistics.push_back(te::stat::MEAN);
162  break;
163  case 3:
164  vecStatistics.push_back(te::stat::SUM);
165  break;
166  case 4:
167  vecStatistics.push_back(te::stat::COUNT);
168  break;
169  case 5:
170  vecStatistics.push_back(te::stat::VALID_COUNT);
171  break;
172  case 6:
173  vecStatistics.push_back(te::stat::STANDARD_DEVIATION);
174  break;
175  case 7:
176  vecStatistics.push_back(te::stat::VARIANCE);
177  break;
178  case 8:
179  vecStatistics.push_back(te::stat::SKEWNESS);
180  break;
181  case 9:
182  vecStatistics.push_back(te::stat::KURTOSIS);
183  break;
184  case 10:
185  vecStatistics.push_back(te::stat::AMPLITUDE);
186  break;
187  case 11:
188  vecStatistics.push_back(te::stat::MEDIAN);
189  break;
190  case 12:
191  vecStatistics.push_back(te::stat::VAR_COEFF);
192  break;
193  case 13:
194  vecStatistics.push_back(te::stat::MODE);
195  break;
196  case 14:
197  vecStatistics.push_back(te::stat::PERCENT_EACH_CLASS_BY_AREA);
198  break;
199  default:
200  continue;
201  }
202  }
203  }
204  return vecStatistics;
205 }
206 
208 {
209  return !m_ui->m_statisticsListWidget->selectedItems().isEmpty();
210 }
211 
213 {
214  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
215 
216  std::string layerID = m_ui->m_inRasterComboBox->itemData(index, Qt::UserRole).toString().toUtf8().data();
217 
218  while(it != m_layers.end())
219  {
220  if(layerID == it->get()->getId())
221  m_rasterLayer = it->get();
222 
223  ++it;
224  }
225 
226  m_ui->m_bandsListWidget->clear();
227 
228  std::unique_ptr<te::da::DataSetType> dsType = m_rasterLayer->getSchema();
229  std::unique_ptr<te::da::DataSet> dsRaster = m_rasterLayer->getData();
230 
231  te::rst::RasterProperty* rasterProp = te::da::GetFirstRasterProperty(dsType.get());
232 
233  std::unique_ptr<te::rst::Raster> raster = dsRaster->getRaster(rasterProp->getName());
234  std::size_t n_bands = raster->getNumberOfBands();
235 
236  double noDataValue = raster->getBand(0)->getProperty()->m_noDataValue;
237 
238  if(noDataValue == std::numeric_limits<double>::max())
239  {
240  m_ui->m_noDataLineEdit->setText(
241  boost::lexical_cast<std::string>(noDataValue).c_str());
242  }
243 
244  for(std::size_t b = 0; b < n_bands; ++b)
245  m_ui->m_bandsListWidget->addItem(boost::lexical_cast<std::string>(b).c_str());
246 
247 }
248 
250 {
251  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
252 
253  std::string layerID = m_ui->m_inVectorComboBox->itemData(index, Qt::UserRole).toString().toUtf8().data();
254 
255  while(it != m_layers.end())
256  {
257  if(layerID == it->get()->getId())
258  {
259  m_vectorLayer = it->get();
260  std::unique_ptr<te::da::DataSetType> dsType = it->get()->getSchema();
261 
262  m_ui->m_statisticsListWidget->clear();
263 
264  te::gm::GeometryProperty* geomProp = te::da::GetFirstGeomProperty(dsType.get());
265 
267  {
268  m_ui->m_statisticsListWidget->addItem("Minimum value");
269  m_ui->m_statisticsListWidget->addItem("Maximum value");
270  m_ui->m_statisticsListWidget->addItem("Mean");
271  m_ui->m_statisticsListWidget->addItem("Sum of values");
272  m_ui->m_statisticsListWidget->addItem("Total number of values");
273  m_ui->m_statisticsListWidget->addItem("Total not null values");
274  m_ui->m_statisticsListWidget->addItem("Standard deviation");
275  m_ui->m_statisticsListWidget->addItem("Variance");
276  m_ui->m_statisticsListWidget->addItem("Skewness");
277  m_ui->m_statisticsListWidget->addItem("Kurtosis");
278  m_ui->m_statisticsListWidget->addItem("Amplitude");
279  m_ui->m_statisticsListWidget->addItem("Median");
280  m_ui->m_statisticsListWidget->addItem("Coefficient variation");
281  m_ui->m_statisticsListWidget->addItem("Mode");
282  m_ui->m_statisticsListWidget->addItem("Percent of each class by area");
283 
284  m_isStatistical = true;
285  m_ui->m_textureCheckBox->setEnabled(true);
286  }
287  else
288  {
289  m_ui->m_statisticsListWidget->addItem("Value");
290 
291  m_isStatistical = false;
292  m_ui->m_textureCheckBox->setChecked(false);
293  m_ui->m_textureCheckBox->setEnabled(false);
294  }
295  }
296  ++it;
297  }
298 }
299 
301 {
302  m_ui->m_newLayerNameLineEdit->clear();
303  m_ui->m_newLayerNameLineEdit->setEnabled(true);
305  dlg.exec();
306 
307  std::list<te::da::DataSourceInfoPtr> dsPtrList = dlg.getSelecteds();
308 
309  if(dsPtrList.empty())
310  return;
311 
312  std::list<te::da::DataSourceInfoPtr>::iterator it = dsPtrList.begin();
313 
314  m_ui->m_repositoryLineEdit->setText(QString(it->get()->getTitle().c_str()));
315 
316  m_outputDatasource = *it;
317 
318  m_toFile = false;
319 }
320 
322 {
323  m_ui->m_newLayerNameLineEdit->clear();
324  m_ui->m_repositoryLineEdit->clear();
325 
327 
328  try {
329  fileDialog.exec();
330  }
331  catch (te::common::Exception& ex) {
332  QMessageBox::warning(this, tr("File information"), ex.what());
333  return;
334  }
335 
336  m_ui->m_repositoryLineEdit->setText(fileDialog.getPath().c_str());
337  m_ui->m_newLayerNameLineEdit->setText(fileDialog.getFileName().c_str());
338 
339  m_toFile = true;
340  m_ui->m_newLayerNameLineEdit->setEnabled(false);
341 }
342 
344 {
345  if(m_ui->m_inRasterComboBox->count() == 0)
346  {
347  QMessageBox::information(this, tr("Raster to Vector"), tr("Select an input raster layer."));
348  return;
349  }
350 
351  if(m_ui->m_inVectorComboBox->count() == 0)
352  {
353  QMessageBox::information(this, tr("Raster to Vector"), tr("Select an input vector layer."));
354  return;
355  }
356 
357  std::unique_ptr<te::da::DataSet> rasterDataSet = m_rasterLayer->getData();
358 
359  std::size_t rpos = te::da::GetFirstPropertyPos(rasterDataSet.get(), te::dt::RASTER_TYPE);
360 
361  std::unique_ptr<te::rst::Raster> inputRst = rasterDataSet->getRaster(rpos);
362 
363  std::string sridMessage;
364  bool isValidSRIDs = te::qt::widgets::isValidSRIDs(m_rasterLayer->getSRID(), m_vectorLayer->getSRID(), sridMessage);
365 
366  if (!isValidSRIDs)
367  {
368  QMessageBox::information(this, tr("Raster to Vector"), sridMessage.c_str());
369  return;
370  }
371 
372  inputRst->getGrid()->setSRID(m_rasterLayer->getSRID());
373 
374  if(m_ui->m_noDataCheckBox->isChecked())
375  {
376  if(!m_ui->m_noDataLineEdit->text().isEmpty())
377  {
378  double noDataValue = m_ui->m_noDataLineEdit->text().toDouble();
379  te::rst::BandProperty* bProp = inputRst->getBand(0)->getProperty();
380  bProp->m_noDataValue = noDataValue;
381  }
382  }
383 
384  te::map::DataSetLayer* dsVectorLayer = dynamic_cast<te::map::DataSetLayer*>(m_vectorLayer.get());
385 
386  if(!dsVectorLayer)
387  {
388  QMessageBox::information(this, tr("Raster to Vector"), tr("Can not execute this operation on this type of layer."));
389  return;
390  }
391 
392  const te::da::ObjectIdSet* oidSet = nullptr;
393 
394  if(m_ui->m_onlySelectedCheckBox->isChecked())
395  {
396  oidSet = dsVectorLayer->getSelected();
397  if(!oidSet)
398  {
399  QMessageBox::information(this, tr("Raster to Vector"), tr("Select the layer objects to perform the raster to vector operation."));
400  return;
401  }
402  }
403 
404  te::da::DataSourcePtr inVectorDataSource = te::da::GetDataSource(dsVectorLayer->getDataSourceId(), true);
405  if (!inVectorDataSource.get())
406  {
407  QMessageBox::information(this, tr("Raster to Vector"), tr("The selected vector data source can not be accessed."));
408  return;
409  }
410 
411  std::vector<unsigned int> vecBands = getSelectedBands();
412  if(vecBands.empty())
413  {
414  QMessageBox::information(this, tr("Raster to Vector"), tr("Select at least one band."));
415  return;
416  }
417 
418  std::vector<te::stat::StatisticalSummary> vecStatistics;
419 
420  if (m_isStatistical)
421  vecStatistics = getSelectedStatistics();
422 
423  m_texture = m_ui->m_textureCheckBox->isChecked();
424 
425  bool isValueOptionSelected = getValueOption();
426 
427  if (isValueOptionSelected == false && vecStatistics.empty() && m_texture == false)
428  {
429  QMessageBox::information(this, tr("Raster to Vector"), tr("Select at least one statistic operation or select the texture checkbox."));
430  return;
431  }
432 
433  if(m_ui->m_repositoryLineEdit->text().isEmpty())
434  {
435  QMessageBox::information(this, tr("Raster to Vector"), tr("Define a repository for the result."));
436  return;
437  }
438 
439  if(m_ui->m_newLayerNameLineEdit->text().isEmpty())
440  {
441  QMessageBox::information(this, tr("Raster to Vector"), tr("Define a name for the resulting layer."));
442  return;
443  }
444 
445  std::string outputdataset = m_ui->m_newLayerNameLineEdit->text().toUtf8().data();
446 
447  //progress
449 
450  try
451  {
452  bool res;
453 
454  if(m_toFile)
455  {
456  boost::filesystem::path uri(m_ui->m_repositoryLineEdit->text().toUtf8().data());
457 
458  if (te::core::FileSystem::exists(uri.string()))
459  {
460  QMessageBox::information(this, tr("Raster to Vector"), tr("Output file already exists. Remove it or select a new name and try again."));
461  return;
462  }
463 
464  std::size_t idx = outputdataset.find(".");
465  if (idx != std::string::npos)
466  outputdataset=outputdataset.substr(0,idx);
467 
468  std::string dsinfo("file://" + uri.string());
469 
470  te::da::DataSourcePtr dsOGR(te::da::DataSourceFactory::make("OGR", dsinfo).release());
471  dsOGR->open();
472  if (dsOGR->dataSetExists(outputdataset))
473  {
474  QMessageBox::information(this, tr("Raster to Vector"), tr("There is already a dataset with the requested name in the output data source. Remove it or select a new name and try again."));
475  return;
476  }
477 
478  std::unique_ptr<te::da::DataSetTypeConverter> converterVector(
479  new te::da::DataSetTypeConverter(m_vectorLayer->getSchema().get(),
480  inVectorDataSource->getCapabilities(),
481  inVectorDataSource->getEncoding()));
482 
483  te::da::AssociateDataSetTypeConverterSRID(converterVector.get(), m_vectorLayer->getSRID());
484 
485  this->setCursor(Qt::WaitCursor);
486 
488  rst2vec->setInput(inputRst.get(),
489  inVectorDataSource,
490  dsVectorLayer->getDataSetName(),
491  converterVector.release(),
492  oidSet);
493 
494  rst2vec->setParams(vecBands,
495  vecStatistics,
496  m_ui->m_boxPixelRadioButton->isChecked(),
497  m_texture);
498 
499  rst2vec->setOutput(dsOGR, outputdataset);
500 
501  if (!rst2vec->paramsAreValid())
502  res = false;
503  else
504  res = rst2vec->run();
505 
506  if (!res)
507  {
508  this->setCursor(Qt::ArrowCursor);
509  dsOGR->close();
510  QMessageBox::information(this, tr("Raster to Vector"), tr("Error: could not generate the operation."));
511  reject();
512  }
513  dsOGR->close();
514 
515  delete rst2vec;
516 
517  // let's include the new datasource in the managers
518  boost::uuids::basic_random_generator<boost::mt19937> gen;
519  boost::uuids::uuid u = gen();
520  std::string id_ds = boost::uuids::to_string(u);
521 
523  ds->setConnInfo(dsinfo);
524  ds->setTitle(uri.stem().string());
525  ds->setAccessDriver("OGR");
526  ds->setType("OGR");
527  ds->setDescription(uri.string());
528  ds->setId(id_ds);
529 
530  te::da::DataSourcePtr newds = te::da::DataSourceManager::getInstance().get(id_ds, "OGR", ds->getConnInfo());
531  newds->open();
534  }
535  else
536  {
538  if (!aux)
539  {
540  QMessageBox::information(this, tr("Raster to Vector"), tr("The selected output datasource can not be accessed."));
541  return;
542  }
543 
544  if (aux->dataSetExists(outputdataset))
545  {
546  QMessageBox::information(this, tr("Raster to Vector"), tr("Dataset already exists. Remove it or select a new name and try again."));
547  return;
548  }
549  this->setCursor(Qt::WaitCursor);
550 
551  std::unique_ptr<te::da::DataSetTypeConverter> converterVector(
552  new te::da::DataSetTypeConverter(m_vectorLayer->getSchema().get(),
553  inVectorDataSource->getCapabilities(),
554  inVectorDataSource->getEncoding()));
555 
556  te::da::AssociateDataSetTypeConverterSRID(converterVector.get(), m_vectorLayer->getSRID());
557 
559 
560  rst2vec->setInput(inputRst.get(),
561  inVectorDataSource,
562  dsVectorLayer->getDataSetName(),
563  converterVector.release(),
564  oidSet);
565 
566  rst2vec->setParams(vecBands,
567  vecStatistics,
568  m_ui->m_boxPixelRadioButton->isChecked(),
569  m_texture);
570 
571  rst2vec->setOutput(aux, outputdataset);
572 
573  if (!rst2vec->paramsAreValid())
574  res = false;
575  else
576  res = rst2vec->run();
577 
578  delete rst2vec;
579 
580  if (!res)
581  {
582  this->setCursor(Qt::ArrowCursor);
583  QMessageBox::information(this, tr("Raster to Vector"), tr("Error: could not generate the operation."));
584 
585  reject();
586  }
587  }
588 
589  // creating a layer for the result
591 
593 
594  te::da::DataSetTypePtr dt(outDataSource->getDataSetType(outputdataset).release());
595  m_outLayer = converter(dt);
596  }
597  catch(const std::exception& e)
598  {
599  this->setCursor(Qt::ArrowCursor);
600 
601  QMessageBox::information(this, tr("Raster to Vector"), e.what());
602 
603 #ifdef TERRALIB_LOGGER_ENABLED
604  TE_CORE_LOG_DEBUG("attributefill", e.what());
605 #endif // TERRALIB_LOGGER_ENABLED
606 
607  return;
608  }
609 
610  this->setCursor(Qt::ArrowCursor);
611  accept();
612 }
613 
615 {
616  reject();
617 }
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager.
Raster to vector attributefill dialog.
TEDATAACCESSEXPORT te::rst::RasterProperty * GetFirstRasterProperty(const DataSetType *dt)
void setInput(te::rst::Raster *inRaster, te::da::DataSourcePtr inVectorDsrc, std::string inVectorName, te::da::DataSetTypeConverter *inVectorDsType, const te::da::ObjectIdSet *oidSet=0)
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
Geometric property.
std::vector< unsigned int > getSelectedBands()
Get the selected bands based on selected QListWidgetItem.
Defines a component for choose a file.
Definition: FileDialog.h:52
static bool exists(const std::string &path)
Checks if a given path in UTF-8 exists.
Definition: FileSystem.cpp:142
boost::shared_ptr< DataSetType > DataSetTypePtr
Definition: DataSetType.h:653
boost::shared_ptr< DataSource > DataSourcePtr
TEDATAACCESSEXPORT void AssociateDataSetTypeConverterSRID(DataSetTypeConverter *converter, const int &inputSRID, const int &outputSRID=TE_UNKNOWN_SRS)
A raster band description.
Definition: BandProperty.h:61
Total number of values.
te::map::AbstractLayerPtr m_vectorLayer
Vector layer.
virtual const char * what() const
It outputs the exception message.
#define TE_CORE_LOG_DEBUG(channel, message)
Use this tag in order to log a message to a specified logger with the DEBUG level.
Definition: Logger.h:225
te::map::AbstractLayerPtr m_outLayer
Generated Layer.
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName)
static te::dt::Date ds(2010, 01, 01)
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
Definition: BandProperty.h:136
Raster property.
An converter for DataSetType.
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
int b
Definition: TsRtree.cpp:32
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
void exec()
This method will open the dialog of file selection and populate the class members with the chosen fil...
Definition: FileDialog.cpp:54
URI C++ Library.
Definition: Attributes.h:37
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
static te::dt::TimeDuration dt(20, 30, 50, 11)
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
TEQTWIDGETSEXPORT bool isValidSRIDs(const int &firstSRID, const int &secondSRID, std::string &msg)
Verify if the SRID from informed Layers are valids to execute the operation.
te::map::AbstractLayerPtr getLayer()
Get the generated layer.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
void setParams(std::vector< unsigned int > bands, std::vector< te::stat::StatisticalSummary > statSum, bool iteratorByBox, bool texture)
bool getValueOption()
Get the based on selected QListWidgetItem.
std::string getPath()
This method will return the chosen path.
Definition: FileDialog.cpp:103
virtual const te::da::ObjectIdSet * getSelected() const
It returns the selected group of this Layer.
const std::string & getDataSetName() const
const std::list< te::da::DataSourceInfoPtr > & getSelecteds() const
A dialog for selecting a data source.
A class that represents a data source component.
A layer with reference to a dataset.
Definition: DataSetLayer.h:47
std::string getFileName()
This method will return the file name.
Definition: FileDialog.cpp:113
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
std::vector< te::stat::StatisticalSummary > getSelectedStatistics()
Get the selected statistics based on selected QListWidgetItem.
std::unique_ptr< Ui::RasterToVectorDialogForm > m_ui
User interface.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
virtual const std::string & getDataSourceId() const
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
te::map::AbstractLayerPtr m_rasterLayer
Raster layer.
RasterToVectorDialog(QWidget *parent=0, Qt::WindowFlags f=0)
const std::string & getName() const
It returns the property name.
Definition: Property.h:127