Greetings all
At http://www.grassbook.org/examples_menu3rd.php There is a function to import a Landsat image with metadata info.
I went at ftp://ftp.glcf.umiacs.umd.edu/glcf/Landsat/WRS2/p016/r035/p016r035_7x20000331.ETM-EarthSat/ and I downloeaded landsat image but I didn’t find any met file that is required at:
METASTRING="`grep "SPACECRAFT_ID|SENSOR_ID|ACQUISITION_DATE|WRS_PATH|WRS_ROW|SUN_AZIMUTH|SUN_ELEVATION|QA_PERCENT_MISSING_DATA|CLOUD_COVER|CPF_FILE_NAME|LMAX_BAND|LMIN_BAND|QCALMAX_BAND|QCALMIN_BAND" *.met| grep -v ‘^$’
What am I doing wrong? I need to import Landsat-7 image with all that information…
Even at NC_SPM landsat dataset, onlyu 2002 has Metadata information. 1987 doesn’t have that.
Thanks for your help
Best regards,
Katrin
Hi Katrin,
On Mon, May 31, 2010 at 3:53 PM, katrin eggert
<katrineggert1980@gmail.com> wrote:
Greetings all
At http://www.grassbook.org/examples_menu3rd.php There is a function to
import a Landsat image with metadata info.
I went
at ftp://ftp.glcf.umiacs.umd.edu/glcf/Landsat/WRS2/p016/r035/p016r035_7x20000331.ETM-EarthSat/
and I downloeaded landsat image but I didn't find any met file that is
required at:
METASTRING="`grep
\"SPACECRAFT_ID\|SENSOR_ID\|ACQUISITION_DATE\|WRS_PATH\|WRS_ROW\|SUN_AZIMUTH\|SUN_ELEVATION\|QA_PERCENT_MISSING_DATA\|CLOUD_COVER\|CPF_FILE_NAME\|LMAX_BAND\|LMIN_BAND\|QCALMAX_BAND\|QCALMIN_BAND\"
*.met| grep -v '^$'
What am I doing wrong?
Nothing
The files in the indicated FTP directory are in a different
file format.
If you look at the .hdr files therein, you'll find the metadata easily. They are
in ASCII format, too.
I need to import Landsat-7 image with all that information...
r.in.gdal should be able to import these data without problems.
Even at NC_SPM landsat dataset, onlyu 2002 has Metadata information. 1987
doesn't have that.
Unfortunately various formats are used... But luckily most (all?) are understood
by GDAL, so r.in.gdal should do the job. You can also obtain metadata
information
with
gdalinfo filename
Hope this helps,
Markus
Hi Markus and the rest of the people
Nothing
The files in the indicated FTP directory are in a different
file format.
If you look at the .hdr files therein, you’ll find the metadata easily. They are
in ASCII format, too.
But the code refers to a *.met file right? So I was not “reading” the code wrong. So I just need to substitute *.met for the new metadata?
I need to import Landsat-7 image with all that information…
r.in.gdal should be able to import these data without problems.
But r.in.gdal only imports the data not the metadata. Right?
Even at NC_SPM landsat dataset, onlyu 2002 has Metadata information. 1987
doesn’t have that.
Unfortunately various formats are used… But luckily most (all?) are understood
by GDAL, so r.in.gdal should do the job. You can also obtain metadata
information
with
gdalinfo filename
And how can I automatically incorporate the metadata, specially from a external file, into imported file?
Thanks
Kat
On Tue, Jun 1, 2010 at 10:35 AM, katrin eggert
<katrineggert1980@gmail.com> wrote:
Hi Markus and the rest of the people
The files in the indicated FTP directory are in a different
file format.
If you look at the .hdr files therein, you'll find the metadata easily.
They are in ASCII format, too.
But the code refers to a *.met file right?
Right.
So I was not "reading" the code wrong. So I just need to substitute *.met
for the new metadata?
Unfortunately not since the format (i.e. keywords) is different. You would need
to write a parsing script (shell, Python, etc).
Trick: open the file and read it 
If you don't need to import many files, the manual composition of the
METASTRING variable will take you only few minutes at most.
> I need to import Landsat-7 image with all that information...
r.in.gdal should be able to import these data without problems.
But r.in.gdal only imports the data not the metadata. Right?
Right.
> Even at NC_SPM landsat dataset, onlyu 2002 has Metadata information.
> 1987 doesn't have that.
Unfortunately various formats are used... But luckily most (all?) are
understood
by GDAL, so r.in.gdal should do the job. You can also obtain metadata
information
with
gdalinfo filename
And how can I automatically incorporate the metadata, specially from a
external file, into imported file?
You can use r.support for that:
http://grass.osgeo.org/grass64/manuals/html64_user/r.support.html
r.support mapname history="$METASTRING"
Hope this helps,
Markus
--
http://gis.ambiente.fmach.it/