27 #include "../../../color/RGBAColor.h" 28 #include "../../../common/progress/TaskProgress.h" 29 #include "../../../dataaccess/dataset/DataSet.h" 30 #include "../../../dataaccess/dataset/DataSetType.h" 31 #include "../../../dataaccess/dataset/ObjectIdSet.h" 32 #include "../../../dataaccess/utils/Utils.h" 33 #include "../../../dataaccess/datasource/DataSourceFactory.h" 34 #include "../../../datatype.h" 35 #include "../../../raster.h" 36 #include "../../../maptools/ExternalGraphicRendererManager.h" 37 #include "../../../maptools/MarkRendererManager.h" 38 #include "../../../maptools/Utils.h" 39 #include "../../../memory/DataSet.h" 40 #include "../../../memory/DataSetItem.h" 41 #include "../../../qt/widgets/Utils.h" 42 #include "../../../se/Utils.h" 43 #include "../../../se.h" 44 #include "../../../statistics/core/Enums.h" 45 #include "../../../statistics/core/NumericStatisticalSummary.h" 46 #include "../../../statistics/core/StringStatisticalSummary.h" 47 #include "../../../statistics/core/SummaryFunctions.h" 48 #include "../../../statistics/core/Utils.h" 59 #include <boost/lexical_cast.hpp> 60 #include <boost/ptr_container/ptr_vector.hpp> 71 static double cof[6]= {76.18009173, -86.50532033, 24.01409822,
72 -1.231739516, 0.120858003e-2, -0.536382e-5};
75 x =
static_cast<double>(xx) - 1.0;
77 tmp -= (x+0.5)*log(tmp);
85 return static_cast<float>(-tmp + log(2.50662827465*ser));
88 void gser(
float * gamser,
float a,
float x,
float * gln )
101 printf (
"x less than 0 in the GSER routine");
110 del= sum =
static_cast<float>(1.0/
static_cast<double>(a));
111 for (n=1; n <= ITMAX; n++)
116 if (fabs (static_cast<double>(del)) < fabs (static_cast<double>(sum))*EPS)
118 *gamser =
static_cast<float>(
static_cast<double>(sum)*exp(static_cast<double>(-x+a*static_cast<float>(log(static_cast<double>(x)))-(*gln))));
126 void gcf(
float * gammcf,
float a,
float x,
float * gln )
132 float gold=0.0, g, fac=1.0, b1=1.0;
133 float b0=0.0, anf, ana, an, a1, a0=1.0;
139 for(n=1; n<= ITMAX; n++)
141 an =
static_cast<float>(n);
143 a0 = (a1+a0*ana)*fac;
144 b0 = (b1+b0*ana)*fac;
150 fac =
static_cast<float>(1.0/
static_cast<double>(a1));
152 if (fabs(static_cast<double>((g-gold)/g)) < EPS)
154 *gammcf =
static_cast<float>(exp (static_cast<double>(-x+a*static_cast<float>(log(static_cast<double>(x)))-(*gln))*static_cast<double>(g)));
164 float gamser, gammcf, gln;
166 if (static_cast<double>(x) < (static_cast<double>(a)+1.0))
168 gser (&gamser, a, x, &gln);
173 gcf (&gammcf, a, x, &gln);
174 return static_cast<float>(1.0 -
static_cast<double>(gammcf));
180 return static_cast<double>(x) < 0.0 ? -
gammp(0.5, x*x) :
gammp(0.5,x*x);
183 double getDouble(
const std::string& value, std::vector<std::string>& sVector)
186 for(std::size_t i=0;i<sVector.size();++i)
188 if(value==sVector[i])
189 return static_cast<double>(i);
192 sVector.push_back(value);
193 return static_cast<double>(sVector.size()-1);
200 std::unique_ptr<te::dt::TimeInstant> ti (static_cast<te::dt::TimeInstant*>(dateTime));
201 boost::gregorian::date basedate(1400, 01, 01);
202 boost::gregorian::date_duration days = ti->getDate().getDate() - basedate;
203 long long int seconds = ti->getTime().getTimeDuration().total_seconds();
204 long long int dias = days.days();
205 double v =
static_cast<double>(dias) * 86400 + seconds;
210 std::unique_ptr<te::dt::Date>
d (static_cast<te::dt::Date*>(dateTime));
211 boost::gregorian::date basedate(1400, 01, 01);
212 boost::gregorian::date_duration days = d->getDate() - basedate;
213 double v = days.days();
234 res = dataset->
getInt16(static_cast<size_t>(propId));
237 res = dataset->
getInt16(static_cast<size_t>(propId));
240 res = dataset->
getInt32(static_cast<size_t>(propId));
243 res = dataset->
getInt32(static_cast<size_t>(propId));
246 res = dataset->
getInt64(static_cast<size_t>(propId));
249 res = dataset->
getInt64(static_cast<size_t>(propId));
252 res =
static_cast<double>(dataset->
getFloat(static_cast<size_t>(propId)));
255 res = boost::lexical_cast<
double>(dataset->
getNumeric(static_cast<size_t>(propId)));
258 res = dataset->
getDouble(static_cast<size_t>(propId));
365 std::map<std::string, std::vector<std::pair<double, double> > > valuesToSummarize,
369 std::map<std::string, std::vector<te::da::ObjectId*> >::iterator oidsIt;
370 std::map<std::string, std::vector<std::pair<double, double> > > ::iterator valuesIt;
373 for(valuesIt = valuesToSummarize.begin(); valuesIt != valuesToSummarize.end(); ++valuesIt)
377 if((*valuesIt).second.size() > 1 && (stat != -1))
379 std::vector<double> xValues;
380 std::vector<double> yValues;
381 std::vector<te::da::ObjectId*> oids;
383 for(
size_t i = 0; i < (*valuesIt).second.size(); ++i)
385 xValues.push_back((*valuesIt).second[i].first);
386 yValues.push_back((*valuesIt).second[i].second);
387 oids = oidsToSummarize[(*valuesIt).first];
390 double summarizedXValue, summarizedYValue;
398 for(
size_t j = 0; j < oids.size(); ++j)
399 scatter->
addData(summarizedXValue, summarizedYValue, oids[j]);
405 double xValue = (*valuesIt).second[0].first;
406 double yValue = (*valuesIt).second[0].second;
408 std::vector<te::da::ObjectId*> oids;
409 oids = oidsToSummarize[(*valuesIt).first];
411 scatter->
addData(xValue, yValue, oids[0]);
429 void buildNumericFrequencies(
int slices,
int stat, std::map<std::string, std::vector<std::pair<double, te::da::ObjectId*> > > valuestoSummarize,
430 std::vector<double>& intervals, std::map<
double, std::vector<te::da::ObjectId*> >& intervalToOIds,
431 std::vector< unsigned int>& frequencies,
double& minValue,
double& interval)
434 std::map<std::string, std::vector<std::pair<double, te::da::ObjectId*> > >::iterator valuesIt;
435 std::vector<std::pair<double, std::vector<te::da::ObjectId*> > > summarizedValuesToOId;
438 for(valuesIt = valuestoSummarize.begin(); valuesIt != valuestoSummarize.end(); ++valuesIt)
441 if((*valuesIt).second.size() > 1 && stat != -1)
443 std::vector<double> values;
444 std::vector<te::da::ObjectId*> oids;
445 for(
size_t i = 0; i < (*valuesIt).second.size(); ++i)
447 values.push_back((*valuesIt).second[i].first);
448 oids.push_back((*valuesIt).second[i].second);
451 double summarizedValue;
454 summarizedValuesToOId.push_back(std::make_pair(summarizedValue, oids));
458 for(
size_t i = 0; i < (*valuesIt).second.size(); ++i)
460 std::vector<te::da::ObjectId*> oids;
461 oids.push_back((*valuesIt).second[i].second);
462 summarizedValuesToOId.push_back(std::make_pair((*valuesIt).second[i].first, oids));
467 double maxValue = -std::numeric_limits<double>::max();
469 for(
size_t i = 0; i < summarizedValuesToOId.size(); ++i)
471 double currentValue = summarizedValuesToOId[i].first;
474 if(minValue > currentValue)
475 minValue = currentValue;
476 if(maxValue < currentValue)
477 maxValue = currentValue;
481 interval = ((maxValue * 1.000001 - minValue) / slices);
484 for (
double i = minValue; i <(maxValue+interval); i+=interval)
486 intervals.push_back(i);
487 std::vector<te::da::ObjectId*> valuesOIds;
488 intervalToOIds.insert(std::make_pair(i, valuesOIds));
491 frequencies.resize(intervals.size(), 0);
494 for(
size_t i = 0; i < summarizedValuesToOId.size(); ++i)
496 double currentValue = summarizedValuesToOId[i].first;
497 for (
size_t j = 0; j<intervals.size(); ++j)
499 if((currentValue >= intervals[j]) && (currentValue <= intervals[j+1]))
501 for(
size_t k= 0; k < summarizedValuesToOId[i].second.size(); ++k)
502 intervalToOIds.at(intervals[j]).push_back(summarizedValuesToOId[i].second[k]);
521 void buildStringFrequencies(
int stat, std::map<std::string, std::vector<std::pair<std::string, te::da::ObjectId*> > > valuestoSummarize,
522 std::map<std::string, std::vector<te::da::ObjectId*> >& intervalToOIds,
523 std::vector< unsigned int>& frequencies)
526 std::map<std::string, std::vector<std::pair<std::string, te::da::ObjectId*> > >::iterator valuesIt;
527 std::map<std::string, std::vector<te::da::ObjectId*> >::iterator intervalsIt;
528 std::vector<std::pair<std::string, std::vector<te::da::ObjectId*> > > summarizedValuesToOId;
531 for(valuesIt = valuestoSummarize.begin(); valuesIt != valuestoSummarize.end(); ++valuesIt)
534 if((*valuesIt).second.size() > 1 && (stat != -1))
536 std::vector<std::string> values;
537 std::vector<te::da::ObjectId*> oids;
538 for(
size_t i = 0; i < (*valuesIt).second.size(); ++i)
540 values.push_back((*valuesIt).second[i].first);
541 oids.push_back((*valuesIt).second[i].second);
544 std::string summarizedValue;
547 summarizedValuesToOId.push_back(std::make_pair(summarizedValue, oids));
551 for(
size_t i = 0; i < (*valuesIt).second.size(); ++i)
553 std::vector<te::da::ObjectId*> oids;
554 oids.push_back((*valuesIt).second[i].second);
555 summarizedValuesToOId.push_back(std::make_pair((*valuesIt).second[i].first, oids));
561 for(
size_t i = 0; i < summarizedValuesToOId.size(); ++i)
564 std::string currentValue = summarizedValuesToOId[i].first;
565 for ( j= 0, intervalsIt = intervalToOIds.begin(); intervalsIt != intervalToOIds.end(); ++intervalsIt,++j)
567 if(currentValue == (*intervalsIt).first)
569 for(
size_t k= 0; k < summarizedValuesToOId[i].second.size(); ++k)
570 intervalToOIds.at(currentValue).push_back(summarizedValuesToOId[i].second[k]);
572 ++frequencies[
static_cast<size_t>(j)];
587 std::vector<size_t>::iterator it;
588 std::vector<std::string> propNames;
590 for(it=pkeys.begin(); it!=pkeys.end(); ++it)
601 valuesOIDs.push_back(oid);
608 std::vector<std::size_t> objIdIdx;
611 std::map<double, std::vector<te::da::ObjectId*> > valuesIdsByinterval;
612 std::vector<te::da::ObjectId*> valuesOIds;
615 if(rpos != std::string::npos)
617 std::unique_ptr<te::rst::Raster> raster(dataset->
getRaster(rpos));
618 double xDummyValue = raster->getBand(static_cast<size_t>(propX))->getProperty()->m_noDataValue;
619 double yDummyValue = raster->getBand(static_cast<size_t>(propY))->getProperty()->m_noDataValue;
621 unsigned int nCol = raster->getNumberOfColumns();
622 unsigned int nLin = raster->getNumberOfRows();
630 unsigned int maxInputPoints =
static_cast<unsigned int>(nCol * nLin * 0.10);
635 while (pit != pitend)
643 raster->getValue(pit.
getColumn(), pit.
getRow(), val1,
static_cast<size_t>(propX));
644 raster->getValue(pit.
getColumn(), pit.
getRow(), val2,
static_cast<size_t>(propY));
646 if ((val1 == xDummyValue) || (val2 == yDummyValue))
653 newScatter->
addX(val1);
654 newScatter->
addY(val2);
661 for (
unsigned int c=0; c < nCol; ++c)
667 for (
unsigned int r=0; r <nLin; ++r)
670 raster->getValue(c, r, val1, static_cast<size_t>(propX));
671 raster->getValue(c, r, val2, static_cast<size_t>(propY));
673 if ((val1 == xDummyValue) || (val2 == yDummyValue))
676 newScatter->
addX(val1);
677 newScatter->
addY(val2);
690 std::pair<std::string, int> dsProps;
694 std::map<std::string, std::vector<te::da::ObjectId*> > oidsToSummarize;
695 std::map<std::string, std::vector<std::pair<double, double> > > valuesToSummarize;
709 double x_doubleValue = 0.;
710 double y_doubleValue = 0.;
714 if(dataset->
isNull(static_cast<size_t>(propX)))
717 x_doubleValue =
getDouble(dataset, propX);
721 if(dataset->
isNull(static_cast<size_t>(propX)))
724 std::unique_ptr<te::dt::DateTime> dateTime = dataset->
getDateTime(static_cast<size_t>(propX));
725 x_doubleValue =
getDouble(dateTime.release());
731 if(dataset->
isNull(static_cast<size_t>(propY)))
733 y_doubleValue =
getDouble(dataset, propY);
737 if(dataset->
isNull(static_cast<size_t>(propY)))
740 std::unique_ptr<te::dt::DateTime> dateTime = dataset->
getDateTime(static_cast<size_t>(propY));
741 y_doubleValue =
getDouble(dateTime.release());
749 newScatter->
addData(x_doubleValue, y_doubleValue, currentOid);
754 valuesToSummarize[
te::da::getBasePkey(currentOid, dsProps)].push_back(std::make_pair(x_doubleValue, y_doubleValue));
773 chartStyle->
setTitle(QString::fromUtf8(
"Scatter"));
780 chart->attach(chartDisplay);
784 displayWidget->show();
785 displayWidget->setWindowTitle(
"Scatter");
786 return displayWidget;
792 std::unique_ptr<te::da::DataSet> dataset = layer->getData();
793 std::unique_ptr<te::da::DataSetType> dataType = layer->getSchema();
795 std::vector<std::size_t> objIdIdx;
798 if(dataType->hasRaster())
801 double dummy = rstptr->getBand(static_cast<size_t>(propId))->getProperty()->m_noDataValue;
802 std::map<double, unsigned int> histogram;
806 histogram = rstptr->getBand(static_cast<size_t>(propId))->getHistogramR(0, 0, 0, 0, static_cast<unsigned int>(slices));
811 const unsigned int nCol = rstptr->getNumberOfColumns();
812 const unsigned int nLin = rstptr->getNumberOfRows();
813 const unsigned int maxInputPoints =
static_cast<unsigned int>( ((double)nCol) * ((double)nLin) * 0.10);
817 std::vector< double > values;
819 std::size_t valuesIdx = 0;
820 double valuesMin = std::numeric_limits< double >::max();
821 double valuesMax = -1.0 * std::numeric_limits< double >::max();
825 rstptr->getValue(pIt.
getColumn(), pIt.
getRow(), value,
static_cast<size_t>(propId));
829 values.push_back( value );
831 if( value > valuesMax ) valuesMax = value;
832 if( value < valuesMin ) valuesMin = value;
841 const double delta = (valuesMax - valuesMin) / ( (
double)( slices - 1 ) );
844 if( !values.empty() )
846 histogram[ valuesMax ] = (
unsigned int)values.size();
851 const std::size_t valuesSize = values.size();
853 for (
int sliceIdx = 0 ; sliceIdx < slices ; ++sliceIdx )
855 histogram[ valuesMin + ( ((double)sliceIdx) * delta ) ] = 0;
858 std::map<double, unsigned int>::iterator histogramIt;
859 const std::map<double, unsigned int>::iterator histogramItEnd = histogram.
end();
861 for ( std::size_t valuesIdx = 0 ; valuesIdx < valuesSize ; ++valuesIdx )
863 histogramIt = histogram.lower_bound( values[ valuesIdx ] );
864 assert( histogramIt != histogramItEnd );
866 ++( histogramIt->second );
871 const double min = histogram.begin()->first;
872 const double max = histogram.rbegin()->first;
874 for(std::map<double, unsigned int>::iterator it = histogram.begin(); it != histogram.end(); ++it)
881 newHistogram->
setInterval( (max - min) / ((
double)( slices - 1 )) );
890 int propType = dataset->getPropertyDataType(static_cast<size_t>(propId));
891 newHistogram->
setType(propType);
897 std::pair<std::string, int> dsProps;
901 std::map<std::string, std::vector<std::pair<double, te::da::ObjectId*> > > valuesToSummarize;
905 task.
setTotalSteps((static_cast<int>(dataset->getNumProperties())) * 2);
907 dataset->moveBeforeFirst();
910 while(dataset->moveNext())
913 if(dataset->isNull(static_cast<size_t>(propId)))
921 double currentValue =
getDouble(dataset.get(), propId);
923 valuesToSummarize[
te::da::getBasePkey(currentOid, dsProps)].push_back(std::make_pair(currentValue, currentOid));
929 double minValue = std::numeric_limits<double>::max();
932 double interval = std::numeric_limits<double>::max();
935 std::vector<double> intervals;
938 std::vector< unsigned int> frequencies;
941 std::map<double, std::vector<te::da::ObjectId*> > intervalToOIds;
944 buildNumericFrequencies(slices, stat, valuesToSummarize, intervals, intervalToOIds, frequencies, minValue, interval);
947 for (
unsigned int i= 0; i<intervals.size(); ++i)
950 newHistogram->
insert(std::make_pair(data, frequencies[i]), intervalToOIds.at(intervals[i]));
956 dataset->moveBeforeFirst();
965 std::unique_ptr<te::da::DataSet> dataset = layer->getData();
966 std::unique_ptr<te::da::DataSetType> dataType = layer->getSchema();
968 std::vector<std::size_t> objIdIdx;
974 if(dataType->hasRaster())
977 std::map<double, unsigned int> values = rstptr->getBand(static_cast<size_t>(propId))->getHistogramR();
979 for(std::map<double, unsigned int>::iterator it = values.begin(); it != values.end(); ++it)
986 const std::complex<double>* cmin = rsMin->at(static_cast<size_t>(propId)).m_minVal;
993 int propType = dataset->getPropertyDataType(static_cast<size_t>(propId));
994 newHistogram->
setType(propType);
997 std::vector< unsigned int> frequencies;
1001 std::set <std::string> intervals;
1002 std::set <std::string>::iterator intervalsIt;
1003 std::map<std::string, std::vector<te::da::ObjectId*> > valuesIdsByinterval;
1004 std::vector<te::da::ObjectId*> valuesOIds;
1007 std::pair<std::string, int> dsProps;
1011 std::map<std::string, std::vector<std::pair<std::string, te::da::ObjectId*> > > valuesToSummarize;
1014 dataset->moveBeforeFirst();
1015 while(dataset->moveNext())
1018 if(dataset->isNull(static_cast<size_t>(propId)))
1021 if(!task.isActive())
1026 std::string interval = dataset->getString(static_cast<size_t>(propId));
1029 intervals.insert(interval);
1033 for (intervalsIt = intervals.begin(); intervalsIt != intervals.end(); ++intervalsIt)
1035 valuesIdsByinterval.insert(make_pair((*intervalsIt), valuesOIds));
1038 frequencies.resize(intervals.size(), 0);
1039 dataset->moveBeforeFirst();
1043 while(dataset->moveNext())
1046 if(dataset->isNull(static_cast<size_t>(propId)))
1049 if(!task.isActive())
1054 std::string currentValue = dataset->getString(static_cast<size_t>(propId));
1056 valuesToSummarize[
te::da::getBasePkey(currentOid, dsProps)].push_back(std::make_pair(currentValue, currentOid));
1065 for (i= 0, intervalsIt = intervals.begin(); intervalsIt != intervals.end(); ++intervalsIt,++i)
1068 newHistogram->
insert(std::make_pair(data, frequencies[static_cast<size_t>(i)]), valuesIdsByinterval.at(*intervalsIt));
1071 dataset->moveBeforeFirst();
1075 return newHistogram;
1081 std::unique_ptr<te::da::DataSet> dataset = layer->
getData();
1082 int propType = dataset->getPropertyDataType(static_cast<size_t>(propId));
1095 chartStyle->
setTitle(QString::fromUtf8(
"Histogram"));
1096 chartStyle->
setAxisX(QString::fromUtf8(dataset->getPropertyName(static_cast<size_t>(propId)).c_str()));
1097 chartStyle->
setAxisY(QString::fromUtf8(
"Frequency"));
1102 chart->
attach(chartDisplay);
1106 displayWidget->show();
1107 displayWidget->setWindowTitle(
"Histogram");
1108 return displayWidget;
1115 std::unique_ptr<te::da::DataSet> dataset = layer->
getData();
1119 chartStyle->
setTitle(QString::fromUtf8(
"Histogram"));
1120 chartStyle->
setAxisX(QString::fromUtf8((summary +
": " + dataset->getPropertyName(static_cast<size_t>(propId))).c_str()));
1121 chartStyle->
setAxisY(QString::fromUtf8(
"Frequency"));
1126 chart->
attach(chartDisplay);
1130 displayWidget->show();
1131 displayWidget->setWindowTitle(
"Histogram");
1132 return displayWidget;
1139 std::unique_ptr<te::mem::DataSet> memDs;
1140 std::unique_ptr<te::da::DataSetType>
dt;
1146 int propType = histogram->
getType();
1151 std::map<std::string, unsigned int> histValues;
1161 std::map<std::string, unsigned int>::iterator histIt = histValues.begin();
1162 std::map<std::string, unsigned int>::iterator histItEndt = histValues.end();
1164 while (histIt != histItEndt)
1168 dsItem->
setInt32(1, static_cast<boost::int32_t>(histIt->second));
1176 std::map<double, unsigned int> histValues;
1186 std::map<double, unsigned int>::iterator histIt = histValues.begin();
1187 std::map<double, unsigned int>::iterator histItEndt = histValues.end();
1189 while (histIt != histItEndt)
1193 dsItem->
setInt32(1, static_cast<boost::int32_t>(histIt->second));
1205 std::vector<double> scatXValues, scatYValues;
1217 for (
size_t i = 0; i < scatXValues.size(); ++i)
1235 catch (
const std::exception& e)
1247 QwtText* result =
new QwtText(text.c_str());
1248 result->setBackgroundBrush(QBrush(QColor(0, 255, 0)));
1257 QwtText* result =
new QwtText(QString(text.c_str()));
1265 QwtSymbol* symbol =
new QwtSymbol( QwtSymbol::Ellipse, QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ));
1268 size_t height = 8, width = 8;
1292 qimg =
new QImage(static_cast<int>(width), static_cast<int>(height), QImage::Format_ARGB32);
1294 for (
int i = 0; i < static_cast<int>(height); ++i)
1296 unsigned char* u = qimg->scanLine(i);
1298 for (
int j = 0; j < static_cast<int>(width); ++j)
1302 QRgb* v =
reinterpret_cast<QRgb*
>(u + j * 4);
1308 pixmap = QPixmap::fromImage(*qimg);
1311 symbol->setPixmap(pixmap);
1312 symbol->setSize(static_cast<int>(width), static_cast<int>(height));
1327 baseCurve->setOrientation( Qt::Horizontal );
1330 normalCurve->setOrientation( Qt::Horizontal );
1337 std::vector<double> yValues;
1341 for(
int i = 0; i < nss.
m_count; ++i)
1343 double curXValue = xValues[
static_cast<size_t>(i)];
1345 xValues[static_cast<size_t>(i)] = curXValue;
1347 std::sort(xValues.begin(), xValues.end());
1350 for(
int i = 0; i < nss.
m_count; ++i)
1352 double curYValue = xValues[
static_cast<size_t>(i)];
1354 curYValue = 0.5 + (
errFunction ((
float)(curYValue/std::sqrt(2.)))/2.);
1357 curYValue = -curYValue;
1358 curYValue = 0.5 - (
errFunction ((
float)(curYValue/std::sqrt(2.)))/2.);
1360 yValues.push_back(curYValue);
1363 QVector<QPointF> samples, normalSamples;
1364 for (
int i = 0; i < nss.
m_count; ++i)
1366 double val = (
static_cast<double>(i)+static_cast<double>(1.0))/static_cast<double>(nss.
m_count);
1367 normalSamples += QPointF( val, val);
1368 samples += QPointF( val, yValues[static_cast<size_t>(i)]);
1371 baseCurve->setSamples(samples);
1372 normalCurve->setSamples(normalSamples);
1375 QPen normalCurvePen;
1376 normalCurvePen.setColor(QColor(Qt::green));
1378 normalCurvePen.setWidth(0);
1379 baseCurve->setPen(normalCurvePen);
1381 QPen normalProbCurvePen;
1382 normalProbCurvePen.setColor(QColor(Qt::red));
1384 normalProbCurvePen.setWidth(0);
1385 normalCurve->setPen(normalProbCurvePen);
1389 chartStyle->
setTitle(QString::fromUtf8((
"Normal Probability: " + dataset->
getPropertyName(static_cast<size_t>(propId))).c_str()));
1391 chartStyle->
setAxisY(QString::fromUtf8(
"Probability"));
1397 baseCurve->attach(chartDisplay);
1398 normalCurve->attach(chartDisplay);
1402 displayWidget->setWindowTitle(
"Normal Distribution");
1403 return displayWidget;
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
SimpleData< std::string, STRING_TYPE > String
A structure to hold the set of statistics from a set of numerical values.
void setMessage(const std::string &message)
Set the task message.
virtual double getDouble(std::size_t i) const =0
Method for retrieving a double attribute value.
void setDouble(std::size_t i, double value)
It sets the value of the i-th property.
An atomic property like an integer or double.
TEDATAACCESSEXPORT ObjectId * GenerateOID(DataSet *dataset, const std::vector< std::string > &names)
This is the base class for layers.
int getRed() const
It returns the red component color value (a value from 0 to 255).
const std::vector< ExternalGraphic * > getExternalGraphics() const
virtual std::unique_ptr< te::rst::Raster > getRaster(std::size_t i) const =0
Method for retrieving a raster attribute value.
A class that models the description of a dataset.
virtual std::string getNumeric(std::size_t i) const =0
Method for retrieving a numeric attribute value.
virtual float getFloat(std::size_t i) const =0
Method for retrieving a float attribute value.
virtual DateTimeType getDateTimeType() const =0
It returns the subtype of the date and time type.
unsigned int getColumn() const
Returns the current column in iterator.
This class can be used to inform the progress of a task.
int getBlue() const
It returns the blue component color value (a value from 0 to 255).
int getGreen() const
It returns the green component color value (a value from 0 to 255).
static PointSetIterator end(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to after the end of the iterator.
#define TE_TR(message)
It marks a string in order to get translated.
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
TEDATAACCESSEXPORT void GetOIDDatasetProps(const DataSetType *type, std::pair< std::string, int > &dsProps)
bool isActive() const
Verify if the task is active.
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
void setTotalSteps(int value)
Set the task total stepes.
TESTATEXPORT std::vector< double > GetNumericData(te::da::DataSet *dataSet, const std::string propName)
Returns the values of a numeric type property in a vector of values.
A class to represent a histogram.
void setInt32(std::size_t i, boost::int32_t value)
It sets the value of the i-th property.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
virtual boost::int16_t getInt16(std::size_t i) const =0
Method for retrieving a 16-bit integer attribute value (2 bytes long).
static RasterSummaryManager & getInstance()
It returns a reference to the singleton instance.
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos.
TEDATAACCESSEXPORT void Create(DataSource *ds, DataSetType *dt, DataSet *d, std::size_t limit=0)
It creates the dataset definition in a data source and then fill it with data from the input dataset...
This class represents an unique id for a data set element.
virtual boost::int32_t getInt32(std::size_t i) const =0
Method for retrieving a 32-bit integer attribute value (4 bytes long).
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
static te::dt::TimeDuration dt(20, 30, 50, 11)
A Font specifies the text font to use in a text symbolizer.
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
boost::ptr_vector< BandSummary > RasterSummary
RasterSummary is just a typedef of a boost::ptr_vector.
TESTATEXPORT void GetNumericStatisticalSummary(std::vector< double > &values, te::stat::NumericStatisticalSummary &ss, double nullValue)
A class to represent a histogram chart.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
A Fill specifies the pattern for filling an area geometry.
Utility functions for the data access module.
A class to represent a scatter's chart.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
A class to represent a scatter.
virtual std::unique_ptr< te::dt::DateTime > getDateTime(std::size_t i) const =0
Method for retrieving a date and time attribute value.
TESTATEXPORT void GetStringStatisticalSummary(std::vector< std::string > &values, te::stat::StringStatisticalSummary &ss, const std::string &nullValue)
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
TEMAPEXPORT te::rst::Raster * GetRaster(AbstractLayer *layer)
It gets the raster referenced by the given data set layer.
A dataset is the unit of information manipulated by the data access module of TerraLib.
const std::vector< Mark * > getMarks() const
TEDATAACCESSEXPORT void GetOIDPropertyPos(const DataSetType *type, std::vector< std::size_t > &ppos)
virtual std::unique_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const =0
It gets the dataset identified by the layer name.
A Stroke specifies the appearance of a linear geometry.
A structure to hold the set of statistics from a set of categorical (sample) values.
SimpleData< double, DOUBLE_TYPE > Double
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
TESEEXPORT int GetInt(const te::se::ParameterValue *param)
It gets the parameter value as an integer.
TEDATAACCESSEXPORT std::string getBasePkey(te::da::ObjectId *oid, std::pair< std::string, int > &dsProps)
TERASTEREXPORT std::vector< te::gm::Point * > GetRandomPointsInRaster(const te::rst::Raster &inputRaster, unsigned int numberOfPoints=1000)
Creates a vector of random positions (points) inside the raster.
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
A class used to define a chartDisplay's style.
virtual boost::int64_t getInt64(std::size_t i) const =0
Method for retrieving a 64-bit integer attribute value (8 bytes long).
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
A template for atomic data types (integers, floats, strings and others).
void setString(std::size_t i, const std::string &value)
It sets the value of the i-th property.
virtual std::size_t getNumProperties() const =0
It returns the number of properties that composes an item of the dataset.
virtual std::string getPropertyName(std::size_t i) const =0
It returns the property name at position pos.
A class to represent a chart display.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
const ParameterValue * getSize() const
unsigned int getRow() const
Returns the current row in iterator.
static PointSetIterator begin(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to the first value of the band.