BufferDialog.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/vp/BufferDialog.cpp
22 
23  \brief A dialog for buffer operation
24 */
25 
26 // TerraLib
27 #include "../../common/Logger.h"
28 #include "../../common/progress/ProgressManager.h"
29 #include "../../common/Translator.h"
30 #include "../../common/STLUtils.h"
31 #include "../../dataaccess/dataset/DataSetType.h"
32 #include "../../dataaccess/datasource/DataSourceCapabilities.h"
33 #include "../../dataaccess/datasource/DataSourceInfo.h"
34 #include "../../dataaccess/datasource/DataSourceInfoManager.h"
35 #include "../../dataaccess/datasource/DataSourceManager.h"
36 #include "../../dataaccess/datasource/DataSourceFactory.h"
37 #include "../../dataaccess/utils/Utils.h"
38 #include "../../datatype/Enums.h"
39 #include "../../datatype/Property.h"
40 #include "../../geometry/Geometry.h"
41 #include "../../geometry/GeometryProperty.h"
42 #include "../../maptools/AbstractLayer.h"
43 #include "../../maptools/DataSetLayer.h"
44 #include "../../memory/DataSet.h"
45 #include "../../memory/DataSetItem.h"
46 #include "../../qt/widgets/datasource/selector/DataSourceSelectorDialog.h"
47 #include "../../qt/widgets/layer/utils/DataSet2Layer.h"
48 #include "../../qt/widgets/progress/ProgressViewerDialog.h"
49 #include "../../srs/Config.h"
50 #include "../Exception.h"
51 #include "../BufferMemory.h"
52 #include "BufferDialog.h"
53 #include "../BufferOp.h"
54 #include "../BufferQuery.h"
55 #include "ui_BufferDialogForm.h"
56 #include "Utils.h"
57 
58 // Qt
59 #include <QFileDialog>
60 #include <QList>
61 #include <QListWidget>
62 #include <QListWidgetItem>
63 #include <QMessageBox>
64 #include <QSize>
65 
66 // STL
67 #include <map>
68 
69 // BOOST
70 #include <boost/algorithm/string.hpp>
71 #include <boost/filesystem.hpp>
72 #include <boost/lexical_cast.hpp>
73 #include <boost/uuid/random_generator.hpp>
74 #include <boost/uuid/uuid_io.hpp>
75 
76 te::vp::BufferDialog::BufferDialog(QWidget* parent, Qt::WindowFlags f)
77  : QDialog(parent, f),
78  m_ui(new Ui::BufferDialogForm),
79  m_layers(std::list<te::map::AbstractLayerPtr>()),
80  m_selectedLayer(0)
81 {
82 // add controls
83  m_ui->setupUi(this);
84 
85 // add icons
86  m_ui->m_imgLabel->setPixmap(QIcon::fromTheme("vp-buffer-hint").pixmap(112,48));
87 
88  QSize iconSize(96, 48);
89 
90  m_ui->m_withoutBoundRadioButton->setIconSize(iconSize);
91  m_ui->m_withoutBoundRadioButton->setIcon(QIcon::fromTheme("buffer-without-boundaries"));
92 
93  m_ui->m_withBoundRadioButton->setIconSize(iconSize);
94  m_ui->m_withBoundRadioButton->setIcon(QIcon::fromTheme("buffer-with-boundaries"));
95 
96  m_ui->m_ruleImgLabel->setPixmap(QIcon::fromTheme("buffer-inside-outside").pixmap(150,60));
97  m_ui->m_targetDatasourceToolButton->setIcon(QIcon::fromTheme("datasource"));
98 
99 //add controls
100  m_ui->m_fixedDistanceLineEdit->setEnabled(true);
101  m_ui->m_fixedDistanceLineEdit->setValidator(new QDoubleValidator(this));
102 
104 
105 //signals
106  connect(m_ui->m_layersComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLayerComboBoxChanged(int)));
107  connect(m_ui->m_fixedRadioButton, SIGNAL(toggled(bool)), this, SLOT(onFixedDistanceToggled()));
108  connect(m_ui->m_fromAttRadioButton, SIGNAL(toggled(bool)), this, SLOT(onAttDistanceToggled()));
109  connect(m_ui->m_ruleInOutRadioButton, SIGNAL(toggled(bool)), this, SLOT(onRuleInOutToggled()));
110  connect(m_ui->m_ruleOnlyOutRadioButton, SIGNAL(toggled(bool)), this, SLOT(onRuleOutToggled()));
111  connect(m_ui->m_ruleOnlyInRadioButton, SIGNAL(toggled(bool)), this, SLOT(onRuleInToggled()));
112  connect(m_ui->m_withoutBoundRadioButton, SIGNAL(toggled(bool)), this, SLOT(onWithoutBoundToggled()));
113  connect(m_ui->m_withBoundRadioButton, SIGNAL(toggled(bool)), this, SLOT(onWithBoundToggled()));
114 
115  connect(m_ui->m_targetDatasourceToolButton, SIGNAL(pressed()), this, SLOT(onTargetDatasourceToolButtonPressed()));
116  connect(m_ui->m_targetFileToolButton, SIGNAL(pressed()), this, SLOT(onTargetFileToolButtonPressed()));
117 
118  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
119  connect(m_ui->m_cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancelPushButtonClicked()));
120 
121  m_ui->m_helpPushButton->setNameSpace("dpi.inpe.br.plugins");
122  m_ui->m_helpPushButton->setPageReference("plugins/vp/vp_buffer.html");
123 }
124 
126 {
127 }
128 
129 void te::vp::BufferDialog::setLayers(std::list<te::map::AbstractLayerPtr> layers)
130 {
131  m_layers = layers;
132 
133  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
134 
135  while(it != m_layers.end())
136  {
137  std::auto_ptr<te::da::DataSetType> dsType = it->get()->getSchema();
138  if(dsType->hasGeom())
139  m_ui->m_layersComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
140  ++it;
141  }
142 }
143 
145 {
146  for(int i=1; i <= 10; ++i)
147  m_ui->m_levelsNumComboBox->addItem(QString::number(i));
148 }
149 
150 void te::vp::BufferDialog::setAttributesForDistance(std::vector<te::dt::Property*> properties)
151 {
152  m_ui->m_fromAttDistanceComboBox->clear();
153 
154  for(std::size_t i = 0; i < properties.size(); ++i)
155  {
156  if(properties[i]->getType() == te::dt::CDOUBLE_TYPE ||
157  properties[i]->getType() == te::dt::CFLOAT_TYPE ||
158  properties[i]->getType() == te::dt::CINT16_TYPE ||
159  properties[i]->getType() == te::dt::CINT32_TYPE ||
160  properties[i]->getType() == te::dt::DOUBLE_TYPE ||
161  properties[i]->getType() == te::dt::INT16_TYPE ||
162  properties[i]->getType() == te::dt::INT32_TYPE ||
163  properties[i]->getType() == te::dt::INT64_TYPE ||
164  properties[i]->getType() == te::dt::FLOAT_TYPE ||
165  properties[i]->getType() == te::dt::NUMERIC_TYPE ||
166  properties[i]->getType() == te::dt::UINT16_TYPE ||
167  properties[i]->getType() == te::dt::UINT32_TYPE ||
168  properties[i]->getType() == te::dt::UINT64_TYPE)
169  m_ui->m_fromAttDistanceComboBox->addItem(properties[i]->getName().c_str());
170  }
171 
172  if(m_ui->m_fromAttDistanceComboBox->count() > 0)
173  {
174  //m_ui->m_fromAttRadioButton->setEnabled(true);
175  }
176  else
177  m_ui->m_fromAttRadioButton->setEnabled(false);
178 }
179 
181 {
182  if(m_ui->m_ruleInOutRadioButton->isChecked())
183  return te::vp::INSIDE_OUTSIDE;
184  else if(m_ui->m_ruleOnlyOutRadioButton->isChecked())
185  return te::vp::ONLY_OUTSIDE;
186  else
187  return te::vp::ONLY_INSIDE;
188 }
189 
191 {
192  if(m_ui->m_withoutBoundRadioButton->isChecked())
193  return te::vp::DISSOLVE;
194  else
195  return te::vp::NOT_DISSOLVE;
196 }
197 
199 {
200  return m_outputLayer;
201 }
202 
204 {
205  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
206  std::string layerID = m_ui->m_layersComboBox->itemData(index, Qt::UserRole).toString().toStdString();
207 
208  while(it != m_layers.end())
209  {
210  if(layerID == it->get()->getId().c_str())
211  {
212  te::map::AbstractLayerPtr selectedLayer = it->get();
213  m_selectedLayer = selectedLayer;
214  std::auto_ptr<const te::map::LayerSchema> schema(selectedLayer->getSchema());
215 
216  if(schema->size() == 0)
217  return;
218 
219  te::common::FreeContents(m_properties);
220  m_properties.clear();
221 
222  const std::vector<te::dt::Property*>& properties = schema->getProperties();
223  te::common::Clone(properties, m_properties);
224 
225  setAttributesForDistance(m_properties);
226 
227  te::map::DataSetLayer* dsLayer = dynamic_cast<te::map::DataSetLayer*>(m_selectedLayer.get());
228  te::da::DataSourcePtr inDataSource = te::da::GetDataSource(dsLayer->getDataSourceId(), true);
229  te::da::DataSetType* dsType = te::da::GetDataSetType(dsLayer->getDataSetName(), inDataSource->getId());
230  std::auto_ptr<te::gm::GeometryProperty>geomProp(te::da::GetFirstGeomProperty(dsType));
231 
232  te::gm::GeomType gmType = geomProp->getGeometryType();
233  if(gmType == te::gm::PointType || gmType == te::gm::MultiPointType ||
235  {
236  m_ui->m_ruleInOutRadioButton->setDisabled(true);
237  m_ui->m_ruleOnlyInRadioButton->setDisabled(true);
238  m_ui->m_ruleOnlyOutRadioButton->setChecked(true);
239  }
240  else
241  {
242  m_ui->m_ruleInOutRadioButton->setEnabled(true);
243  m_ui->m_ruleOnlyInRadioButton->setEnabled(true);
244  m_ui->m_ruleInOutRadioButton->setChecked(true);
245  }
246 
247  return;
248  }
249  ++it;
250  }
251 }
252 
254 {
255  m_ui->m_fixedDistanceLineEdit->setEnabled(true);
256  m_ui->m_fromAttDistanceComboBox->setEnabled(false);
257 }
258 
260 {
261  m_ui->m_fromAttDistanceComboBox->setEnabled(true);
262  m_ui->m_fixedDistanceLineEdit->setEnabled(false);
263 }
264 
266 {
267  m_ui->m_ruleImgLabel->setPixmap(QIcon::fromTheme("buffer-inside-outside").pixmap(150,60));
268 }
269 
271 {
272  m_ui->m_ruleImgLabel->setPixmap(QIcon::fromTheme("buffer_only-outside").pixmap(150,60));
273 }
274 
276 {
277  m_ui->m_ruleImgLabel->setPixmap(QIcon::fromTheme("buffer-only-inside").pixmap(150,60));
278 }
279 
281 {
282  m_ui->m_copyColumnsCheckBox->setChecked(false);
283  m_ui->m_copyColumnsCheckBox->setEnabled(false);
284 }
285 
287 {
288  m_ui->m_copyColumnsCheckBox->setEnabled(true);
289 }
290 
292 {
293  m_ui->m_newLayerNameLineEdit->clear();
294  m_ui->m_newLayerNameLineEdit->setEnabled(true);
296  dlg.exec();
297 
298  std::list<te::da::DataSourceInfoPtr> dsPtrList = dlg.getSelecteds();
299 
300  if(dsPtrList.empty())
301  return;
302 
303  std::list<te::da::DataSourceInfoPtr>::iterator it = dsPtrList.begin();
304 
305  m_ui->m_repositoryLineEdit->setText(QString(it->get()->getTitle().c_str()));
306 
307  m_outputDatasource = *it;
308 
309  m_toFile = false;
310 }
311 
313 {
314  m_ui->m_newLayerNameLineEdit->clear();
315  m_ui->m_repositoryLineEdit->clear();
316 
317  QString fileName = QFileDialog::getSaveFileName(this, tr("Save as..."),
318  QString(), tr("Shapefile (*.shp *.SHP);;"),0, QFileDialog::DontConfirmOverwrite);
319 
320  if(fileName.isEmpty())
321  return;
322 
323  boost::filesystem::path outfile(fileName.toStdString());
324  std::string aux = outfile.leaf().string();
325  m_ui->m_newLayerNameLineEdit->setText(aux.c_str());
326  aux = outfile.string();
327  m_ui->m_repositoryLineEdit->setText(aux.c_str());
328 
329  m_toFile = true;
330  m_ui->m_newLayerNameLineEdit->setEnabled(false);
331 }
332 
334 {
335  if(m_ui->m_layersComboBox->currentText().isEmpty())
336  {
337  QMessageBox::information(this, "Buffer", "Select an input layer.");
338  return;
339  }
340 
341  // Checking consistency of the input layer where the buffer will executed
342  te::map::DataSetLayer* dsLayer = dynamic_cast<te::map::DataSetLayer*>(m_selectedLayer.get());
343  if(!dsLayer)
344  {
345  QMessageBox::information(this, "Buffer", "Can not execute this operation on this type of layer.");
346  return;
347  }
348 
349  const te::da::ObjectIdSet* oidSet = 0;
350 
351  if(m_ui->m_onlySelectedCheckBox->isChecked())
352  {
353  oidSet = m_selectedLayer->getSelected();
354  if(!oidSet)
355  {
356  QMessageBox::information(this, "Buffer", "Select the layer objects to perform the buffer operation.");
357  return;
358  }
359  }
360 
361  te::da::DataSourcePtr inDataSource = te::da::GetDataSource(dsLayer->getDataSourceId(), true);
362  if (!inDataSource.get())
363  {
364  QMessageBox::information(this, "Buffer", "The selected input data source can not be accessed.");
365  return;
366  }
367 
368  // Check consistency of buffer parameters
369  double fixedDistance;
370  std::string propDistance = "";
371  if(m_ui->m_fixedRadioButton->isChecked())
372  {
373  fixedDistance = m_ui->m_fixedDistanceLineEdit->text().toDouble();
374  if (fixedDistance <= 0)
375  {
376  QMessageBox::information(this, "Buffer", "Fixed distance value should be greater than 0.");
377  return;
378  }
379  }
380  else
381  {
382  fixedDistance = 0;
383  int i = m_ui->m_fromAttDistanceComboBox->currentIndex();
384  propDistance = m_ui->m_fromAttDistanceComboBox->itemText(i).toStdString();
385  }
386 
387  // Checking consistency of output paramenters
388  if(m_ui->m_repositoryLineEdit->text().isEmpty())
389  {
390  QMessageBox::information(this, "Buffer", "Select a repository for the resulting layer.");
391 
392  return;
393  }
394 
395  if(m_ui->m_newLayerNameLineEdit->text().isEmpty())
396  {
397  QMessageBox::information(this, "Buffer", "Define a name for the resulting layer.");
398  return;
399  }
400 
401  int bufferPolygonRule = getPolygonRule();
402  int bufferBoundariesRule = getBoundariesRule();
403  bool copyInputColumns = m_ui->m_copyColumnsCheckBox->isChecked();
404  int levels = m_ui->m_levelsNumComboBox->currentText().toInt();
405  std::string outputdataset = m_ui->m_newLayerNameLineEdit->text().toStdString();
406 
407  //progress
410 
411  try
412  {
413  bool res;
414 
415  if(m_toFile)
416  {
417  boost::filesystem::path uri(m_ui->m_repositoryLineEdit->text().toStdString());
418 
419  if(boost::filesystem::exists(uri))
420  {
421  QMessageBox::information(this, "Buffer", "Output file already exists. Remove it or select a new name and try again.");
422  return;
423  }
424 
425  std::size_t idx = outputdataset.find(".");
426  if(idx != std::string::npos)
427  outputdataset = outputdataset.substr(0,idx);
428 
429  std::map<std::string, std::string> dsinfo;
430  dsinfo["URI"] = uri.string();
431 
433  dsOGR->setConnectionInfo(dsinfo);
434  dsOGR->open();
435 
436  if(dsOGR->dataSetExists(outputdataset))
437  {
438  QMessageBox::information(this, "Buffer", "There is already a dataset with the requested name in the output data source. Remove it or select a new name and try again.");
439  return;
440  }
441 
442  std::auto_ptr<te::da::DataSetTypeConverter> converter(new te::da::DataSetTypeConverter(dsLayer->getSchema().get(), dsOGR->getCapabilities(), dsOGR->getEncoding()));
443 
444  te::da::AssociateDataSetTypeConverterSRID(converter.get(), dsLayer->getSRID());
445 
446  this->setCursor(Qt::WaitCursor);
447 
448  te::vp::BufferOp* bufferOp = 0;
449 
450  // select a strategy based on the capabilities of the input datasource
451  const te::da::DataSourceCapabilities dsCapabilities = inDataSource->getCapabilities();
452 
453  if(dsCapabilities.supportsPreparedQueryAPI() && dsCapabilities.getQueryCapabilities().supportsSpatialSQLDialect())
454  {
455  bufferOp = new te::vp::BufferQuery();
456  }
457  else
458  {
459  bufferOp = new te::vp::BufferMemory();
460  }
461 
462  bufferOp->setInput(inDataSource, dsLayer->getDataSetName(), converter, oidSet);
463  bufferOp->setOutput(dsOGR, outputdataset);
464  bufferOp->setParams(fixedDistance, bufferPolygonRule, bufferBoundariesRule, copyInputColumns, levels);
465 
466  if (!bufferOp->paramsAreValid())
467  res = false;
468  else
469  res = bufferOp->run();
470 
471  if(!res)
472  {
473  dsOGR->close();
474  QMessageBox::information(this, "Buffer", "Error: could not generate the buffer.");
475  }
476  dsOGR->close();
477 
478  delete bufferOp;
479 
480  // let's include the new datasource in the managers
481  boost::uuids::basic_random_generator<boost::mt19937> gen;
482  boost::uuids::uuid u = gen();
483  std::string id = boost::uuids::to_string(u);
484 
486  ds->setConnInfo(dsinfo);
487  ds->setTitle(uri.stem().string());
488  ds->setAccessDriver("OGR");
489  ds->setType("OGR");
490  ds->setDescription(uri.string());
491  ds->setId(id);
492 
493  te::da::DataSourcePtr newds = te::da::DataSourceManager::getInstance().get(id, "OGR", ds->getConnInfo());
494  newds->open();
496  m_outputDatasource = ds;
497  }
498  else
499  {
500  te::da::DataSourcePtr aux = te::da::GetDataSource(m_outputDatasource->getId());
501  if (!aux)
502  {
503  QMessageBox::information(this, "Buffer", "The selected output datasource can not be accessed.");
504  return;
505  }
506  if (aux->dataSetExists(outputdataset))
507  {
508  QMessageBox::information(this, "Buffer", "Dataset already exists. Remove it or select a new name and try again. ");
509  return;
510  }
511  this->setCursor(Qt::WaitCursor);
512 
513 
514  std::auto_ptr<te::da::DataSetTypeConverter> converter(new te::da::DataSetTypeConverter(dsLayer->getSchema().get(), aux->getCapabilities(), aux->getEncoding()));
515 
516  te::da::AssociateDataSetTypeConverterSRID(converter.get(), dsLayer->getSRID());
517 
518 
519  te::vp::BufferOp* bufferOp = 0;
520 
521  // select a strategy based on the capabilities of the input datasource
522  const te::da::DataSourceCapabilities dsCapabilities = inDataSource->getCapabilities();
523 
524  if(dsCapabilities.supportsPreparedQueryAPI() && dsCapabilities.getQueryCapabilities().supportsSpatialSQLDialect())
525  {
526  bufferOp = new te::vp::BufferQuery();
527  }
528  else
529  {
530  bufferOp = new te::vp::BufferMemory();
531  }
532 
533  bufferOp->setInput(inDataSource, dsLayer->getDataSetName(), converter);
534  bufferOp->setOutput(aux, outputdataset);
535  bufferOp->setParams(fixedDistance, bufferPolygonRule, bufferBoundariesRule, copyInputColumns, levels);
536 
537  if (!bufferOp->paramsAreValid())
538  res = false;
539  else
540  res = bufferOp->run();
541 
542  if(!res)
543  {
544  this->setCursor(Qt::ArrowCursor);
545  QMessageBox::information(this, "Buffer", "Error: could not generate the buffer.");
546  reject();
547  }
548 
549  delete bufferOp;
550  }
551 
552  // creating a layer for the result
553  te::da::DataSourcePtr outDataSource = te::da::GetDataSource(m_outputDatasource->getId());
554 
555  te::qt::widgets::DataSet2Layer converter(m_outputDatasource->getId());
556 
557  te::da::DataSetTypePtr dt(outDataSource->getDataSetType(outputdataset).release());
558  m_outputLayer = converter(dt);
559  }
560  catch(const std::exception& e)
561  {
562  this->setCursor(Qt::ArrowCursor);
563  QMessageBox::information(this, "Buffer", e.what());
564 
565 #ifdef TERRALIB_LOGGER_ENABLED
566  std::string str = "Buffer - ";
567  str += e.what();
568  te::common::Logger::logDebug("vp", str.c_str());
569 #endif //TERRALIB_LOGGER_ENABLED
570 
572  return;
573  }
574 
576  this->setCursor(Qt::ArrowCursor);
577  accept();
578 }
579 
581 {
582  reject();
583 }
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager.
Definition: Utils.cpp:262
void setAttributesForDistance(std::vector< te::dt::Property * > properties)
std::auto_ptr< Ui::BufferDialogForm > m_ui
Definition: BufferDialog.h:112
BufferDialog(QWidget *parent=0, Qt::WindowFlags f=0)
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
Utility functions for the data access module.
const std::string & getDataSetName() const
virtual bool run()=0
boost::shared_ptr< DataSetType > DataSetTypePtr
Definition: DataSetType.h:653
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
TEDATAACCESSEXPORT void AssociateDataSetTypeConverterSRID(DataSetTypeConverter *converter, const int &inputSRID, const int &outputSRID=TE_UNKNOWN_SRS)
Definition: Utils.cpp:670
The boundaries between buffers will not be dissolved.
Definition: Enums.h:92
A dialog buffer operation.
A class that models the description of a dataset.
Definition: DataSetType.h:72
void onLayerComboBoxChanged(int index)
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
void setInput(te::da::DataSourcePtr inDsrc, std::string inDsetName, std::auto_ptr< te::da::DataSetTypeConverter > converter, const te::da::ObjectIdSet *oidSet=0)
Definition: BufferOp.cpp:51
const QueryCapabilities & getQueryCapabilities() const
void onTargetFileToolButtonPressed()
An converter for DataSetType.
The buffer is generated only outside of the polygons.
Definition: Enums.h:80
void removeViewer(int viewerId)
Dettach a progress viewer.
static ProgressManager & getInstance()
It returns a reference to the singleton instance.
const std::string & getDataSourceId() const
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 setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
The buffer is generated only inside of the polygons.
Definition: Enums.h:81
void setParams(const double &distance, const int &bufferPolygonRule, const int &bufferBoundariesRule, const bool &copyInputColumns, const int &levels)
Definition: BufferOp.cpp:62
static std::auto_ptr< DataSource > make(const std::string &dsType)
URI C++ Library.
virtual bool paramsAreValid()
Definition: BufferOp.cpp:81
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname)
Definition: BufferOp.cpp:75
bool supportsSpatialSQLDialect() const
The buffer is generated Inside and outside of the polygons.
Definition: Enums.h:79
int addViewer(AbstractProgressViewer *apv)
Attach a progress viewer.
const std::list< te::da::DataSourceInfoPtr > & getSelecteds() const
A dialog for selecting a data source.
A class that represents a data source component.
void onTargetDatasourceToolButtonPressed()
virtual int getSRID() const
It returns the Spatial Reference System ID associated to the Layer.
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
Definition: Utils.cpp:228
A layer with reference to a dataset.
Definition: DataSetLayer.h:47
std::auto_ptr< LayerSchema > getSchema() const
It returns the layer schema.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
Definition: Utils.cpp:557
te::map::AbstractLayerPtr getLayer()
void Clone(const std::vector< T * > &src, std::vector< T * > &dst)
This function can be applied to a vector of pointers.
Definition: STLUtils.h:237
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
Definition: BoostUtils.h:55
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
The boundaries between buffers will be dissolved.
Definition: Enums.h:91