[R-sig-Geo] Reading National Snow and Ice Data Center binary files

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Oct 12 12:08:17 CEST 2011


On Wed, Oct 12, 2011 at 12:14 AM, Michael Sumner <mdsumner at gmail.com> wrote:

> Doing it manually is straightforward but laborious and error-prone,
> another option is to use the GDAL VRT format - where you can formalize
> all of the data type, georeferencing, projection and other metadata
> (scaling and so on if necessary) - the you can more or less automate
> the process by generating a .vrt for any of the files you like (and
> you can include subsetting, combining single to multi-bands, scaling
> etc. in the VRT definition).
>
> http://www.gdal.org/gdal_vrttut.html
>
> VRT is surely almost always available in any rgdal/GDAL build since
> it's so generic.
>
> I don't have time to attempt this now, but I know it can work.

 Annoyingly I don't think gdal's raw data vrt system can find out the
number of pixels across/down the raster - you have to code them into
the .vrt file. I reckon with a bit of unix (or in extremis, C code)
craftiness it would be possible to get the info from the header of the
.bin file and write the relevant .vrt file...

 The great thing about standards is...

Barry



More information about the R-sig-Geo mailing list