[R-sig-Geo] importing ascii grids with 15 header lines

Matthias Boer M.Boer at uws.edu.au
Fri Oct 21 13:29:14 CEST 2011


Dear list members

I have a very large number of ascii map layers representing interpolated daily weather observations for Australia.
Each file is an ascii grid with a header consisting of 15 lines (6 lines for the usual header of Arcraster ascii grids plus 9 lines of additional info). I want to import the maps one by one, to compute monthly and annual values, overlay those with veg type maps, etc. I am having trouble with the spatial data formats.

I usually use 'read.asciigrid' to import ascii grids in Arcraster format but this fails here due to the header format. I can read the actual grid data using read.delim and create the GridTopology seperately but then struggle to create a SpatialGridDataFrame or other spatial data format. I assume there is a simple way to do this, but I haven't managed to work it out. Some help from the list would be great.

Thanks for your time.

Matthias



More information about the R-sig-Geo mailing list