Hi,
Im trying to import the USGS Global Land Cover Characterization dataset (http://edc2.usgs.gov/glcc/globe_int.php). Ive tried to create a header as described below but am having no luck. Im not too sure how to append the header information to the img file. I was wondering if anyone had already done this?
Thanks,
Darren
2013/2/14 Michael Spencer <michael_spencer at live.co.uk>:
Hi,
Has anyone used the USGS Global Land Cover Characterization data available
here?
Indication is that the file format is Erdas Imagine .img, but GRASS is
coming back with a file type unknown error. Help/readme file suggests data
is byte type, which leaves me none the wiser!
Happy for any pointers.
Ta,
Michael
Hi Michael,
Some time ago I had the same problem when using R for reading the
files. From the USGS I was told that the problem is the lack of header
(as mentioned in the metadata that I did not read )
I have a map of local elevation that I would like to alter the values of and re-class as a experiment to aid visualisation & interpretation.
Currently the cells are floating point with z-values like 0.0151666768416021 - I would like to do is round the elevation values to 2dp.
I also like to reclassify the resulting map into 5cm wide elevation ranges (reflecting the accuracy of the original data capture) e.g. 0-4.90cm, 5-9.90cm etc
I suspect both operations can be done with mapcalc but having read the manual am not sure where to start (especially with the first task).
Any pointers gratefully received, many thanks for reading,
Rebecca Bennett
Postdoctoral Associate, Wired! Group
Duke University, Durham, NC
I used QGIS with the gdalwarp tool to reproject the layer from Lambert Azimuthal Equal Area Projection (one of the two possible projection you can download) to latlon WGS84 (EPGS 4326), using the steps given below. This was the Africa Land Cover Characteristics Data Base Version 2.0, you’ll need to adapt the hdr file in step 2 for the south America layer and similar change the proj4 string in step 3 and 4.
The original layer was downloaded in Lambert Azimuthal Equal Area Projection (laea) and saved as afslcr2_0l.img.
The header file afslcr2_0l.hdr was created (see attached), based on the information provided on http://edc2.usgs.gov/glcc/afdoc2_0.php#lamb. I placed that file in the same folder as the img file. You can now open the file in QGIS
Create a custom CRS (under menu ‘settings’) based on the proj4 definition: +proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +no_defs +a=6370997 +rf=298.257223563 +towgs84=0.000,0.000,0.000 +to_meter=1 (for the south america layer, you will need to set lat_0=15 and lon_0=60 instead I think).
If you want to get the layer in e.g., latlon rather then laea, go to step 5. If you want to have the layer in the same projection as provided, go to step 6
Used the gdalwarp tool (under raster menu) to reproject the layer in latlon EPGS 4326 as geotif layer. Use the custom CRS you just created to define the layers CRS. Use EPGS 4326 (or any other CRS definition) for the output layer.
Use the assign projection tool (also under raster menu) and use the custom CRS you created in step 3 to set the desired CRS
Note that the tools in step 5 and 6 are both front-ends for gdalwarp, which you can also use directly on the command line. E.g.,
step 5 corresponds (in my case) to: gdalwarp -s_srs “+proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +no_defs +a=6370997 +rf=298.257223563 +towgs84=0.000,0.000,0.000 +to_meter=1” -t_srs EPSG:4326 -of GTiff /home/afslcr2_0l.img /home/Afslcr2.tif
The resulting geotif files can be imported in GRASS in the appropriate location. If you don’t have a location in the corresponding projection, you should be able to use the just produced geotif as source for the projection information.
By the way, I did not import it directly in GRASS because for some reason I could not create a new location based on the proj4 string as given in step 3 above. I got some error messages, which I can’t really remember, and as the steps above are easy anyway I haven’t really tried to figure out what the problem was.
On Thu, Feb 14, 2013 at 4:10 PM, Darren Slevin <d.slevin@ed.ac.uk> wrote:
Hi,
Im trying to import the USGS Global Land Cover Characterization dataset (http://edc2.usgs.gov/glcc/globe_int.php). Ive tried to create a header as described below but am having no luck. Im not too sure how to append the header information to the img file. I was wondering if anyone had already done this?
Thanks,
Darren
2013/2/14 Michael Spencer <michael_spencer at live.co.uk>:
Hi,
Has anyone used the USGS Global Land Cover Characterization data available
here?
Indication is that the file format is Erdas Imagine .img, but GRASS is
coming back with a file type unknown error. Help/readme file suggests data
is byte type, which leaves me none the wiser!
Happy for any pointers.
Ta,
Michael
Hi Michael,
Some time ago I had the same problem when using R for reading the
files. From the USGS I was told that the problem is the lack of header
(as mentioned in the metadata that I did not read )