An quick update to this issue, in case anyone ever needs.
 
With help from Robert, the following code can read certain ascii maps (like the ones from the GGHYDRO project http://people.trentu.ca/~gcogley/glaciology/glglgghy.htm) and convert them to raster.

Greetings,
--
Thiago V. dos Santos
PhD student
Land and Atmospheric Science
University of Minnesota
http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm
Phone: (612) 323 9898


________________________________

To: R-SIG list <r-sig-geo@r-project.org> 
Sent: Wednesday, December 19, 2012 2:20 PM
Subject: [R-sig-Geo] Make raster from oddly organized ASCII


Dear all,

Today I received some ASCII files that need to be converted to raster. They are organized in a rather odd way, and I cannot think of a method
to read and organize the data to make a raster. Please take a look at a sample file:

sample<-readLines(url("http://dl.dropbox.com/u/27700634/gghswmp.lis"))

Useful information that I know about the data:
- global coverage at 1 degree;
- each line's 2nd value corresponds to the latitude coordinate; 
- the records are ordered from north (lat = 89) to south (lat = 90) within each hemisphere, the eastern hemisphere (lon=0) appearing first and the western (lon=180) second;
- lon is the longitude and lat is the latitude of the southwest corner of the first 1x1 degree cell.

Initially I thought of creating a XYZ data.frame and then use rasterfromXYZ to produce the raster.

Could anyone help me to create a XYZ data.frame from the supplied file?

Many thanks in advance,
Thiago.

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
	[[alternative HTML version deleted]]

