Thanks Mike and Sam. This worked perfectly - I am only now realizing how
powerful R and these libraries are. Very elegant and smooth!

cheers,

adv

On Sat, Nov 6, 2010 at 11:30 AM, Samuel Veloz <sdveloz@ucdavis.edu> wrote:

> You can skip the second step in Michael's code and just write to a tif file
> using raster:
>
> r <- raster("ncfile.nc") #you may need to specify varname here (which band
> you are using)
> writeRaster(r,"r.tif")
>
> Sam
>
>
> On Sat, Nov 6, 2010 at 7:19 AM, Advait Godbole <advaitgodbole@gmail.com>wrote:
>
>> Dear Members,
>>
>> I want to convert a 356 x 507 (lat,lon) 2D  netcdf file into a raster so
>> that I can read it in to image analysis/GIS programs. I initially adopted
>> an
>> approach whereby I first used NCL to convert it to a Fortran unformatted
>> binary and then convert it to a formatted sequential format using Fortran.
>> This was then read in to ENVI as a "flt" file. I would like to know if
>> there
>> is an elegant way in R to directly convert to a geospatial raster, more so
>> because I recently switched to using a different cluster and am running
>> into
>> i/o problems with all those binary conversions.
>>
>> Regards,
>>
>> --
>> Advait Godbole, BE Mech
>> Doctoral Student, Global Carbon Cycle Lab
>> Earth and Atmospheric Sciences
>> Purdue University
>> West Lafayette, IN 47906
>> USA
>> voice: +1 317 730 5235
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>


-- 
advait godbole

	[[alternative HTML version deleted]]

