[GRASSLIST:7464] import HDF files

I have these ASTER images, in hdf format. I tried to import then with
r.in.gdal, but I get errors:

r.in.gdal input=/home/guano/grassdata/AST_L1B_003_07042001134227_11162003075003.hdf
output=teste
ERROR 4: `/home/guano/grassdata/AST_L1B_003_07042001134227_11162003075003.hdf'
not recognised as a supported file format.

How can I get then into GRASS?

tks
--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+

I still cant have my ASTER imagens on GRASS. I have builted HDF4,
rebuilted GDAL with support for HDF4 and GRASS.

If I try r.in.gdal:

r.in.gdal input=/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf
output=test band=1 -o -e
ERROR 4: `/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf'
not recognised as a supported file format.

If I try r.in.aster:

r.in.aster input=/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf
proctype=L1B band=1 output=test

georeferencing aster image
gdalwarp -t_srs +proj=lcc +lat_0=-18.0000000000 +lat_1=-8.0000000000
+lat_2=-28.0000000000 +lon_0=-46.0000000000 +x_0=2000000000.0000000000
+y_0=5000000000.0000000000 +a=6378160 +rf=298.25 +no_defs
+towgs84=-60.0,-2.0,-41.0
HDF4_SDS:ASTER_L1B:"/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf":2
/home/guano/grassdata/amsul_lambert/sad69/.tmp/Valhalla/26909.0.tif

A target coordinate system was specified, but there is no source coordinate
system. Consider using -s_srs option to provide a source coordinate system.
Operation terminated.

importing into GRASS

ERROR 4: `/home/guano/grassdata/amsul_lambert/sad69/.tmp/Valhalla/26909.0.tif'
does not exist in the file system,
and is not recognised as a supported dataset name.

Cheers,

Carlos

--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+

Carlos,

if you want to use r.in.gdal, you will have to use the full reference to
a HDF4 subdataset as required by gdal as
HDF4_SDS:subdataset_type:file_name:subdataset_index. You can see that
r.in.aster does so, if you look at its output: it calls gdalwarp with
'HDF4_SDS:ASTER_L1B:"/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf":2' as input file. You'll have to use something like that too. You can find out how to reference your hdf subdatasets by running gdalinfo on your hdf file (then indeed just give it the filename). It will tell you the full hdf reference and its subdatasets. For more info, see http://www.remotesensing.org/gdal/frmt_hdf4.html.

Vincent.

On Tue, 2005-07-05 at 19:06 -0300, Carlos Guâno Grohmann wrote:

I still cant have my ASTER imagens on GRASS. I have builted HDF4,
rebuilted GDAL with support for HDF4 and GRASS.

If I try r.in.gdal:

r.in.gdal input=/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf
output=test band=1 -o -e
ERROR 4: `/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf'
not recognised as a supported file format.

If I try r.in.aster:

r.in.aster input=/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf
proctype=L1B band=1 output=test

georeferencing aster image
gdalwarp -t_srs +proj=lcc +lat_0=-18.0000000000 +lat_1=-8.0000000000
+lat_2=-28.0000000000 +lon_0=-46.0000000000 +x_0=2000000000.0000000000
+y_0=5000000000.0000000000 +a=6378160 +rf=298.25 +no_defs
+towgs84=-60.0,-2.0,-41.0
HDF4_SDS:ASTER_L1B:"/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf":2
/home/guano/grassdata/amsul_lambert/sad69/.tmp/Valhalla/26909.0.tif

A target coordinate system was specified, but there is no source coordinate
system. Consider using -s_srs option to provide a source coordinate system.
Operation terminated.

importing into GRASS

ERROR 4: `/home/guano/grassdata/amsul_lambert/sad69/.tmp/Valhalla/26909.0.tif'
does not exist in the file system,
and is not recognised as a supported dataset name.

Cheers,

Carlos

Try the r.in.aster script. This uses gdalwarp to import and georectify the
aster imagery.

Michael

On 7/5/05 1:54 PM, "Carlos Guâno Grohmann" <carlos.grohmann@gmail.com>
wrote:

I have these ASTER images, in hdf format. I tried to import then with
r.in.gdal, but I get errors:

r.in.gdal
input=/home/guano/grassdata/AST_L1B_003_07042001134227_11162003075003.hdf
output=teste
ERROR 4: `/home/guano/grassdata/AST_L1B_003_07042001134227_11162003075003.hdf'
not recognised as a supported file format.

How can I get then into GRASS?

tks

____________________
C. Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
PO Box 872402
Arizona State University
Tempe, AZ 85287-2402
USA

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

I tried r.in.aster:

r.in.aster input=/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf
proctype=L1B band=1 output=teste

georeferencing aster image
gdalwarp -t_srs +proj=lcc +lat_0=-18.0000000000 +lat_1=-8.0000000000
+lat_2=-28.0000000000 +lon_0=-46.0000000000 +x_0=2000000000.0000000000
+y_0=5000000000.0000000000 +a=6378160 +rf=298.25 +no_defs
+towgs84=-60.0,-2.0,-41.0
HDF4_SDS:ASTER_L1B:"/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf":2
/home/guano/grassdata/amsul_lambert/sad69/.tmp/valhalla/27109.0.tif

A target coordinate system was specified, but there is no source coordinate
system. Consider using -s_srs option to provide a source coordinate system.
Operation terminated.

importing into GRASS

ERROR 4: `/home/guano/grassdata/amsul_lambert/sad69/.tmp/valhalla/27109.0.tif'
does not exist in the file system,
and is not recognised as a supported dataset name.

Something is worong with the coordinate system, which is not set in the image.
This is the first lines of gdalinfo:

Driver: HDF4/Hierarchical Data Format Release 4
Size is 512, 512
Coordinate System is `'
Metadata:
  HDFEOSVersion=HDFEOS_V2.6
  IDOFASTERGDSDATAGRANULE=ASTL1B 0309051327400309240184

tks Carlos
--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+

On Wed, Jul 06, 2005 at 05:04:57PM -0300, Carlos Guâno Grohmann wrote:

r.in.aster input=/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf
proctype=L1B band=1 output=teste

georeferencing aster image
gdalwarp -t_srs +proj=lcc +lat_0=-18.0000000000 +lat_1=-8.0000000000
+lat_2=-28.0000000000 +lon_0=-46.0000000000 +x_0=2000000000.0000000000
+y_0=5000000000.0000000000 +a=6378160 +rf=298.25 +no_defs
+towgs84=-60.0,-2.0,-41.0
HDF4_SDS:ASTER_L1B:"/home/guano/grassdata/AST.L1B.00309052003132740.09242003132138.hdf":2
/home/guano/grassdata/amsul_lambert/sad69/.tmp/valhalla/27109.0.tif

A target coordinate system was specified, but there is no source
coordinate system. Consider using -s_srs option to provide a source
coordinate system. Operation terminated.

Carlos,

Your version of GDAL is outdated. Please, grab the most recent version
(you need the CVS snapshot). Everyone who need georeferenced ASTER
should take the GDAL sources from CVS, older code does not work
properly with ASTERs.

Best regards,
Andrey

--
Andrey V. Kiselev
Home phone: +7 812 5970603 ICQ# 26871517