[GRASS-user] Reading in USGS Global Land Cover Characterization dataset

Paulo van Breugel p.vanbreugel at gmail.com
Thu Feb 14 09:50:12 PST 2013


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.

   1. The original layer was downloaded in Lambert Azimuthal Equal Area
   Projection (laea) and saved as afslcr2_0l.img.
   2. 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
   3. 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).
   4. 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
   5. 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.
   6. 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

Step 6 corresponds (again, in my case) to:gdalwarp -t_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" /home/paulo/Desktop/afslcr2_0l.img
/home/paulo/Desktop/afslcr2_0l.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 at ed.ac.uk> wrote:

> Hi,
> Im trying to import the USGS Global Land Cover Characterization dataset (
> http://edc2.usgs.gov/glcc/**globe_int.php<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?
>>
>> http://edc2.usgs.gov/glcc/**globe_int.php<http://edc2.usgs.gov/glcc/globe_int.php>
>>
>> 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 :( )
>
> You need to make a projection header file as per the FAQ at:
> http://landcover.usgs.gov/faq.**php#three<http://landcover.usgs.gov/faq.php#three>
>
> The details of the LAEA projection to generate the header file can be
> found on:
> http://edc2.usgs.gov/glcc/**sadoc2_0.php<http://edc2.usgs.gov/glcc/sadoc2_0.php>
>
> IHTH,
>
> Mauricio
>
> --
> Darren Slevin
> Postgraduate Research Student
> The University of Edinburgh
> Grant Institute
> The King's Buildings
> West Mains Road
> Edinburgh
> EH9 3JW
>
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
> ______________________________**_________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/grass-user<http://lists.osgeo.org/mailman/listinfo/grass-user>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130214/fa2daa02/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: afslcr2_0l.hdr
Type: application/octet-stream
Size: 112 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130214/fa2daa02/attachment.obj>


More information about the grass-user mailing list