2

How can we get the Uncompressed Size of a raster as shown in the layer properties below using ArcObjects?

enter image description here

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Sep 12, 2014 at 5:35
8
  • 1
    Do you mean just columns * rows * bands * pixel_depth / 8? Commented Sep 12, 2014 at 5:40
  • 1
    That's all it is. ( Rows x Columns * Bits * band_count ) / 8 to put it into bytes - add some for the header but if you look closely that Uncompresses Size listed there does not include header allowance (most noticeable on small rasters as the header is a greater % of the total file size). This is true for any uncompressed BINARY format, text and other formats would be much bigger. If you're really interested, images with less than 8 bits must make whole words (32bits) for each row so that may not be exactly correct for images with less than a byte-per-pixel. Commented Sep 12, 2014 at 5:44
  • 2
    to downvoter - is it really that bad a question? Commented Sep 12, 2014 at 5:51
  • @MichaelMiles-Stimson - thank you..that gives me a value close to this..but how to get this exact value? Does arcobjects expose it through any interface? Commented Sep 12, 2014 at 6:03
  • 1
    I don't see importance of this question (considered bounty was added). Why should Uncompressed Size of a raster be of interest to people? Commented Sep 22, 2014 at 13:34

1 Answer 1

1

For file based rasters, have a look at the IDatasetFileStat2 interface. It appears that the RasterDataset CoClass implements this interface. So you would need a reference to IRasterDataset3 interface first, then you could cast that information into IDatasetFileStat2 and store it into a variable.

I don't see an SDE equivalent so that method might work on SDE as well. The only source that the documentation guarantees it won't work with is personal geodatabases. But who uses those to store rasters in anyway?

There is fairly good documentation on how to get a reference to the IRasterDataset interface here.

answered Sep 19, 2014 at 21:28
1
  • There really is no way to tell the storage requirement in an ArcSDE raster, since the database may have additional overhead (e.g. extent size, high water mark, pages marked as deleted but not yet reused, et. al.). Commented Sep 22, 2014 at 13:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.