27 #include "../../../color/ColorBar.h"
28 #include "../../../common/Globals.h"
29 #include "../../../common/STLUtils.h"
30 #include "../../../dataaccess/dataset/DataSet.h"
31 #include "../../../dataaccess/dataset/DataSetType.h"
32 #include "../../../dataaccess/query/OrderByItem.h"
33 #include "../../../dataaccess/utils/Utils.h"
34 #include "../../../geometry/GeometryProperty.h"
35 #include "../../../maptools/Enums.h"
36 #include "../../../maptools/Grouping.h"
37 #include "../../../maptools/GroupingAlgorithms.h"
38 #include "../../../maptools/GroupingItem.h"
39 #include "../../../maptools/Utils.h"
40 #include "../../../maptools/QueryLayer.h"
41 #include "../../../se/SymbolizerColorFinder.h"
42 #include "../../../se/Utils.h"
43 #include "../colorbar/ColorBar.h"
44 #include "../colorbar/ColorCatalogWidget.h"
45 #include "../se/LineSymbolizerWidget.h"
46 #include "../se/PointSymbolizerWidget.h"
47 #include "../se/PolygonSymbolizerWidget.h"
48 #include "../se/SymbologyPreview.h"
50 #include "ui_GroupingWidgetForm.h"
56 #include <QDialogButtonBox>
57 #include <QMessageBox>
59 #define MAX_SLICES 200
61 #define NO_TITLE "No Value"
67 m_ui(new Ui::GroupingWidgetForm),
72 QGridLayout* l =
new QGridLayout(
m_ui->m_colorBarWidget);
73 l->setContentsMargins(0,0,0,0);
99 if(m_ui->m_importGroupBox->isChecked())
101 QVariant varLayer = m_ui->m_layersComboBox->itemData(m_ui->m_layersComboBox->currentIndex(), Qt::UserRole);
111 std::string attr = m_ui->m_attrComboBox->currentText().toStdString();
112 int attrIdx = m_ui->m_attrComboBox->currentIndex();
113 int attrType = m_ui->m_attrComboBox->itemData(attrIdx).toInt();
115 int index = m_ui->m_typeComboBox->currentIndex();
116 int type = m_ui->m_typeComboBox->itemData(index).toInt();
120 group->setPropertyType(attrType);
122 group->setNumSlices(m_ui->m_slicesSpinBox->value());
124 group->setPrecision(m_ui->m_precSpinBox->value());
126 group->setStdDeviation(m_ui->m_stdDevDoubleSpinBox->value());
128 std::vector<te::map::GroupingItem*> groupingItems;
129 for(std::size_t t = 0; t < m_legend.size(); ++t)
133 groupingItems.push_back(gi);
135 group->setGroupingItems(groupingItems);
137 group->setSummary(m_ui->m_summaryComboBox->currentText().toStdString());
145 m_colorBar->getColorBar()->setHeight(20);
146 m_colorBar->getColorBar()->setScaleVisible(
false);
154 onTypeComboBoxActivated(0);
157 m_ui->m_slicesSpinBox->setMinimum(1);
158 m_ui->m_slicesSpinBox->setMaximum(
MAX_SLICES);
159 m_ui->m_slicesSpinBox->setValue(5);
160 m_ui->m_slicesSpinBox->setSingleStep(1);
163 m_ui->m_stdDevDoubleSpinBox->setMinimum(0.25);
164 m_ui->m_stdDevDoubleSpinBox->setMaximum(1.0);
165 m_ui->m_stdDevDoubleSpinBox->setValue(0.5);
166 m_ui->m_stdDevDoubleSpinBox->setSingleStep(0.25);
169 m_ui->m_precSpinBox->setMinimum(1);
170 m_ui->m_precSpinBox->setMaximum(
PRECISION);
171 m_ui->m_precSpinBox->setValue(6);
172 m_ui->m_precSpinBox->setSingleStep(1);
175 m_ui->m_tableWidget->resizeColumnsToContents();
176 #if (QT_VERSION >= 0x050000)
177 m_ui->m_tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
179 m_ui->m_tableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
187 disconnect(m_ui->m_tableWidget, SIGNAL(itemChanged(QTableWidgetItem*)),
this, SLOT(onTableWidgetItemChanged(QTableWidgetItem*)));
189 m_ui->m_tableWidget->setRowCount(0);
191 int index = m_ui->m_typeComboBox->currentIndex();
192 int type = m_ui->m_typeComboBox->itemData(index).toInt();
197 list.append(tr(
"Symbol"));
198 list.append(tr(
"Title"));
199 list.append(tr(
"Min"));
200 list.append(tr(
"Max"));
201 list.append(tr(
"Count"));
203 m_ui->m_tableWidget->setColumnCount(5);
204 m_ui->m_tableWidget->setHorizontalHeaderLabels(list);
209 list.append(tr(
"Symbol"));
210 list.append(tr(
"Title"));
211 list.append(tr(
"Value"));
212 list.append(tr(
"Count"));
214 m_ui->m_tableWidget->setColumnCount(4);
215 m_ui->m_tableWidget->setHorizontalHeaderLabels(list);
222 if(!m_legend.empty() && !m_legend[0]->getSymbolizers().empty() && !m_legend[m_legend.size() - 1]->getSymbolizers().empty())
226 scf.
find(m_legend[0]->getSymbolizers()[0]);
229 scf.
find(m_legend[m_legend.size() - 1]->getSymbolizers()[0]);
238 for(std::size_t t = 0; t < m_legend.size(); ++t)
242 int newrow = m_ui->m_tableWidget->rowCount();
243 m_ui->m_tableWidget->insertRow(newrow);
247 const std::vector<te::se::Symbolizer*>& ss = gi->
getSymbolizers();
250 QTableWidgetItem* item =
new QTableWidgetItem(icon,
"");
251 item->setFlags(Qt::ItemIsEnabled);
252 m_ui->m_tableWidget->setItem(newrow, 0, item);
257 QTableWidgetItem* item =
new QTableWidgetItem(QString::fromStdString(gi->
getTitle()));
258 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);
259 m_ui->m_tableWidget->setItem(newrow, 1, item);
264 if(count != 0 && count != m_legend.size() - 1)
266 double pos = (1. / (m_legend.size() - 1)) * count;
290 QTableWidgetItem* item =
new QTableWidgetItem(QString::fromStdString(gi->
getLowerLimit()));
291 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);
292 m_ui->m_tableWidget->setItem(newrow, 2, item);
297 QTableWidgetItem* item =
new QTableWidgetItem(QString::fromStdString(gi->
getUpperLimit()));
298 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);
299 m_ui->m_tableWidget->setItem(newrow, 3, item);
304 QTableWidgetItem* item =
new QTableWidgetItem(QString::number(gi->
getCount()));
305 item->setFlags(Qt::ItemIsEnabled);
306 m_ui->m_tableWidget->setItem(newrow, 4, item);
314 QTableWidgetItem* item =
new QTableWidgetItem(QString::fromStdString(gi->
getValue()));
315 item->setFlags(Qt::ItemIsEnabled);
316 m_ui->m_tableWidget->setItem(newrow, 2, item);
320 QTableWidgetItem* item =
new QTableWidgetItem(QString::number(gi->
getCount()));
321 item->setFlags(Qt::ItemIsEnabled);
322 m_ui->m_tableWidget->setItem(newrow, 3, item);
329 disconnect(m_colorBar, SIGNAL(colorBarChanged()),
this, SLOT(onColorBarChanged()));
334 connect(m_colorBar, SIGNAL(colorBarChanged()),
this, SLOT(onColorBarChanged()));
337 m_ui->m_tableWidget->resizeColumnsToContents();
338 #if (QT_VERSION >= 0x050000)
339 m_ui->m_tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
341 m_ui->m_tableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
344 connect(m_ui->m_tableWidget, SIGNAL(itemChanged(QTableWidgetItem*)),
this, SLOT(onTableWidgetItemChanged(QTableWidgetItem*)));
356 setGrouping(grouping);
358 emit applyPushButtonClicked();
369 for(
int i = 0; i < m_ui->m_typeComboBox->count(); ++i)
371 if(type == m_ui->m_typeComboBox->itemData(i).toInt())
373 m_ui->m_typeComboBox->setCurrentIndex(i);
375 onTypeComboBoxActivated(i);
384 for(
int i = 0; i < m_ui->m_attrComboBox->count(); ++i)
386 if(attrName == m_ui->m_attrComboBox->itemText(i).toStdString())
388 m_ui->m_attrComboBox->setCurrentIndex(i);
396 m_ui->m_precSpinBox->setValue((
int)prec);
401 m_ui->m_slicesSpinBox->setValue((
int)slices);
406 m_ui->m_stdDevDoubleSpinBox->setValue((
double)stdDev);
416 m_legend.push_back(gi);
421 onApplyPushButtonClicked();
428 int reply = QMessageBox::question(
this, tr(
"Classification"), tr(
"Manual changes will be lost. Continue?"), QMessageBox::Yes | QMessageBox::Cancel);
430 if(reply != QMessageBox::Yes)
434 int index = m_ui->m_typeComboBox->currentIndex();
436 int type = m_ui->m_typeComboBox->itemData(index).toInt();
437 int slices = m_ui->m_slicesSpinBox->value();
438 int prec = m_ui->m_precSpinBox->value();
439 double stdDev = m_ui->m_stdDevDoubleSpinBox->value();
441 std::string attr = m_ui->m_attrComboBox->currentText().toStdString();
442 int attrIdx = m_ui->m_attrComboBox->currentIndex();
443 int attrType = m_ui->m_attrComboBox->itemData(attrIdx).toInt();
448 std::string mean =
"";
456 std::vector<double> vec;
458 getDataAsDouble(vec, attr, attrType, nullValues);
462 buildSymbolizer(mean);
464 createDoubleNullGroupingItem(nullValues);
468 std::vector<double> vec;
470 getDataAsDouble(vec, attr, attrType, nullValues);
474 buildSymbolizer(mean);
476 createDoubleNullGroupingItem(nullValues);
480 std::vector<double> vec;
482 getDataAsDouble(vec, attr, attrType, nullValues);
486 buildSymbolizer(mean);
488 createDoubleNullGroupingItem(nullValues);
494 std::vector<std::string> vec;
496 getDataAsString(vec, attr, nullValues);
500 buildSymbolizer(mean);
502 createStringNullGroupingItem(nullValues);
509 emit applyPushButtonClicked();
514 int type = m_ui->m_typeComboBox->itemData(idx).toInt();
518 m_ui->m_slicesSpinBox->setEnabled(
true);
519 m_ui->m_precSpinBox->setEnabled(
true);
520 m_ui->m_stdDevDoubleSpinBox->setEnabled(
false);
524 m_ui->m_slicesSpinBox->setEnabled(
true);
525 m_ui->m_precSpinBox->setEnabled(
true);
526 m_ui->m_stdDevDoubleSpinBox->setEnabled(
false);
530 m_ui->m_slicesSpinBox->setEnabled(
false);
531 m_ui->m_precSpinBox->setEnabled(
true);
532 m_ui->m_stdDevDoubleSpinBox->setEnabled(
true);
536 m_ui->m_slicesSpinBox->setEnabled(
false);
537 m_ui->m_precSpinBox->setEnabled(
true);
538 m_ui->m_stdDevDoubleSpinBox->setEnabled(
false);
562 int index = m_ui->m_typeComboBox->currentIndex();
563 int type = m_ui->m_typeComboBox->itemData(index).toInt();
565 int curRow = m_ui->m_tableWidget->currentRow();
566 int curCol = m_ui->m_tableWidget->currentColumn();
568 QString str = item->text();
572 m_legend[curRow]->setTitle(str.toStdString());
576 else if(curCol == 2 || curCol == 3)
587 item->setText(m_legend[curRow]->getLowerLimit().c_str());
589 item->setText(m_legend[curRow]->getUpperLimit().c_str());
594 m_legend[curRow]->setLowerLimit(item->text().toStdString());
596 m_legend[curRow]->setUpperLimit(item->text().toStdString());
606 int curRow = m_ui->m_tableWidget->currentRow();
607 int curCol = m_ui->m_tableWidget->currentColumn();
615 QDialog* dialog =
new QDialog(
this);
616 QBoxLayout* layout =
new QBoxLayout(QBoxLayout::TopToBottom, dialog);
618 QDialogButtonBox* bbox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, dialog);
620 QWidget* symbWidget = 0;
622 if(symbVec[0]->getType() ==
"PolygonSymbolizer")
628 else if(symbVec[0]->getType() ==
"LineSymbolizer")
634 else if(symbVec[0]->getType() ==
"PointSymbolizer")
641 layout->addWidget(symbWidget);
642 layout->addWidget(bbox);
644 connect(bbox, SIGNAL(accepted()), dialog, SLOT(accept()));
645 connect(bbox, SIGNAL(rejected()), dialog, SLOT(reject()));
647 if(dialog->exec() == QDialog::Rejected)
653 if(symbVec[0]->getType() ==
"PolygonSymbolizer")
659 else if(symbVec[0]->getType() ==
"LineSymbolizer")
665 else if(symbVec[0]->getType() ==
"PointSymbolizer")
677 QTableWidgetItem* newItem =
new QTableWidgetItem(icon,
"");
678 newItem->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
680 m_ui->m_tableWidget->setItem(curRow, 0, newItem);
686 emit applyPushButtonClicked();
693 assert(m_layer.get());
697 getLinkedDataAsDouble(vec, attrName, dataType, nullValues);
701 std::auto_ptr<te::map::LayerSchema> dsType(m_layer->getSchema());
705 for(std::size_t t = 0; t < dsType->getProperties().size(); ++t)
707 if(dsType->getProperty(t)->getName() == attrName)
714 std::auto_ptr<te::da::DataSet> ds(m_layer->getData());
716 ds->moveBeforeFirst();
718 while(ds->moveNext())
727 vec.push_back((
double)ds->getInt16(idx));
729 vec.push_back((
double)ds->getInt32(idx));
731 vec.push_back((
double)ds->getInt64(idx));
733 vec.push_back((
double)ds->getFloat(idx));
735 vec.push_back(ds->getDouble(idx));
738 QString strNum = ds->getNumeric(idx).c_str();
742 double value = strNum.toDouble(&ok);
745 vec.push_back(value);
752 assert(m_layer.get());
754 std::auto_ptr<te::map::LayerSchema> dsType(m_layer->getSchema());
756 std::string
function = m_ui->m_summaryComboBox->currentText().toStdString();
757 std::vector<std::string> poid;
768 std::vector<te::dt::Property*> props = dsType->getPrimaryKey()->getProperties();
769 while(++pksize < props.size())
771 poid.push_back(props[pksize-1]->getName());
772 if(props[pksize-1]->getDatasetName() != props[pksize]->getDatasetName())
776 for(
size_t i = 0; i < pksize; ++i)
784 for(std::size_t t = 0; t < dsType->getProperties().size(); ++t)
786 if(dsType->getProperty(t)->getName() == attrName)
793 std::vector<std::string> pkdata(pksize), pkdataaux(pksize);
794 std::auto_ptr<te::da::DataSet> ds(m_layer->getData());
797 bool nullValue =
false;
798 std::vector<double> values;
800 ds->moveBeforeFirst();
802 while(ds->moveNext())
808 for(i = 0; i < pksize; ++i)
810 pkdata[i] = ds->getAsString(poid[i]);
814 pkdataaux[i] = ds->getAsString(poid[i]);
818 for(i = 0; i < pksize; ++i)
820 if(pkdata[i] != pkdataaux[i])
828 if(nullValue ==
false)
835 values.push_back((
double)ds->getInt16(idx));
837 values.push_back((
double)ds->getInt32(idx));
839 values.push_back((
double)ds->getInt64(idx));
841 values.push_back((
double)ds->getFloat(idx));
843 values.push_back(ds->getDouble(idx));
846 QString strNum = ds->getNumeric(idx).c_str();
850 double value = strNum.toDouble(&ok);
853 values.push_back(value);
877 values.push_back((
double)ds->getInt16(idx));
879 values.push_back((
double)ds->getInt32(idx));
881 values.push_back((
double)ds->getInt64(idx));
883 values.push_back((
double)ds->getFloat(idx));
885 values.push_back(ds->getDouble(idx));
888 QString strNum = ds->getNumeric(idx).c_str();
892 double value = strNum.toDouble(&ok);
895 values.push_back(value);
911 assert(m_layer.get());
915 getLinkedDataAsString(vec, attrName, nullValues);
919 std::auto_ptr<te::map::LayerSchema> dsType(m_layer->getSchema());
923 for(std::size_t t = 0; t < dsType->getProperties().size(); ++t)
925 if(dsType->getProperty(t)->getName() == attrName)
932 std::auto_ptr<te::da::DataSet> ds(m_layer->getData());
934 ds->moveBeforeFirst();
936 while(ds->moveNext())
939 vec.push_back(ds->getAsString(idx));
947 assert(m_layer.get());
949 std::auto_ptr<te::map::LayerSchema> dsType(m_layer->getSchema());
951 std::string
function = m_ui->m_summaryComboBox->currentText().toStdString();
952 std::vector<std::string> poid;
963 std::vector<te::dt::Property*> props = dsType->getPrimaryKey()->getProperties();
964 while(++pksize < props.size())
966 poid.push_back(props[pksize-1]->getName());
967 if(props[pksize-1]->getDatasetName() != props[pksize]->getDatasetName())
971 for(
size_t i = 0; i < pksize; ++i)
979 for(std::size_t t = 0; t < dsType->getProperties().size(); ++t)
981 if(dsType->getProperty(t)->getName() == attrName)
988 std::vector<std::string> pkdata(pksize), pkdataaux(pksize);
989 std::auto_ptr<te::da::DataSet> ds(m_layer->getData());
992 bool nullValue =
false;
993 std::vector<std::string> values;
995 ds->moveBeforeFirst();
997 while(ds->moveNext())
1003 for(i = 0; i < pksize; ++i)
1005 pkdata[i] = ds->getAsString(poid[i]);
1009 pkdataaux[i] = ds->getAsString(poid[i]);
1013 for(i = 0; i < pksize; ++i)
1015 if(pkdata[i] != pkdataaux[i])
1023 if(nullValue ==
false)
1028 values.push_back(ds->getAsString(idx));
1048 values.push_back(ds->getAsString(idx));
1071 int geomType = getGeometryType();
1072 std::vector<te::se::Symbolizer*> symbVec;
1074 symbVec.push_back(s);
1077 m_legend.push_back(legendItem);
1090 int geomType = getGeometryType();
1091 std::vector<te::se::Symbolizer*> symbVec;
1093 symbVec.push_back(s);
1096 m_legend.push_back(legendItem);
1101 assert(m_layer.get());
1110 m_cb = m_colorBar->getColorBar()->getColorBar();
1112 int legendSize = m_legend.size();
1114 std::vector<te::color::RGBAColor> colorVec;
1116 if(meanTitle.empty())
1118 colorVec = m_cb->getSlices(legendSize);
1126 for(
size_t t = 0; t < m_legend.size(); ++t)
1128 if(m_legend[t]->getTitle() != meanTitle)
1135 afterMean = m_legend.size() - t - 1;
1140 std::vector<te::color::RGBAColor> lowerColorVec = m_cb->getLowerMeanSlices(beforeMean);
1142 std::vector<te::color::RGBAColor> upperColorVec = m_cb->getUpperMeanSlices(afterMean);
1144 for(
size_t t = 0; t < lowerColorVec.size(); ++t)
1145 colorVec.push_back(lowerColorVec[t]);
1147 colorVec.push_back(meanColor);
1149 for(
size_t t = 0; t < upperColorVec.size(); ++t)
1150 colorVec.push_back(upperColorVec[t]);
1153 if(colorVec.size() != m_legend.size())
1156 int geomType = getGeometryType();
1158 for(
size_t t = 0; t < colorVec.size(); ++t)
1160 std::vector<te::se::Symbolizer*> symbVec;
1164 symbVec.push_back(s);
1166 m_legend[t]->setSymbolizers(symbVec);
1172 QString curValue = m_ui->m_attrComboBox->currentText();
1174 m_ui->m_attrComboBox->clear();
1176 std::auto_ptr<te::map::LayerSchema> dsType(m_layer->getSchema());
1179 int index = m_ui->m_typeComboBox->currentIndex();
1180 int type = m_ui->m_typeComboBox->itemData(index).toInt();
1184 for(
size_t t = 0; t < dsType->getProperties().size(); ++t)
1198 m_ui->m_attrComboBox->addItem(p->
getName().c_str(), p->
getType());
1207 for(
size_t t = 0; t < dsType->getProperties().size(); ++t)
1222 m_ui->m_attrComboBox->addItem(p->
getName().c_str(), p->
getType());
1230 if(curValue.isEmpty() ==
false)
1232 int idx = m_ui->m_attrComboBox->findText(curValue);
1235 m_ui->m_attrComboBox->setCurrentIndex(idx);
1241 m_layer = selectedLayer;
1250 m_ui->m_summaryComboBox->clear();
1253 m_ui->m_summaryComboBox->addItem(
"MIN");
1254 m_ui->m_summaryComboBox->addItem(
"MAX");
1255 m_ui->m_summaryComboBox->addItem(
"SUM");
1256 m_ui->m_summaryComboBox->addItem(
"AVERAGE");
1257 m_ui->m_summaryComboBox->addItem(
"MEDIAN");
1258 m_ui->m_summaryComboBox->addItem(
"STDDEV");
1259 m_ui->m_summaryComboBox->addItem(
"VARIANCE");
1261 if(m_layer->getGrouping())
1263 int index = m_ui->m_summaryComboBox->findText(QString::fromStdString(m_layer->getGrouping()->getSummary()));
1264 m_ui->m_summaryComboBox->setCurrentIndex(index);
1267 m_ui->m_summaryComboBox->setEnabled(
true);
1268 m_ui->m_summaryComboBox->show();
1269 m_ui->m_summaryLabel->show();
1273 m_ui->m_summaryComboBox->addItem(
"NONE");
1274 m_ui->m_summaryComboBox->setEnabled(
false);
1275 m_ui->m_summaryComboBox->hide();
1276 m_ui->m_summaryLabel->hide();
1279 for(std::size_t i = 0; i < allLayers.size(); ++i)
1281 if(!allLayers[i]->isValid())
1284 std::auto_ptr<te::da::DataSetType> dt(allLayers[i]->getSchema());
1286 if(dt->hasGeom() && allLayers[i]->getGrouping() && allLayers[i]->getId() != selectedLayer->getId())
1288 m_ui->m_layersComboBox->addItem(allLayers[i]->getTitle().c_str(), QVariant::fromValue(allLayers[i]));
1295 if(m_ui->m_layersComboBox->currentText() ==
"")
1297 QMessageBox::warning(
this, tr(
"Grouping"), tr(
"There are no other layers with Grouping!"));
1303 int reply = QMessageBox::question(
this, tr(
"Grouping"), tr(
"Manual changes will be lost. Continue?"), QMessageBox::Yes | QMessageBox::Cancel);
1305 if(reply != QMessageBox::Yes)
1309 QVariant varLayer = m_ui->m_layersComboBox->itemData(m_ui->m_layersComboBox->currentIndex(), Qt::UserRole);
1314 std::auto_ptr<te::da::DataSetType> dt = m_layer->getSchema();
1316 std::vector<te::dt::Property*> props = dt->getProperties();
1318 bool isValid =
false;
1319 for(std::size_t i = 0; i < props.size(); ++i)
1331 QString err = tr(
"There is no grouping that can be imported!\nThe layer must have an attribute with the same name of the attribute used to make the reference layer grouping: ");
1332 err.append(ref->getPropertyName().c_str());
1333 QMessageBox::warning(
this, tr(
"Grouping"), err);
1339 setGrouping(newGrouping);
1345 emit applyPushButtonClicked();
void setValue(const std::string &value)
It sets value of the legend item.
const double getStdDeviation() const
It gets the standard deviation used in the Standard Deviation grouping.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
TESEEXPORT Symbolizer * CreateSymbolizer(const te::gm::GeomType &geomType)
Try creates an appropriate symbolizer based on given geometry type.
const std::string & getValue() const
It gets the value of the legend item.
TEDATAACCESSEXPORT bool HasLinkedTable(te::da::DataSetType *type)
It checks if the datasettype has a linked table.
const size_t getPrecision() const
It gets the precision used for the property values.
A Symbolizer describes how a feature is to appear on a map.
std::string getPropertyName() const
It gets the property name whose values will be grouped.
TEMAPEXPORT te::gm::GeomType GetGeomType(const te::map::AbstractLayerPtr &layer)
It gets the geometry type of the given layer.
void addColor(const RGBAColor &color, const double &pos)
It adds a color in the color bar.
boost::ptr_vector< OrderByItem > OrderBy
A class that can be used to model an ORDER BY clause.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
A layer resulting from a query.
void setTitle(const std::string &title)
It sets the title of the legend item.
void GroupingByEqualSteps(iterator begin, iterator end, int nSteps, std::vector< te::map::GroupingItem * > &legend, int precision=0, bool countElements=true)
It groups the values defined by a range of iterators using the equal steps algorithm.
It models a property definition.
void GroupingByStdDeviation(iterator begin, iterator end, double nDevs, std::vector< te::map::GroupingItem * > &legend, std::string &meanTitle, int precision=0, bool countElements=true)
It groups the values defined by a range of iterators using the standard deviation algorithm...
This class contains the parameters needed for grouping the values of a Property.
A GroupingItem contains information about a grouping item associated to a layer.
TEDATAACCESSEXPORT double GetSummarizedValue(std::vector< double > &values, const std::string &summary)
It gets the summarized value.
te::da::Select * getQuery() const
Query * clone() const
It creates a new copy of this query.
void setOrderBy(OrderBy *o)
It sets the list of expressions used to sort the output result.
void GroupingByQuantil(iterator begin, iterator end, int nSteps, std::vector< te::map::GroupingItem * > &legend, int precision=0, bool countElements=true)
It groups the values defined by a range of iterators using the quantil algorithm. ...
A Select models a query to be used when retrieving data from a DataSource.
A Symbology Enconding visitor that finds a color given a symbolizer element. If you want to use this ...
int getType() const
It returns the property data type.
void find(const te::se::Symbolizer *symbolizer)
It find the color based on given symbolizer.
const std::vector< te::map::GroupingItem * > & getGroupingItems() const
It gets the vector of grouping items.
GroupingType
The grouping type associated to the layer.
const std::string & getUpperLimit() const
It gets the upper limit value of the legend item.
TEMAPEXPORT void GroupingByUniqueValues(std::vector< std::string > &inputValues, int dataType, std::vector< te::map::GroupingItem * > &legend, int precision)
It groups the values using the unique value algorithm.
void setCount(std::size_t count)
It It sets the number of objects whose values are between the lower and upper limits.
void setQuery(te::da::Select *s)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
void setUpperLimit(const std::string &to)
It sets the upper limit value of the legend item.
const GroupingType getType() const
It gets the grouping type.
It models the concept of color bar.
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
const size_t getNumSlices() const
It gets the number of slices used in the Equal Steps and Quantil groupings.
std::size_t getCount() const
It gets the number of objects whose values are between the lower and upper limits.
A class that can be used in an ORDER BY clause to sort the items of a resulting query.
std::string getTitle()
It gets the title of the legend item.
const std::string & getLowerLimit() const
It gets the lower limit value of the legend item.
te::color::RGBAColor getColor()
Get the color.
const std::vector< te::se::Symbolizer * > & getSymbolizers() const
It gets the symbolizer of the legend item.
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...
void setSymbolizers(const std::vector< te::se::Symbolizer * > &symbolizers)
It sets the symbolizers of the legend item.
static const std::string sm_nanStr
Not a number string value.
const std::string & getName() const
It returns the property name.
void setLowerLimit(const std::string &from)
It sets the lower limit value of the legend item.