I am tring to read the following GIS datafile into R:
Some Data Specifications are here:
Image Type: Generic Flat Binary, Byte Interleave By Line (BIL)
Projection: Interrupted Goode Homolosine
I tried to use the R package “raster”, but failed.
library(raster)
r <- raster(file.choose())
Error in .local(.Object, ...) :
`C:\global_forest_cover.img' not recognised as a supported file format.
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
Cannot create a RasterLayer object from this file.
So, how should I load this GIS data into R? Also, convert the projection “Interrupted Goode Homolosine” to LongLat ?
Create a file called
global_forest_cover.hdrand stick the header info from http://edc2.usgs.gov/glcc/fao/header_file.php into it:then read the
.imgfile:GDAL sees the
.hdrfile and uses that to work out the structure of the 15059*36543 bytes in the.imgfile.However it does not have the projection information. But even if it did, warping an IGH projection back to lat-long might be somewhat problematic. If you look at other IGH projected maps you’ll see they involve tearing down the oceans to help flatten the globe. To get back to lat-long you need to reverse all these flattenings and tears. It should be possible, and I think the latest PROJ4 libraries have support for IGH projections, but maybe only in one direction. BUT unless you use exactly the same code that was used to create the data you have but in reverse you might not get the right answer out.
Given that the
.hdrfile wasn’t included in the zip, and that the projection isn’t really a good one for further analysis, I’d go looking for another source of the data. This data is clearly only meant for display purposes. And its also poor because it doesn’t seem to have missing data values where the IGH projection has split the earth – compare the pictures on the http://edc2.usgs.gov/glcc/fao/index.php page with other IGH projections http://en.wikipedia.org/wiki/Goode_homolosine_projectionI thought the data here might be more appropriate: http://www.fao.org/forestry/32203/en/
But I’m slightly confused between the ‘europe’ in the name and the global extent. Its also a very very large raster. Ah, its got Europe in the middle of nowhere. Note the projection is now lat-long. You may want to thin the grids out before putting them together to create a global raster from all the files given there.