C # code example of traversing raster data using the Irawpixels interface

Source: Internet
Author: User
Tags float number
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)!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.