Jonathan,

You should set an header in the first file. Dunne_soil.dat is recognized as
an Ascii Grid by GDAL because it has an header :
ncols         720
nrows         360
xllcorner     -180
yllcorner     -90
cellsize      0.5
NODATA_value  -9999

soilwhc.dat has no header. Also NA is coded with no space (-99.0-99.0).
Maybe if you search and replace -99.0 by -9999[space] this would make it
more standard. The lines are also rather short (36), but very long (7200).
I guess each row is indeed 10 lines. It would share the same header than
dunne_soil.dat. So you have some reformatting to get it working.

Etienne


2013/5/10 Jonathan Greenberg <[email protected]>

> r-sig-geo'ers:
>
> I'm trying some random hacks, but was wondering if there is a more
> efficient way to import the following file:
> ftp://ftp.daac.ornl.gov/data/global_soil/Dunne/data/soilwhc.dat
>
> as a raster().  The file is a fixed width file (width=5) of floating point
> values, but had the Arc header stripped off.  A reference file that DOES
> work with raster is:
>
> ftp://ftp.daac.ornl.gov/data/global_soil/Dunne/data/dunne_soil.dat
> reference_raster <- raster(dunne_soil.dat)
> # This has the same number of rows and columns and resolution as
> # the file above.
>
> Thoughts on the most efficient way to convert the first file to a workable
> raster?
>
> --j
>
> --
> Jonathan A. Greenberg, PhD
> Assistant Professor
> Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
> Department of Geography and Geographic Information Science
> University of Illinois at Urbana-Champaign
> 607 South Mathews Avenue, MC 150
> Urbana, IL 61801
> Phone: 217-300-1924
> http://www.geog.illinois.edu/~jgrn/
> AIM: jgrn307, MSN: [email protected], Gchat: jgrn307, Skype: jgrn3007
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to