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

Michael Sumner mdsumner at gmail.com
Wed Oct 12 14:13:48 CEST 2011


VRT is not designed to interrogate raw files, it's for arbitrarily
specifying a raster sources from a variety of sources, including "raw"
- there would be a driver and auto-recognition forze the files if GDAL
knew about it.

The 300 byte header is describe here so there's a nice little project
for a rainy day:

http://nsidc.org/data/docs/daac/nsidc0051_gsfc_seaice.gd.html#format

Cheers, Mike.


On Wed, Oct 12, 2011 at 9:08 PM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> 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
>



-- 
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list