All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SpatialStatisticsDialog.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/sa/qt/SpatialStatisticsDialog.cpp
22 
23  \brief A dialog to calculate spatial statistics from a attribute of a dataset.
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/datasource/DataSource.h"
32 #include "../../dataaccess/utils/Utils.h"
33 #include "../../geometry/GeometryProperty.h"
34 #include "../../maptools/DataSetLayer.h"
35 #include "../../qt/widgets/datasource/selector/DataSourceSelectorDialog.h"
36 #include "../../qt/widgets/progress/ProgressViewerDialog.h"
37 #include "../core/GPMBuilder.h"
38 #include "../core/GPMConstructorAdjacencyStrategy.h"
39 #include "../core/GPMWeightsNoWeightsStrategy.h"
40 #include "../core/SpatialStatisticsFunctions.h"
41 #include "../core/SpatialWeightsExchanger.h"
42 #include "../core/StatisticsFunctions.h"
43 #include "../core/Utils.h"
44 #include "../Exception.h"
46 #include "Utils.h"
47 #include "ui_SpatialStatisticsDialogForm.h"
48 
49 // Qt
50 #include <QFileDialog>
51 #include <QFileInfo>
52 #include <QMessageBox>
53 #include <QValidator>
54 
55 // STL
56 #include <memory>
57 
58 //Boost
59 #include <boost/filesystem.hpp>
60 
62 
64  : QDialog(parent, f),
65  m_ui(new Ui::SpatialStatisticsDialogForm)
66 {
67 // add controls
68  m_ui->setupUi(this);
69 
70 // add icons
71  m_ui->m_imgLabel->setPixmap(QIcon::fromTheme("sa-spatialstatistics-hint").pixmap(112,48));
72  m_ui->m_gpmToolButton->setIcon(QIcon::fromTheme("folder-open"));
73  m_ui->m_targetDatasourceToolButton->setIcon(QIcon::fromTheme("datasource"));
74 
75 // connectors
76  connect(m_ui->m_inputLayerComboBox, SIGNAL(activated(int)), this, SLOT(onInputLayerComboBoxActivated(int)));
77  connect(m_ui->m_gpmToolButton, SIGNAL(clicked()), this, SLOT(onGPMToolButtonClicked()));
78  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
79  connect(m_ui->m_targetDatasourceToolButton, SIGNAL(pressed()), this, SLOT(onTargetDatasourceToolButtonPressed()));
80  connect(m_ui->m_targetFileToolButton, SIGNAL(pressed()), this, SLOT(onTargetFileToolButtonPressed()));
81 
82 // help info
83  m_ui->m_helpPushButton->setNameSpace("dpi.inpe.br.plugins");
84  m_ui->m_helpPushButton->setPageReference("plugins/sa/sa_spatialstatistics.html");
85 }
86 
88 {
89 }
90 
91 void te::sa::SpatialStatisticsDialog::setLayers(std::list<te::map::AbstractLayerPtr> layers)
92 {
93  std::list<te::map::AbstractLayerPtr>::iterator it = layers.begin();
94 
95  while(it != layers.end())
96  {
98 
99  if(l->isValid())
100  {
101  std::auto_ptr<te::da::DataSetType> dsType = l->getSchema();
102 
103  te::map::DataSetLayer* dsLayer = dynamic_cast<te::map::DataSetLayer*>(l.get());
104 
105  if(dsLayer && dsType->hasGeom())
106  m_ui->m_inputLayerComboBox->addItem(it->get()->getTitle().c_str(), QVariant::fromValue(l));
107  }
108 
109  ++it;
110  }
111 
112 // fill attributes combo
113  if(m_ui->m_inputLayerComboBox->count() > 0)
114  onInputLayerComboBoxActivated(0);
115 }
116 
118 {
119  return m_outputLayer;
120 }
121 
123 {
124  QVariant varLayer = m_ui->m_inputLayerComboBox->itemData(index, Qt::UserRole);
125 
127 
128  std::auto_ptr<te::da::DataSetType> dsType = l->getSchema();
129 
130  std::vector<te::dt::Property*> propVec = dsType->getProperties();
131 
132  m_ui->m_attrIdComboBox->clear();
133  m_ui->m_attrLinkComboBox->clear();
134 
135  for(std::size_t t = 0; t < propVec.size(); ++t)
136  {
137  int dataType = propVec[t]->getType();
138 
139  if (dataType == te::dt::INT16_TYPE || dataType == te::dt::UINT16_TYPE ||
140  dataType == te::dt::INT32_TYPE || dataType == te::dt::UINT32_TYPE ||
141  dataType == te::dt::INT64_TYPE || dataType == te::dt::UINT64_TYPE ||
142  dataType == te::dt::FLOAT_TYPE || dataType == te::dt::DOUBLE_TYPE)
143  {
144  m_ui->m_attrIdComboBox->addItem(propVec[t]->getName().c_str(), dataType);
145  }
146 
147  m_ui->m_attrLinkComboBox->addItem(propVec[t]->getName().c_str(), dataType);
148  }
149 }
150 
152 {
153  QString fileName = QFileDialog::getOpenFileName(this, tr("Open Generalized Proximity Matrix File"), "", tr("GAL Files (*.gal *.GAL);; GWT Files (*.gwt *.GWT)"));
154 
155  if(fileName.isEmpty())
156  return;
157 
158  //get selected layer
159  QVariant varLayer = m_ui->m_inputLayerComboBox->itemData(m_ui->m_inputLayerComboBox->currentIndex(), Qt::UserRole);
161  te::map::DataSetLayer* dsLayer = dynamic_cast<te::map::DataSetLayer*>(l.get());
162 
163  //check if the selected gpm is valid for selected layer
164  std::string path = fileName.toStdString();
165  std::string dataSetName = "";
166  std::string attrName = "";
167 
169 
170  if(dsLayer->getDataSetName() != dataSetName)
171  {
172  QMessageBox::warning(this, tr("Warning"), tr("Invalid GPM file for selected layer."));
173  return;
174  }
175 
176  if(m_ui->m_attrLinkComboBox->currentText().toStdString() != attrName)
177  {
178  QMessageBox::warning(this, tr("Warning"), tr("Invalid GPM file for selected Attr Link."));
179  return;
180  }
181 
182  m_ui->m_gpmLineEdit->setText(fileName);
183 }
184 
186 {
187  // check input parameters
188  if(m_ui->m_repositoryLineEdit->text().isEmpty())
189  {
190  QMessageBox::information(this, tr("Warning"), tr("Define a repository for the result."));
191  return;
192  }
193 
194  if(m_ui->m_newLayerNameLineEdit->text().isEmpty())
195  {
196  QMessageBox::information(this, tr("Warning"), tr("Define a name for the resulting layer."));
197  return;
198  }
199 
200  if(m_ui->m_attrIdComboBox->currentText().isEmpty())
201  {
202  QMessageBox::information(this, tr("Warning"), tr("Attribute Name not defined."));
203  return;
204  }
205 
206  //get GPM
207  std::auto_ptr<te::sa::GeneralizedProximityMatrix> gpm;
208 
209  try
210  {
211  gpm = loadGPM();
212  }
213  catch(...)
214  {
215  QMessageBox::warning(this, tr("Warning"), tr("Internal error. GPM not loaded."));
216  return;
217  }
218 
219  if(!gpm.get())
220  return;
221 
222  //get selected layer
223  QVariant varLayer = m_ui->m_inputLayerComboBox->itemData(m_ui->m_inputLayerComboBox->currentIndex(), Qt::UserRole);
225  te::map::DataSetLayer* dsLayer = dynamic_cast<te::map::DataSetLayer*>(l.get());
226 
227  //get necessary info to calculate statistics
228  te::da::DataSourcePtr ds = te::da::GetDataSource(dsLayer->getDataSourceId(), true);
229 
230  std::auto_ptr<te::da::DataSetType> dataSetType = l->getSchema();
231 
232  std::string attrLink = gpm->getAttributeName();
233 
234  std::string attrName = m_ui->m_attrIdComboBox->currentText().toStdString();
235 
236  int type = m_ui->m_attrIdComboBox->itemData(m_ui->m_attrIdComboBox->currentIndex()).toInt();
237 
238  //associate the selected attribute to the GPM
239  int attrIdx = te::sa::AssociateGPMVertexAttribute(gpm.get(), ds.get(), dsLayer->getDataSetName(), attrLink, attrName, type);
240 
241  //start calculate the operations
244 
245  QApplication::setOverrideCursor(Qt::WaitCursor);
246 
247  //G Statistics
248  if(m_ui->m_localGStatisticsCheckBox->isChecked())
249  {
250  try
251  {
252  te::sa::GStatistics(gpm.get(), attrIdx); //this function calculates the g and g* statistics and adds the values as attribute in each vertex from gpm graph.
253  }
254  catch(const std::exception& e)
255  {
256  QMessageBox::warning(this, tr("Warning"), e.what());
257 
258  QApplication::restoreOverrideCursor();
259 
261 
262  return;
263  }
264  catch(...)
265  {
266  QMessageBox::warning(this, tr("Warning"), tr("Internal error. G Statistics not calculated."));
267 
268  QApplication::restoreOverrideCursor();
269 
271 
272  return;
273  }
274  }
275 
276  //Local Mean
277  if(m_ui->m_localLocalMeanCheckBox->isChecked())
278  {
279  try
280  {
281  te::sa::LocalMean(gpm.get(), attrIdx); //this function calculates the local mean statistics and adds the values as attribute in each vertex from gpm graph.
282  }
283  catch(const std::exception& e)
284  {
285  QMessageBox::warning(this, tr("Warning"), e.what());
286 
287  QApplication::restoreOverrideCursor();
288 
290 
291  return;
292  }
293  catch(...)
294  {
295  QMessageBox::warning(this, tr("Warning"), tr("Internal error. Local Mean not calculated."));
296 
297  QApplication::restoreOverrideCursor();
298 
300 
301  return;
302  }
303  }
304 
305  //Moran
306  if(m_ui->m_globalMoranIndexCheckBox->isChecked() || m_ui->m_localMoranIndex->isChecked())
307  {
308  try
309  {
310  te::sa::ZAndWZ(gpm.get(), attrIdx); //this function calculates the standard deviation Z and local mean of the desviation Z (WZ).
311 
312  double globalMoranIndex = te::sa::MoranIndex(gpm.get()); //this function calculates the moran index, global and local.
313 
314  //set the global moran index value
315  if(m_ui->m_globalMoranIndexCheckBox->isChecked())
316  {
317  m_ui->m_globalMoranIndexValueLineEdit->setText(QString::number(globalMoranIndex));
318  }
319 
320  //evaluating the significance of the global index.
321  if(m_ui->m_globalMoranIndexCheckBox->isChecked() && !m_ui->m_globalEvalNotRadioButton->isChecked())
322  {
323  int permutValue = 0;
324 
325  if(m_ui->m_globalEval99RadioButton->isChecked())
326  permutValue = 99;
327  else if(m_ui->m_globalEval999RadioButton->isChecked())
328  permutValue = 999;
329 
330  double globalMoranSignificance = te::sa::GlobalMoranSignificance(gpm.get(), attrIdx, permutValue, globalMoranIndex); //this function calculates the significance of the moran index.
331 
332  m_ui->m_globalMoranIndexPValueLineEdit->setText(QString::number(globalMoranSignificance));
333  }
334 
335  te::sa::BoxMap(gpm.get(), 0); //this function calculates the box map information, needs Z and WZ information... MEAN = 0 ??
336 
337  //evaluating the significance of LISA.
338  if(m_ui->m_localMoranIndex->isChecked() && !m_ui->m_localEvalNotRadioButton->isChecked())
339  {
340  int permutValue = 0;
341 
342  if(m_ui->m_localEval99RadioButton->isChecked())
343  permutValue = 99;
344  else if(m_ui->m_localEval999RadioButton->isChecked())
345  permutValue = 999;
346  else if(m_ui->m_localEval9999RadioButton->isChecked())
347  permutValue = 9999;
348 
349  te::sa::LisaStatisticalSignificance(gpm.get(), permutValue); //this function calculates the lisa (local moran index) significance, needs Z, Local Moran and Number of Neighbours attributes calculated.
350 
351  te::sa::LISAMap(gpm.get(), permutValue); //this function calculates the lisa map, needs LISASig attribute calculated.
352 
353  te::sa::MoranMap(gpm.get()); //this function calculates the moran map, needs LISAMap and BoxMAP attributes calculated.
354  }
355  }
356  catch(const std::exception& e)
357  {
358  QMessageBox::warning(this, tr("Warning"), e.what());
359 
360  QApplication::restoreOverrideCursor();
361 
363 
364  return;
365  }
366  catch(...)
367  {
368  QMessageBox::warning(this, tr("Warning"), tr("Internal error. Moran not calculated."));
369 
370  QApplication::restoreOverrideCursor();
371 
373 
374  return;
375  }
376  }
377 
378  //save spatial statistics calculated into a new dataset
379  std::string dataSetName = m_ui->m_newLayerNameLineEdit->text().toStdString();
380 
381  std::size_t idx = dataSetName.find(".");
382  if (idx != std::string::npos)
383  dataSetName=dataSetName.substr(0,idx);
384 
385  te::da::DataSourcePtr outputDataSource;
386 
387  if(m_toFile)
388  {
389  outputDataSource = te::sa::CreateOGRDataSource(m_ui->m_repositoryLineEdit->text().toStdString());
390  }
391  else
392  {
393  outputDataSource = te::da::GetDataSource(m_outputDatasource->getId());
394  }
395 
396  //associate the input geometry attribute to the GPM
397  te::gm::GeometryProperty* gmProp = te::da::GetFirstGeomProperty(dataSetType.get());
398  int geomIdx = te::sa::AssociateGPMVertexAttribute(gpm.get(), ds.get(), dsLayer->getDataSetName(), attrLink, gmProp->getName(), gmProp->getType(), gmProp->getSRID(), gmProp->getGeometryType());
399 
400  try
401  {
402  gpm->toDataSource(outputDataSource, dataSetName);
403  }
404  catch(const std::exception& e)
405  {
406  QMessageBox::warning(this, tr("Warning"), e.what());
407 
408  QApplication::restoreOverrideCursor();
409 
411 
412  return;
413  }
414  catch(...)
415  {
416  QMessageBox::warning(this, tr("Warning"), tr("Error saving GPM into data source."));
417 
418  QApplication::restoreOverrideCursor();
419 
421 
422  return;
423  }
424 
425  QApplication::restoreOverrideCursor();
426 
428 
429  QMessageBox::information(this, tr("Information"), tr("Statistics Calculated. Press the 'Close' button to close the dialog."));
430 
431  m_outputLayer = te::sa::CreateLayer(outputDataSource, dataSetName);
432 }
433 
434 std::auto_ptr<te::sa::GeneralizedProximityMatrix> te::sa::SpatialStatisticsDialog::loadGPM()
435 {
436  std::auto_ptr<te::sa::GeneralizedProximityMatrix> gpm;
437 
438  //get selected layer
439  QVariant varLayer = m_ui->m_inputLayerComboBox->itemData(m_ui->m_inputLayerComboBox->currentIndex(), Qt::UserRole);
441 
442  if(!l.get())
443  {
444  QMessageBox::warning(this, tr("Warning"), tr("Invalid selected layer."));
445  return gpm;
446  }
447 
448  te::map::DataSetLayer* dsLayer = dynamic_cast<te::map::DataSetLayer*>(l.get());
449 
450  //get gpm necessary parameters
452 
453  std::string dataSetName = dsLayer->getDataSetName();
454 
455  if(!m_ui->m_gpmGroupBox->isChecked())
456  {
457  //create gpm
458  if(QMessageBox::question(this, tr("Spatial Analysis"), tr("GPM not selected. Create default GPM?"), QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
459  return gpm;
460 
461  //get attrlink
462  std::auto_ptr<te::da::DataSetType> dsType = dsLayer->getSchema();
463 
464  if(!dsType->getPrimaryKey() || dsType->getPrimaryKey()->getProperties().empty())
465  {
466  QMessageBox::warning(this, tr("Warning"), tr("Invalid Data Set Primary Key."));
467  return gpm;
468  }
469 
470  std::string attrLink = dsType->getPrimaryKey()->getProperties()[0]->getName();
471 
472  //create default gpm
475 
476  te::sa::GPMBuilder builder(constructor, weights);
477 
478  builder.setGPMInfo(ds, dataSetName, attrLink);
479 
480  gpm = builder.build();
481  }
482  else
483  {
484  if(m_ui->m_gpmLineEdit->text().isEmpty())
485  {
486  QMessageBox::warning(this, tr("Warning"), tr("GPM File not selected."));
487  return gpm;
488  }
489 
490  //load gpm
491  QFileInfo file(m_ui->m_gpmLineEdit->text());
492 
493  std::string extension = file.suffix().toStdString();
494 
496 
497  if(extension == "gal" || extension == "GAL")
498  {
499  gpm.reset(swe.importFromGAL(m_ui->m_gpmLineEdit->text().toStdString(), ds.get()));
500  }
501  else if(extension == "gwt" || extension == "GWT")
502  {
503  gpm.reset(swe.importFromGWT(m_ui->m_gpmLineEdit->text().toStdString(), ds.get()));
504  }
505  }
506 
507  return gpm;
508 }
509 
511 {
512  m_ui->m_newLayerNameLineEdit->clear();
513  m_ui->m_newLayerNameLineEdit->setEnabled(true);
514 
516  dlg.exec();
517 
518  std::list<te::da::DataSourceInfoPtr> dsPtrList = dlg.getSelecteds();
519 
520  if(dsPtrList.size() <= 0)
521  return;
522 
523  std::list<te::da::DataSourceInfoPtr>::iterator it = dsPtrList.begin();
524 
525  m_ui->m_repositoryLineEdit->setText(QString(it->get()->getTitle().c_str()));
526 
527  m_outputDatasource = *it;
528 
529  m_toFile = false;
530 }
531 
533 {
534  m_ui->m_newLayerNameLineEdit->clear();
535  m_ui->m_repositoryLineEdit->clear();
536 
537  QString fileName = QFileDialog::getSaveFileName(this, tr("Save as..."), QString(), tr("Shapefile (*.shp *.SHP);;"),0, QFileDialog::DontConfirmOverwrite);
538 
539  if (fileName.isEmpty())
540  return;
541 
542  boost::filesystem::path outfile(fileName.toStdString());
543 
544  m_ui->m_repositoryLineEdit->setText(outfile.string().c_str());
545 
546  m_ui->m_newLayerNameLineEdit->setText(outfile.leaf().string().c_str());
547 
548  m_ui->m_newLayerNameLineEdit->setEnabled(false);
549 
550  m_toFile = true;
551 }
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
This class defines a an adjacency strategy class for a GPM constructor.
Geometric property.
std::auto_ptr< GeneralizedProximityMatrix > build()
Definition: GPMBuilder.cpp:78
Utility functions for the data access module.
const std::string & getDataSetName() const
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
TESAEXPORT void MoranMap(te::sa::GeneralizedProximityMatrix *gpm)
Function used to calculate the moran map info for a gpm, classifies the objects based in the scatterp...
TESAEXPORT double GlobalMoranSignificance(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx, int permutationsNumber, double moranIndex)
Function used to calculate the global moran significance.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
TESAEXPORT te::da::DataSourcePtr CreateOGRDataSource(std::string repository)
Definition: Utils.cpp:63
bool setGPMInfo(te::da::DataSourcePtr ds, const std::string &dataSetName, const std::string &attributeName)
Function used to create a empty gpm (using a MEMORY DIRECT graph)
Definition: GPMBuilder.cpp:49
This class defines a class to calculates a weight for a GPM using No Weights strategy.
TESAEXPORT void LocalMean(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate the local mean of each vertex from gpm graph.
te::sa::GeneralizedProximityMatrix * importFromGAL(std::string pathFileName, te::da::DataSource *ds=0)
Function used to import a gpm from a Spatial Weights File GAL Format.
te::sa::GeneralizedProximityMatrix * importFromGWT(std::string pathFileName, te::da::DataSource *ds=0)
Function used to import a gpm from a Spatial Weights File GWT Format.
std::auto_ptr< Ui::SpatialStatisticsDialogForm > m_ui
TESAEXPORT void LisaStatisticalSignificance(te::sa::GeneralizedProximityMatrix *gpm, int permutationsNumber)
Function used to calculate LISA Statical Significance for each gpm element.
Q_DECLARE_METATYPE(te::map::AbstractLayerPtr)
int getSRID() const
It returns the spatial reference system identifier associated to this property.
void removeViewer(int viewerId)
Dettach a progress viewer.
static ProgressManager & getInstance()
It returns a reference to the singleton instance.
A dialog to calculate spatial statistics from a attribute of a dataset.
const std::string & getDataSourceId() const
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
te::map::AbstractLayerPtr getOutputLayer()
TESAEXPORT void LISAMap(te::sa::GeneralizedProximityMatrix *gpm, int permutationsNumber)
Function used to calculate the lisa map info for a gpm, classifies the objects based in the statistic...
static void getSpatialWeightsFileInfo(std::string pathFileName, std::string &dataSetName, std::string &attrName)
Function used to get information of how a Spatial Weights was generated.
TESAEXPORT void BoxMap(te::sa::GeneralizedProximityMatrix *gpm, double mean)
Function used to calculate the box map info for a gpm, classifies the objects in quadrants based in t...
TESAEXPORT void ZAndWZ(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate the standard deviation Z and local mean of the desviation Z (WZ)...
int getType() const
It returns the property data type.
Definition: Property.h:161
This class defines a an Abstract class for a GPM constructor.
int addViewer(AbstractProgressViewer *apv)
Attach a progress viewer.
This class defines a an Abstract class to calculates a weight for a GPM.
const std::list< te::da::DataSourceInfoPtr > & getSelecteds() const
TESAEXPORT double MoranIndex(te::sa::GeneralizedProximityMatrix *gpm)
Function used to calculate the moran index, also calculates the local moran value.
TESAEXPORT te::map::AbstractLayerPtr CreateLayer(te::da::DataSourcePtr ds, std::string dataSetName)
Definition: Utils.cpp:122
A dialog for selecting a data source.
SpatialStatisticsDialog(QWidget *parent=0, Qt::WindowFlags f=0)
This class defines functions used to load and save gpm's using GAL and GWT formats, both formats use a ' ' as separator.
A layer with reference to a dataset.
Definition: DataSetLayer.h:47
std::auto_ptr< LayerSchema > getSchema() const
It returns the layer schema.
This class defines the GPM Builder class.
Definition: GPMBuilder.h:54
TESAEXPORT int AssociateGPMVertexAttribute(te::sa::GeneralizedProximityMatrix *gpm, te::da::DataSource *ds, std::string dataSetName, std::string attrLink, std::string attr, int dataType, int srid=TE_UNKNOWN_SRS, int subType=te::gm::UnknownGeometryType)
Function used to set a an attribute valeu from a dataset to the vertex objects from a gpm...
Definition: Utils.cpp:58
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
Definition: Utils.cpp:557
std::auto_ptr< te::sa::GeneralizedProximityMatrix > loadGPM()
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TESAEXPORT void GStatistics(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
The local spatial statistic G is calculated for each zone based on the spatial weights object used...
const std::string & getName() const
It returns the property name.
Definition: Property.h:127