This paper mainly introduces the use of Irawpixels interface to traverse raster data. Have a good reference value, follow the small series together to see it
The version of AO is 10.2, and the language developed is C #. Raster data source Irasterdataset interface.
irasterbandcollection prasterbandcollection = Prasterdataset as IRasterBandCollection;I Rasterband 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 ();p ntsize.setcoords (Dheight, dwidth); Ipnt ppixelblockorigin = new Pntclass (); Ppixelblockorigin.setcoords (0, 0); Ipixelblock pixelblock = Praster.createpixelblock (pntsize);p Rawpixels.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); }}