[GRASS-web] Reading IMG and extracting data

Markus Neteler neteler at osgeo.org
Thu Apr 15 02:57:23 EDT 2010


Hi Nina,

On Wed, Apr 14, 2010 at 10:01 PM, Nina Bhola <nina.bhola at gmail.com> wrote:
> Hi
>
> I am trying to open an IMG file containing NDVI data.
> It is for Africa WGS 1984.

Indeed it is Albers_Conic_Equal_Area:

gdalinfo apr1982.IMG
Driver: IDA/Image Data and Analysis
Files: apr1982.IMG
Size is 1152, 1152
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["Clarke 1866",
        DATUM["Clarke 1866",
            SPHEROID["Clarke 1866",6378206.4,293.9786982138966]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["standard_parallel_1",-19],
    PARAMETER["standard_parallel_2",21],
    PARAMETER["latitude_of_center",1],
    PARAMETER["longitude_of_center",20],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0]]
Origin = (-4608000.000000000000000,4608000.000000000000000)
Pixel Size = (8000.000000000000000,-8000.000000000000000)
Metadata:
  TITLE=
Corner Coordinates:
Upper Left  (-4608000.000, 4608000.000) ( 24d36'0.11"W, 43d42'41.48"N)
Lower Left  (-4608000.000,-4608000.000) ( 23d29'18.84"W, 42d20'13.06"S)
Upper Right ( 4608000.000, 4608000.000) ( 64d36'0.11"E, 43d42'41.48"N)
Lower Right ( 4608000.000,-4608000.000) ( 63d29'18.84"E, 42d20'13.06"S)
Center      (   0.0000000,   0.0000000) ( 20d 0'0.00"E,  1d 0'0.00"N)
Band 1 Block=1152x1 Type=Byte, ColorInterp=Undefined
  NoData Value=0
  Offset: -0.00401606399999821,   Scale:0.00401606399999821

-> Not WGS84.

> I would like to then add my study area onto the map as a
> shape file and extract NDVI values for each 5km by 5km grid cell. I
> tried to do this,
>  but it is not working. Can you please help me.

You need to generate a GRASS Location with above parameters,
then r.in.gdal will work. In GRASS 6.4 there is a nice location
wizard to do that. It should be even able to read the parameters from
that apr1982.IMG file.

> I have attached one of the Africa NDVI composites for one month.

Looks good to me.

>  Is there a script to extract data for a particular location in GRASS?

Yes: r.what.

Note that this is the web mailing list. Such questions are best asked
on grass-user.

Regards,
Markus Neteler

-- 
http://gis.fem-environment.eu/


More information about the grass-web mailing list