C#中使用IMapAlgebraOp接口进行栅格计算并将结果显示在mapcontorl中的具体流程
- 创建IMapAlgebraOp对象
IMapAlgebraOp mapAlgebra = new RasterMapAlgebraOpClass();
- 设置栅格表达式
string expression = "slope + aspect";
mapAlgebra.BindRaster(layer, "slope");
mapAlgebra.BindRaster(layer2, "aspect");
- 进行栅格计算
IRasterDataset outRaster = mapAlgebra.Execute(expression);
- 将结果显示在MapControl中
IRasterLayer rasterLayer = new RasterLayerClass();
rasterLayer.CreateFromDataset(outRaster);
axMapControl.AddLayer(rasterLayer);
原文地址: https://www.cveoy.top/t/topic/ebtF 著作权归作者所有。请勿转载和采集!