<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head> <!-- <DEFANGED_STYLE type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
--> --> </DEFANGED_STYLE><title>Re: [GRASSLIST:2456] gdal and
hdf</title></head><body>
<div>Ian Macmillan wrote:</div>
<div><br></div>
<blockquote type="cite" cite>Hi all, sorry to be pestering the list
lately, every time I think I get it all,<br>
I realize just how big the mountain of information is that I don't
understand.<br>
<br>
Here's my problem, I downloaded some aster dems from the EOS data
gateway. It<br>
comes in HDF-EOS format, and obviously my r.in.gdal (version 1.1.7 I
believe)<br>
can not read it (I am running 5.0.0 on mac os 10.2.8). I would
like to be able<br>
to import this data into GRASS, however it seems very non intuitive to
a mac<br>
user like me (I installed GRASS with the openosx cd). I have
read and reread<br>
the mail archives and tutorials, as well as several other web sources,
but I<br>
still just don't get how I can do this. It seems to me that I
need to update<br>
gdal to 1.1.9 (it looks like it handles hdf 4.x and hdf-eos files),
and then I<br>
should be ok, but how do I do this? I have downloaded the
binaries from<br>
remotesensing.org. and it is sitting on my desktop staring at me.
Now what?<br>
<br>
Can I just update gdal without having to recompile grass?<br>
How do I update gdal?<br>
If I need to recompile grass, how do I do that on osx?<br>
<br>
Mucho thanks for any help you all might give,<br>
Ian</blockquote>
<div><br></div>
<div>In my site you find last gdal1.1.9cvs, Grass5.3cvs, 5.7cvs
precompiled binaries:</div>
<div><br></div>
<div>http://wwwamb.bologna.enea.it/forgrass</div>
<div><br></div>
<div>You have to read the INSTALL file.</div>
<div>You have to install FINK unstable packages (http://fink.sf.net).
In Fink there are many libraries for my Grass binaries like HDF 4.1r5.
You install it: my gdal binary support this library (it install in
/usr/local). GDAL only support HDF vers 4 (not the new HDF vers
5)</div>
<div><br></div>
<div>I don't know where Grass OpenOSX grass install all files and
support libraries)</div>
<div>My Grass support this gdal. My Grass works with many fink
libraries (in /sw directory) and my libraries (in /usr/local)</div>
<div><br></div>
<div>After the install procedure you can use bin program from
gdal.</div>
<div>Open Terminal</div>
<div>Example of ASTER Level1B file:</div>
<div><br></div>
<blockquote><font face="Courier New">[lor:~] lor%
/usr/local/bin/gdalinfo
/ASTER_files/ASTER_FO_gen02/AST_L1B_003_01102002101254_05222002150244<span
></span>.hdf</font></blockquote>
<div><br></div>
<div>you see the information about your ASTER file</div>
<div><br></div>
<blockquote><font face="Courier New">Driver: HDF4/Hierarchical Data
Format Release 4<br>
Size is 512, 512<br>
Coordinate System is `'<br>
Metadata:<br>
HDFEOSVersion=HDFEOS_V2.6<br>
IDOFASTERGDSDATAGRANULE=ASTL1B 0201101012540205220094<br>
RECEIVINGCENTER=EDOS<br>
PROCESSINGCENTER=ASTER-GDS<br>
.....</font></blockquote>
<blockquote><font face="Courier New">snip</font></blockquote>
<blockquote><font face="Courier New">.....</font></blockquote>
<blockquote><font face="Courier New">
SUBDATASET_12_NAME=HDF4_SDS:ASTER_L1B:"/ASTER_files/ASTER_FO_gen<span
></span>02/AST_L1B_003_01102002101254_05222002150244.hdf":17<br>
SUBDATASET_12_DESC=[700x830] ImageData11 (16-bit unsigned
integer)</font></blockquote>
<blockquote><font face="Courier New">
SUBDATASET_13_NAME=HDF4_SDS:ASTER_L1B:"/ASTER_files/ASTER_FO_gen<span
></span>02/AST_L1B_003_01102002101254_05222002150244.hdf":18<br>
SUBDATASET_13_DESC=[700x830] ImageData12 (16-bit unsigned
integer)</font></blockquote>
<blockquote><font face="Courier New">
SUBDATASET_14_NAME=HDF4_SDS:ASTER_L1B:"/ASTER_files/ASTER_FO_gen<span
></span>02/AST_L1B_003_01102002101254_05222002150244.hdf":19<br>
SUBDATASET_14_DESC=[700x830] ImageData13 (16-bit unsigned
integer)</font></blockquote>
<blockquote><font face="Courier New">
SUBDATASET_15_NAME=HDF4_SDS:ASTER_L1B:"/ASTER_files/ASTER_FO_gen<span
></span>02/AST_L1B_003_01102002101254_05222002150244.hdf":20<br>
SUBDATASET_15_DESC=[700x830] ImageData14 (16-bit unsigned
integer)<br>
Corner Coordinates:<br>
Upper Left ( 0.0, 0.0)<br>
Lower Left ( 0.0, 512.0)<br>
Upper Right ( 512.0, 0.0)<br>
Lower Right ( 512.0, 512.0)<br>
Center ( 256.0,
256.0)</font></blockquote>
<blockquote><font face="Courier New">[lor:~] lor%</font></blockquote>
<div><br></div>
<div>Now you see the information about your ASTER<font
face="Courier New"> SUBDATASET</font> file:</div>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New">[lor:~] lor%
/usr/local/bin/gdalinfo
HDF4_SDS:ASTER_L1B:"/ASTER_files/ASTER_FO_gen02/AST_L1B_003_0110<span
></span>2002101254_05222002150244.hdf":2</font></blockquote>
<blockquote><font face="Courier New">ERROR 6: Unable to load PROJ.4
library (libproj.so), creation of<br>
OGRCoordinateTransformation failed.<br>
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of<br>
OGRCoordinateTransformation failed.<br>
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of<br>
OGRCoordinateTransformation failed.<br>
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of<br>
OGRCoordinateTransformation failed.</font></blockquote>
<blockquote><font face="Courier New">Driver: HDF4Image/HDF4
Dataset<br>
Size is 4980, 4200<br>
Coordinate System is:<br>
PROJCS["UTM Zone 33, Northern
Hemisphere",</font></blockquote>
<blockquote><font face="Courier New">
GEOGCS["WGS 84",<br>
DATUM["WGS_1984",<br>
SPHEROID["WGS 84",6378137,298.257223563,<br>
<span
></span>
AUTHORITY["EPSG","7030"]],<br>
TOWGS84[0,0,0,0,0,0,0],<br>
AUTHORITY["EPSG","6326"]],</font></blockquote>
<blockquote><font
face="Courier New">
PRIMEM["Greenwich",0,<br>
AUTHORITY["EPSG","8901"]],<br>
UNIT["degree",0.0174532925199433,<br>
AUTHORITY["EPSG","9108"]],<br>
AXIS["Lat",NORTH],<br>
AXIS["Long",EAST],<br>
AUTHORITY["EPSG","4326"]],<br>
PROJECTION["Transverse_Mercator"],<br>
PARAMETER["latitude_of_origin",0],<br>
PARAMETER["central_meridian",15],<br>
PARAMETER["scale_factor",0.9996],<br>
PARAMETER["false_easting",500000],<br>
PARAMETER["false_northing",0],<br>
UNIT["Meter",1]]<br>
GeoTransform =<br>
12.19647665061962, 0.0001816592369477914,
-3.696047619047622e-05<br>
43.49892337703098, -2.646787148594408e-05,
-0.0001322861904761889<br>
GCP Projection = GEOGCS["WGS
84",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.257223563,AUTHORITY["EPSG","7030<span
></span
>"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","632<span
></span
>6"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG",<span
></span
>"8901"]],UNIT["degree",0.0174532925199433,AUTHOR<span
></span
>ITY["EPSG","9108"]],AXIS["Lat",NORTH],<span
></span
>AXIS["Long",EAST],AUTHORITY["EPSG","4326<span
></span>"]]<br>
.....</font></blockquote>
<blockquote><font face="Courier New">snip</font></blockquote>
<blockquote><font face="Courier New">.....</font></blockquote>
<blockquote><font face="Courier New">
TIMEOFDAY=101254443000Z<br>
CALENDARDATE=20020110<br>
FUTUREREVIEWDATE=20020312<br>
SCIENCEREVIEWDATE=20011201<br>
QAPERCENTMISSINGDATA=0.000006<br>
QAPERCENTOUTOFBOUNDSDATA=0.000006<br>
QAPERCENTINTERPOLATEDDATA=0.000000<br>
REPROCESSINGACTUAL=not reprocessed<br>
PGEVERSION=04.00R06<br>
PROCESSINGLEVELID=1B<br>
MAPPROJECTIONNAME=Universal Transverse Mercator<br>
Corner Coordinates:<br>
Upper Left ( 12.1964767, 43.4989234)<br>
Lower Left ( 12.0412427, 42.9433214)<br>
Upper Right ( 13.1011397, 43.3671134)<br>
Lower Right ( 12.9459057, 42.8115114)<br>
Center ( 12.5711912,
43.1552174)<br>
Band 1 Block=4980x1 Type=Byte, ColorInterp=Gray</font></blockquote>
<blockquote><font face="Courier New">[lor:~] lor%</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><br></blockquote>
<div>You see the error at the beginning (libproj.so) but the
informations are exact.</div>
<div><br></div>
<div>Now in Grass I have the same problem.</div>
<div>From info of Aster file I have a scene in UTM zone 33 projection
with unit degree (not meters).</div>
<div><br></div>
<div>I have created a lat lon location because a UTM location has the
unit in meters.</div>
<div><br></div>
<div>Now in Grass with r.in.gdal module (Import Raster from Gdal) I
enter the file name in this format (only subdataset):</div>
<div><br></div>
<div><font
face="Courier New"><x-tab>
</x-tab
>HDF4_SDS:ASTER_L1B:"/ASTER_files/ASTER_FO_gen02/AST_L1B_003_011<span
></span>02002101254_05222002150244.hdf":2</font></div>
<div><br></div>
<div>and gdal imports this subdataset but with this error</div>
<div><br></div>
<blockquote><font face="Courier New">ERROR 6: Unable to load PROJ.4
library (libproj.so), creation of<br>
OGRCoordinateTransformation failed.<br>
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of<br>
OGRCoordinateTransformation failed.<br>
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of<br>
OGRCoordinateTransformation failed.<br>
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation
of</font></blockquote>
<blockquote><font face="Courier New">OGRCoordinateTransformation
failed.</font></blockquote>
<div><br></div>
<div>I import and I see ASTER files in GRASS but there are not well
georeferenced. There is an error about lat lon projection and UTM zone
code. I read the ASTER info and I suppose that this error is in gdal
but I have not received answer from GDAL mailing list.</div>
<div><br></div>
<div><font size="+1">Can you help me about projection for ASTER files
or about this error from gdal????</font></div>
<div><br></div>
<div><br></div>
<blockquote type="cite" cite>P.S.<br>
I also downloaded the HDFLook program as an alternative, but again, I
have the<br>
unzipped file sitting on my desktop staring at me. If using that
program is<br>
easier to explain, feel free to let loose if someone knows
how.</blockquote>
<div><br></div>
<div><br></div>
<div>HDFLook is for HDF MODIS file.</div>
<div>There is OSX version in HDFLOOK site: download it.</div>
<div>There are 2 files: HDFLook and HDFLook.ad</div>
<div>For installing you must read the README file.</div>
<div><br></div>
<div>From README file:</div>
<div><font face="Courier New"><br></font></div>
<div><br></div>
<blockquote>
<blockquote><font face="Courier New">HDFLook_MODIS HDF data
files viewer</font></blockquote>
<blockquote><font
face="Courier New">===================================</font></blockquote
>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab>READ AND DISPLAY HDF DATA SETS:</font></blockquote>
<blockquote><font
face="Courier New"> <x-tab>
</x-tab><x-tab>
</x-tab>-raster images</font></blockquote>
<blockquote><font
face="Courier New"> <x-tab>
</x-tab><x-tab>
</x-tab>-SDS ( up to 6 array index, MODIS compress file
format)</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>(MODIS Quality Control)</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab><x-tab>
</x-tab>-VDATA</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New">Distribution
files</font></blockquote>
<blockquote><font
face="Courier New">==================</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New">MAPS.tar.Z <x-tab>
</x-tab><x-tab>
</x-tab>*Coast files and Fonts used by HDFlook to overlap maps
on the MODIS images</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>-MAPS</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>-MAPS/Fonts</font></blockquote>
<blockquote><font
face="Courier New">HOWTO_HDFLOOK.tar.Z<x-tab>
</x-tab><x-tab>
</x-tab>*Examples: how to use HDFLook in background with command
files</font></blockquote>
<blockquote><font
face="Courier New">HDFLOOK_COMMANDS.Z<x-tab>
</x-tab><x-tab>
</x-tab>*Background command files key words
description</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New">ENGLISH_MANUAL_HDFLook.ps.gz<x-tab>
</x-tab>*Manuals</font></blockquote>
<blockquote><font
face="Courier New">FRENCH_MANUAL_HDFLook.ps.gz</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New">LINUX_REDHAT.....HDFLook.tar.gz
*Computer binaries</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>-HDFlook</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>-HDFLook.ad</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New">cp HDFlook
/usr/local/bin</font></blockquote>
<blockquote><font face="Courier New">cp HDFLook.ad
/usr/lib/X11/app-defaults</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New">=======================</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New">At the first use of HDFLook, the
user has to define two environment variables with:</font></blockquote>
<blockquote><font face="Courier New">- the absolute path of the
directory containing the coast, river maps data
files.</font></blockquote>
<blockquote><font face="Courier New">- the absolute path of the
directory used temporary files.</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab>for example: in csh:</font></blockquote>
<blockquote><font
face="Courier New"> <x-tab>
</x-tab>setenv HDFLOOKMAPS /usr/local/Maps</font></blockquote>
<blockquote><font
face="Courier New"> <x-tab>
</x-tab>setenv HDFLOOKTMP /usr/tmp</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab>for example: in sh:</font></blockquote>
<blockquote><font
face="Courier New"> <x-tab>
</x-tab>HDFLOOKMAPS=/usr/local/Maps ; export
HDFLOOKMAPS</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab><x-tab>
</x-tab>HDFLOOKTMP=/usr/tmp ; export HDFLOOKTMP</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New">Note: if HDFLook is NOT a part of
the Msphinx package the user has to download the</font></blockquote>
<blockquote><font
face="Courier New"><x-tab>
</x-tab>MAPS.tar.Z file to get the maps and fonts
files</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New">Note: if HDFLook is part of the
Msphinx package the directory containing the coast
maps</font></blockquote>
<blockquote><font face="Courier New">is located under ????/Mfiles/Maps
directory</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New">--------------------</font></blockquote>
<blockquote><font face="Courier New">Main
characteristics</font></blockquote>
<blockquote><font
face="Courier New">--------------------</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"> * Visualization of
the HDF contents for the following formats:</font></blockquote>
<blockquote><font
face="Courier New"> o SDS
(Scientific Data Set)</font></blockquote>
<blockquote><font
face="Courier New"> o
Vfiles</font></blockquote>
<blockquote><font
face="Courier New"> o
``Raster images'' 24 bits or 8 bits with look up
table.</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"> * Visualization of
slices of data: up to 6 indexes</font></blockquote>
<blockquote><font face="Courier New"> * Display of the
files attributes</font></blockquote>
<blockquote><font face="Courier New"> * Automatic
detection of particular filling values (mask)</font></blockquote>
<blockquote><font face="Courier New"> * Extraction and
dump of binary files stored as simple matrices of
(lines</font></blockquote>
<blockquote><font face="Courier New"> W
columns)</font></blockquote>
<blockquote><font face="Courier New"> * Display data sets
as ASCII pages of numbers</font></blockquote>
<blockquote><font face="Courier New"> * Plot of transects
and histograms on image planes</font></blockquote>
<blockquote><font face="Courier New"> * Plot of SDS
records</font></blockquote>
<blockquote><font face="Courier New"> * Production of
images and graphics PostScript prints.</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New">--------------------</font></blockquote>
<blockquote><font face="Courier New">with command
lines</font></blockquote>
<blockquote><font
face="Courier New">--------------------</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"> * extract the
ancillary data of a SDS.</font></blockquote>
<blockquote><font face="Courier New"> * print a PostScript
image</font></blockquote>
<blockquote><font face="Courier New"> * export (Raw or
calibrated) SDS records to binary files</font></blockquote>
<blockquote><font face="Courier New"> * export (Raw or
calibrated) SDS records to HDF files</font></blockquote>
<blockquote><font face="Courier New"> * export RGB images
to jpeg files</font></blockquote>
<blockquote><font face="Courier New"> * export RGB images
to hdf files</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New"> On
HDF-EOS MODIS format:</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"> * build reprojected
SDS mosaic to binary files</font></blockquote>
<blockquote><font face="Courier New"> * build reprojected
RGB mosaic to binary files</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font
face="Courier New">
Connected to Msphinx:</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
<blockquote><font face="Courier New"> * send to Msphinx
all (raw or reprojected) MODIS data and then use
the</font></blockquote>
<blockquote><font face="Courier New"> Msphinx
command lines to build sophisticate outputs.</font></blockquote>
<blockquote><br></blockquote>
</blockquote>
<div><br></div>
<div>You must copy 2 files in your directory:</div>
<div><br></div>
<blockquote>
<blockquote><font face="Courier New">[lor:/download] lor% sudo cp
HDFlook /usr/local/bin</font></blockquote>
<blockquote><font face="Courier New">[lor:/download] lor% sudo cp
HDFLook.ad /usr/lib/X11/app-defaults</font></blockquote>
</blockquote>
<div><font face="Courier New"><br></font></div>
<div>enter your root password.</div>
<div><br></div>
<div>Now you have to set the environment in cshrc file</div>
<div><br></div>
<div>Open terminal in your home directory (/Users/name_of_user/) and
enter:</div>
<div><br></div>
<blockquote>
<blockquote><font face="Courier New">[lor:~] lor% pico
.cshrc</font></blockquote>
<blockquote><font face="Courier New"><br></font></blockquote>
</blockquote>
<div>and insert:</div>
<div><br></div>
<blockquote>
<blockquote><font face="Courier New"># HDFLook<br>
setenv HDFLOOKMAPS /usr/local/Maps</font></blockquote>
<blockquote><font face="Courier New">setenv HDFLOOKTMP
/usr/tmp</font></blockquote>
</blockquote>
<div> </div>
<div>Now you open X11 and enter (or add this command)</div>
<div><br></div>
<blockquote>
<blockquote><font face="Courier New">[lor:~] lor%
/usr/local/bin/HDFLook &</font></blockquote>
</blockquote>
<div><br></div>
<div>You can open HDF Modis files with all data: you can export in
Geotiff file from HDF file.</div>
<div>You can open HDF Aster files but it does not read geographic
information. You can only see the files.</div>
<div>For only viewing HDF file you can use Multispec program
(http://www.ece.purdue.edu/~biehl/MultiSpec/)</div>
<div><br></div>
<div>Best regards</div>
<div><br></div>
<x-sigsep><pre>--
</pre></x-sigsep>
<div><font face="Verdana"
color="#000000"
>____________________________________________________________________<span
></span>____</font></div>
<div><font face="Courier New"
color="#000000">|| Lorenzo
Moretti e-mail:
lorenzo.moretti@bologna.enea.it </font></div
>
<div><font face="Courier New" color="#000000">||/|/| ENEA
prot <span
></span> Web:
http://wwwamb.bologna.enea.it/ </font></div>
<div><font face="Courier New" color="#000000">|| |
via Don Fiammelli, 2 FTP:
ftp://ftpamb.bologna.enea.it/ (ris.)</font></div>
<div><font face="Courier New" color="#000000">~~~~~~ 40128
BOLOGNA - ITALY Ph: +39-0516098086 Fax:
+39-0516098131</font></div>
<div><font face="Courier New"
color="#000000"
>____________________________________________________________________<span
></span>____</font></div>
</body>
</html>