Skip to content
Back to formatted view

Raw Message

Message-ID: <CAAcGz9-aFor7aPq3CHOs6En1YdGXx02gOHC34ni9n72dYtUh4g@mail.gmail.com>
Date: 2013-11-12T05:31:42Z
From: Michael Sumner
Subject: write .flt format in R
In-Reply-To: <99EECC31A3D980448F72935790880DB9128B0E81@HKXPRD0610MB389.apcprd06.prod.outlook.com>

You could use rgdal instead:

library(raster)
library(rgdal)
x <- raster(volcano, crs = "+proj=laea")
## so rather than
## writeRaster(x, "file.flt")
writeGDAL(as(x, "SpatialGridDataFrame"), "file.flt", drivername = "EHdr")

## see this for the drivers available
gdalDrivers()

But that format is not very well defined, so I would test carefully
that your target is satisfied.

See here for some info:
http://www.gdal.org/frmt_various.html#EHdr
http://geospaced.blogspot.co.uk/2011/12/reading-afripop-data.html


Cheers, Mike.

On Tue, Nov 12, 2013 at 3:43 PM, Dan Rosauer <dan.rosauer at anu.edu.au> wrote:
> Hi
>
> Can anyone advise on an R method to write a raster object to the ESRI .flt grid format?
>
> writeRaster accepted the *.flt filename, but silently handled it by actually saving to *.grd, *.gri files which are the DIVA format.
>
> I can do it by roundabout methods, eg writing to .asc and then converting in DIVA or ArcGIS.  But a direct method would save much time and fiddling.
>
> Thanks for your help.
>
> Dan
>
> ~~~~~~~~~~~~~~~~~~~~~~
> Dan Rosauer
> Postdoctoral Fellow
> Moritz Lab
> Ecology, Evolution & Genetics
> Research School of Biology
> Gould Building, Daley Road
> Australian National University
> Canberra ACT 0200
>
> +61 413 950 275 (mobile)
> +61 2 6125 1028 (office)
> dan.rosauer at anu.edu.au
>
> sites.google.com/site/danielrosauer
>
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



-- 
Michael Sumner
Hobart, Australia
e-mail: mdsumner at gmail.com