gdal_translate-of gtiff foobar.asc foobar.tif
, where .asc
is optional, will do the trick of converting to the more usable geotiff format (and save a whack of disk space too). I'm not sure how one would go about associating the attribute values to the raster cells in qgis, that could be a separate question as it's probably not file format specific operation.
BSQ is band sequential. The GDAL doc is here
Extract from ESRI whitepaper: Band sequential format stores information for the image one band at a time. In other
words, data for all pixels for band one is stored first, then data for all pixels for band two,
and so on. in http://downloads.esri.com/support/whitepapers/other_/eximgav.pdf on page 8.
If there's only one band there is no difference between BIL and BSQ.
If the NBITS isn't specified then it can be calculated by the size of file (in bytes) / (NROWS * NCOLS)
. This should give you either 8, 16 or 32. If it's 32 it may be float or 32 bit integer (long), you will need this in bytes 1, 2 or 4 respectively.
The hook point is usually upper left, so you find the difference from your coordinate to the reference point (in cells):
Row = int( (ULYMAP - Your.Y) / YDIM )
Col = int( (Your.X - ULXMAP) / XDIM )
That is assuming your point is in the same spatial reference as the image, if not project the point - or if all of your requests are going to be in the same spatial reference that's different to the raster consider projecting the raster.
With the row and column known calculating the location in file is (Col * NCOLS * bytesPerCell) + Row * bytesPerCell
Best Answer
I just tested this using ArcGIS for Desktop 10.2 and was able to convert a BIL file downloaded from FEWSNET to a GRID format using the Raster To Other Format (Conversion) tool.
I downloaded and unzipped the ZIP file to find the BIL file, then opened the tool.
I chose the BIL file as my Input Raster, and set the Output Workspace to a folder where I had write access (C:\temp) and the Raster Format (for output) to GRID.