本文整理汇总了C++中IRasterCoverage::id方法的典型用法代码示例。如果您正苦于以下问题:C++ IRasterCoverage::id方法的具体用法?C++ IRasterCoverage::id怎么用?C++ IRasterCoverage::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRasterCoverage
的用法示例。
在下文中一共展示了IRasterCoverage::id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAttribute
void IlwisObjectModel::setAttribute(const QString &attrname, const QString &value, const QString &extra)
{
if ( _ilwisobject.isValid()){
if ( attrname == "domain"){
IDomain dom(value);
if ( _ilwisobject->ilwisType() == itRASTER){
IRasterCoverage raster = _ilwisobject.as<RasterCoverage>();
if ( dom->id() != raster->datadefRef().domain()->id()){
raster->datadefRef().domain(dom);
raster->changed(true);
mastercatalog()->changeResource(raster->id(),"domain",dom->id(), true);
}
}
}
}
}
示例2: copyBinary
void RasterCoverage::copyBinary(const IRasterCoverage& raster, quint32 inputIndex, quint32 outputIndex) {
if ( isNumericalUndef(inputIndex) || isNumericalUndef(outputIndex)){
ERROR2(ERR_ILLEGAL_VALUE_2,TR("layer index"), isNumericalUndef(inputIndex) ? "input" : "output");
return;
}
if ( inputIndex >= size().zsize()){
//ERROR2(ERR_ILLEGAL_VALUE_2,TR("layer index"), "input");
}
IRasterCoverage gcNew;
gcNew.set(this);
Size<> inputSize = raster->size();
Size<> sz(inputSize.xsize(),inputSize.ysize(), outputIndex + 1);
gcNew->georeference()->size(sz);
PixelIterator iterIn(raster, BoundingBox(Pixel(0,0,inputIndex), Pixel(inputSize.xsize(), inputSize.ysize(), inputIndex + 1)));
PixelIterator iterOut(gcNew, BoundingBox(Pixel(0,0,outputIndex), Pixel(inputSize.xsize(), inputSize.ysize(), outputIndex + 1)));
if ( raster->id() == id() && inputIndex == outputIndex){
ERROR2(ERR_ILLEGALE_OPERATION2, TR("copy"),TR("identical layers in same raster"));
return;
}
std::for_each(iterOut, iterOut.end(), [&](double& v){
v = *iterIn;
++iterIn;
});
}
示例3: resource
Ilwis::OperationImplementation::State SelectionRaster::prepare(ExecutionContext *ctx, const SymbolTable &st)
{
OperationImplementation::prepare(ctx,st);
if ( _expression.parameterCount() != 2) {
ERROR3(ERR_ILLEGAL_NUM_PARM3,"rasvalue","1",QString::number(_expression.parameterCount()));
return sPREPAREFAILED;
}
IlwisTypes inputType = itRASTER;
QString raster = _expression.parm(0).value();
if (!_inputObj.prepare(raster, inputType)) {
ERROR2(ERR_COULD_NOT_LOAD_2,raster,"");
return sPREPAREFAILED;
}
IRasterCoverage inputRaster = _inputObj.as<RasterCoverage>();
_inputAttributeTable = inputRaster->attributeTable();
quint64 copylist = itCOORDSYSTEM ;
QString selector = _expression.parm(1).value();
parseSelector(selector, inputRaster);
std::vector<QString> selectionBands = bands(inputRaster);
_box = boundingBox(_inputObj.as<RasterCoverage>());
bool useOldGrf ;
if ( _box.isNull() || !_box.isValid()){
_box = inputRaster->size();
useOldGrf = true;
} else
useOldGrf = false;
if ( useOldGrf){
copylist |= itGEOREF | itRASTERSIZE | itENVELOPE;
}
int selectedAttributes = attributeNames().size();
if (selectedAttributes != 1)
copylist |= itDOMAIN;
_outputObj = OperationHelperRaster::initialize(_inputObj,inputType, copylist);
if ( !_outputObj.isValid()) {
ERROR1(ERR_NO_INITIALIZED_1, "output coverage");
return sPREPAREFAILED;
}
IRasterCoverage outputRaster = _outputObj.as<RasterCoverage>();
QString outputName = _expression.parm(0,false).value();
if ( outputName != sUNDEF)
_outputObj->name(outputName);
if ( selectedAttributes > 1) {
QString url = INTERNAL_CATALOG + "/" + outputName;
Resource resource(url, itFLATTABLE);
_attTable.prepare(resource);
}
if ( selectedAttributes == 1 && _inputAttributeTable.isValid()){
QStringList names = attributeNames();
//outputRaster->datadefRef().domain(_inputAttributeTable->columndefinition(names[0]).datadef().domain());
outputRaster->setDataDefintions(_inputAttributeTable->columndefinition(names[0]).datadef().domain(), selectionBands, inputRaster->stackDefinition().domain());
}else
outputRaster->setDataDefintions(inputRaster->datadef().domain(), selectionBands, inputRaster->stackDefinition().domain());
if ( (copylist & itGEOREF) == 0) {
Resource resource(QUrl(INTERNAL_CATALOG + "/" + outputRaster->name() + "_grf_" + QString::number(outputRaster->id())),itGEOREF);
resource.addProperty("size", IVARIANT(_box.size()));
auto envelope = inputRaster->georeference()->pixel2Coord(_box);
resource.addProperty("envelope", IVARIANT(envelope));
resource.addProperty("coordinatesystem", IVARIANT(inputRaster->coordinateSystem()));
resource.addProperty("name", _outputObj->name());
resource.addProperty("centerofpixel",inputRaster->georeference()->centerOfPixel());
IGeoReference grf;
grf.prepare(resource);
outputRaster->georeference(grf);
outputRaster->envelope(envelope);
}
return sPREPARED;
}