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;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 ();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);} }
The above is the content of code instance that C # uses Irawpixels interface to traverse raster data, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!