当前位置: 首页>>代码示例>>C++>>正文


C++ IRasterCoverage::pix2value方法代码示例

本文整理汇总了C++中ilwis::IRasterCoverage::pix2value方法的典型用法代码示例。如果您正苦于以下问题:C++ IRasterCoverage::pix2value方法的具体用法?C++ IRasterCoverage::pix2value怎么用?C++ IRasterCoverage::pix2value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilwis::IRasterCoverage的用法示例。


在下文中一共展示了IRasterCoverage::pix2value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addition

void Rastercalc::addition() {

    Ilwis::IRasterCoverage map1;
    DOTEST(map1.prepare(makeInputPath("U_1001A.NTF")),"loading erdas imagine file");

      Ilwis::IRasterCoverage cov = map1 + 100.0;
    DOCOMPARE(cov->pix2value(Ilwis::Pixel(0,0)),225.0,"Checking pix(269,339) for expression raster <operator> number");
    DOCOMPARE(cov->pix2value(Ilwis::Pixel(269,339)),139.0,"Checking pix(269,339) for expression raster <operator> number");
    DOCOMPARE(cov->pix2value(Ilwis::Pixel(29,996)),127.0,"Checking pix(29,996) for expression raster <operator> number");
}
开发者ID:52North,项目名称:IlwisTests,代码行数:10,代码来源:rastercalc.cpp

示例2: substract

void Rastercalc::substract(){
    Ilwis::IRasterCoverage map1;
    DOTEST(map1.prepare(makeInputPath("U_1001A.NTF")),"loading erdas imagine file");

    Ilwis::IRasterCoverage cov = 100.0 - map1;

    DOCOMPARE(cov->pix2value(Ilwis::Pixel(0,0)),-25.0,"Checking pix(269,339) for expression number <operator> raster");

    map1.prepare("small.mpl");
    Ilwis::IRasterCoverage cov4 = map1 + 100;

    map1.prepare("n000302_sub_kenya.mpr");
    Ilwis::IRasterCoverage map2("kenya_2009ndvi_cor_22.mpr");

    Ilwis::IRasterCoverage cov2 = map1 + map2 / 3;

    DOCOMPARE(cov2->pix2value(Ilwis::Pixel(50,50)),148.18,"Checking pix(50,50) for compound expression");

    Ilwis::IRasterCoverage cov3 = sqrt(cov2);

    DOCOMPARE(cov3->pix2value(Ilwis::Pixel(50,50)),12.173,"Checking pix(50,50) for sqrt");


}
开发者ID:52North,项目名称:IlwisTests,代码行数:24,代码来源:rastercalc.cpp


注:本文中的ilwis::IRasterCoverage::pix2value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。