本文整理汇总了C++中ITable::addColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ ITable::addColumn方法的具体用法?C++ ITable::addColumn怎么用?C++ ITable::addColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITable
的用法示例。
在下文中一共展示了ITable::addColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: histogramAsTable
ITable RasterCoverage::histogramAsTable()
{
std::vector<NumericStatistics::HistogramBin> hist;
if ( histogramCalculated())
hist = statistics().histogram();
else {
hist = statistics(ContainerStatistics<PIXVALUETYPE>::pHISTOGRAM).histogram();
}
int count = 0;
ITable histogram;
histogram.prepare();
histogram->addColumn("min", IDomain("value"), true);
histogram->addColumn("max", IDomain("value"), true);
histogram->addColumn("counts", IDomain("count"));
count = 0;
PIXVALUETYPE vstart = datadef().range<NumericRange>()->min();
if (hist.size() > 0) {
for (int i = 0; i < hist.size() - 1; ++i) {
auto& h = hist[i];
histogram->record(count, { vstart, h._limit, h._count });
vstart = h._limit;
++count;
}
}
return histogram;
}
示例2: prepareAttributeTable
ITable CoverageConnector::prepareAttributeTable(const QString& file, const QString& basemaptype) const{
ITable extTable;
if ( file != sUNDEF) {
if(!extTable.prepare(file)){
kernel()->issues()->log(file,TR(ERR_NO_INITIALIZED_1).arg(file),IssueObject::itWarning);
return ITable();
}
}
IDomain covdom;
if (!covdom.prepare("count")){
return ITable();
}
ITable attTable;
if ( basemaptype != "Map" ) {
Resource resource(QUrl(QString("ilwis://internal/%1").arg(_odf->fileinfo().baseName())), itFLATTABLE);
if(!attTable.prepare(resource)) {
ERROR1(ERR_NO_INITIALIZED_1,resource.name());
return ITable();
}
if ( extTable.isValid()) {
for(int i=0; i < extTable->columns(); ++i) {
attTable->addColumn(extTable->columndefinition(i));
}
}
} else {
attTable = extTable;
}
if ( attTable->columnIndex(FEATUREIDCOLUMN) == iUNDEF) { // external tables might already have these
attTable->addColumn(COVERAGEKEYCOLUMN,covdom);
attTable->addColumn(FEATUREIDCOLUMN,covdom);
}
bool isNumeric = _odf->value("BaseMap","Range") != sUNDEF;
if ( isNumeric) {
IDomain featuredom;
if (!featuredom.prepare("value")){
return ITable();
}
attTable->addColumn(FEATUREVALUECOLUMN,featuredom);
}
return attTable;
}