Select to view content in your preferred language

Question regarding celll data type (for university exam)

363
3
02-27-2023 03:29 AM
DanielMortensen
New Contributor

Im having some trouble of how to calculate the following question, and would appreciate any help on how to calculate it

A raster layer is 1 Mb big and consists of 1000 columns and 1000 rows of 30 m
spatial cell resolution. What data type is the cell values stored in and describe which
values that can be stored with this data type 

Tags (1)
0 Kudos
3 Replies
DavidPike
MVP Frequent Contributor

I think it's leading you to say 'byte' from the filesize (i.e. 1 million cells of 1 byte each).  Integer values 0 to 255 unsigned or -128 to 127 signed. 

JohannesLindner
MVP Frequent Contributor

1 Mb / 1000 rows / 1000 columns = 0.000001 Mb / Cell

0.000001 Mb = 1 Byte

In 1 Byte (8 bit) of data you can store one of 256 (2^8) integer values (0 ... 255 or -128 ... 127).

 

Of course, that's the size for the pure raster cell values. In a "real" raster format (say ESRI's ASCII raster format), you would have separators between the values in one row (space), separators between the rows (linebreak), and header data (cell size, start coordinates), so the raster size would be somewhat above 1 Mb.


Have a great day!
Johannes
0 Kudos
JohnWatt
Occasional Contributor

Yip, a million bytes, one byte (8 bits) per cell, irrespective of how geographically big that cell is - so not much room there.  Only 255 unique values can be stored. So maybe an index for a lookup classification, or maybe a greyscale image like a hillshade.  Or a single band from an RGB(I+) photographic image. Not a DEM - you'd typically want to store floating-point numbers at least, which take more than one byte.

0 Kudos