本文整理汇总了C++中ITable::record方法的典型用法代码示例。如果您正苦于以下问题:C++ ITable::record方法的具体用法?C++ ITable::record怎么用?C++ ITable::record使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITable
的用法示例。
在下文中一共展示了ITable::record方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadBinaryData
bool FeatureConnector::loadBinaryData(Ilwis::IlwisObject *obj) {
if ( obj == nullptr)
return false;
FeatureCoverage *fcoverage = static_cast<FeatureCoverage *>(obj);
QString file = _odf->value("BaseMap", "AttributeTable");
ITable extTable;
if ( file != sUNDEF) {
if(!extTable.prepare(file)){
kernel()->issues()->log(file,TR(ERR_NO_INITIALIZED_1).arg(file),IssueObject::itWarning);
return false;
}
}
bool ok = false;
if (fcoverage->featureTypes() == itPOINT)
ok = loadBinaryPoints(fcoverage);
else if (fcoverage->featureTypes() == itLINE)
ok = loadBinarySegments(fcoverage);
else if (fcoverage->featureTypes() == itPOLYGON)
ok = loadBinaryPolygons(fcoverage);
if ( ok && extTable.isValid()) {
ITable attTbl = fcoverage->attributeTable();
quint32 keyIndex = attTbl->columnIndex(COVERAGEKEYCOLUMN);
for(quint32 rowExt=0; rowExt < extTable->records(); ++rowExt) {
vector<QVariant> rec = extTable->record(rowExt);
for(quint32 rowAtt = 0; rowAtt < attTbl->records(); ++rowAtt ) {
if ( attTbl->cell(keyIndex, rowAtt) == rowExt + 1) {
attTbl->record(rowAtt,rec);
}
}
}
}
return ok;
}
示例2: 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;
}
示例3: loadData
bool FeatureConnector::loadData(Ilwis::IlwisObject *obj, const IOOptions &) {
if ( obj == nullptr)
return false;
FeatureCoverage *fcoverage = static_cast<FeatureCoverage *>(obj);
QString file = _odf->value("BaseMap", "AttributeTable");
ITable extTable;
if ( file != sUNDEF) {
if(!extTable.prepare(file)){
kernel()->issues()->log(file,TR(ERR_NO_INITIALIZED_1).arg(file),IssueObject::itWarning);
return false;
}
}
bool ok = false;
try {
_binaryIsLoaded = true; // to prevent any subsequent calls to this routine while loading (which mat trigger it).
if (fcoverage->featureTypes() == itPOINT)
ok = loadBinaryPoints(fcoverage);
else if (fcoverage->featureTypes() == itLINE)
ok = loadBinarySegments(fcoverage);
else if (fcoverage->featureTypes() == itPOLYGON)
ok = loadBinaryPolygons(fcoverage);
_binaryIsLoaded = ok;
if ( ok && extTable.isValid()) {
ITable attTbl = fcoverage->attributeTable();
quint32 nrAttrCols = std::min(attTbl->columnCount(),extTable->columnCount());
// quint32 keyIndex = extTable->columnIndex(COVERAGEKEYCOLUMN);
for(quint32 rowExt=0; rowExt < extTable->recordCount(); ++rowExt) {
if ( rowExt < fcoverage->featureCount()){
vector<QVariant> rec = extTable->record(rowExt);
rec.resize(nrAttrCols); // extTable received an extra "Domain" column, which is not there (and will not be there) in attTbl
attTbl->record(rowExt,rec);
}
}
}
} catch (FeatureCreationError& ) {
}
if ( ok)
_binaryIsLoaded = true;
return ok;
}
示例4: attributesFromTable
void FeatureCoverage::attributesFromTable(const ITable& otherTable)
{
_attributeDefinition.clearAttributeDefinitions();
for(int col =0; col < otherTable->columnCount(); ++col){
_attributeDefinition.addColumn(otherTable->columndefinition(col));
}
if (otherTable->recordCount() != _features.size())
return;
for(int rec =0; rec < otherTable->recordCount(); ++rec){
auto& feature= _features[rec];
feature->record(otherTable->record(rec));
}
}