C# 利用IRawPixels接口遍历栅格数据

C# 利用IRawPixels接口遍历栅格数据,第1张

概述AO的版本为10.2,开发的语言是C#。栅格数据来源IRasterDataset接口。IRasterBandCollectionpRasterBandCollection=pRasterDatasetasIRasterBandCollection;

AO的版本为10.2,开发的语言是C#。栅格数据来源IRasterDataset接口。

IRasterBandCollection pRasterBandCollection = pRasterDataset as IRasterBandCollection;IRasterBand pRasterBand = pRasterBandCollection.Item(0); IRaster pRaster = (pRasterDataset as IRasterDataset2).CreateFullRaster();IRawPixels pRawPixels = pRasterBand as IRawPixels;IRasterProps pRasterProps = pRasterBand as IRasterProps;int dHeight = pRasterProps.Height;int DWIDth = pRasterProps.WIDth; IPnt pntSize = new PntClass();pntSize.SetCoords(dHeight,DWIDth);IPnt pPixelBlockOrigin = new PntClass();pPixelBlockOrigin.SetCoords(0,0);IPixelBlock pixelBlock = pRaster.CreatePixelBlock(pntSize);pRawPixels.Read(pPixelBlockOrigin,pixelBlock);System.Array arr = (System.Array)(pixelBlock as IPixelBlock3).get_PixelData(0);for (int i = 0; i < dHeight;i++ ) { for (int j = 0; j < DWIDth; j++)  {   float number = 0;   float.TryParse(arr.GetValue(i,j).ToString(),out number);       }}

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持编程小技巧!

总结

以上是内存溢出为你收集整理的C# 利用IRawPixels接口遍历栅格数据全部内容,希望文章能够帮你解决C# 利用IRawPixels接口遍历栅格数据所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1256377.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-07
下一篇 2022-06-07

发表评论

登录后才能评论

评论列表(0条)

保存