[gdal-dev] Extracting MODIS bands from MODIS HDF grid file using gdalwarp fails on 64-bit system (?)

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Tue Mar 18 11:28:56 EDT 2008


On Tue, 2008-03-18 at 11:19 -0400, Frank Warmerdam wrote:
> Nikos Alexandris wrote:
> > Dear gdal-list,
> > 
> > in the past I successfully used the following lines from
> > Markus' (Neteler) script to extract MODIS bands from MOD09 products
> > (surface reflectance).
> > 
> > 
> > FILE=$1
> > HDFlayerNAMES="`gdalinfo $FILE | grep SUBDATASET_ | grep _NAME | cut
> > -d'=' -f2`"
> > 
> > for i in ${HDFlayerNAMES} ; do
> > 	INPUT="`echo ${i}`"
> >         NEWNAME="`echo ${i} | cut -d':' -f4,5 | tr ':' '_' | tr -s '|'
> > '_'`"
> >         # apply GCPs and convert to GTiFF using -rcs
> >         gdalwarp -s_srs '+proj=sinu +R=6371007.181 +nadgrids=@null
> > +wktext' -t_srs '+init=epsg:2100' -tr 500 500 -rcs "${INPUT}"
> > $NEWNAME.HGRS87.tif
> > 
> > 
> > Since I switched to (Ubuntu 7.10) 64-bit I have problems reading /
> > writing HDF grid files.
> > 
> > 
> > The result, when running the above lines in a script with a
> > MOD09????.HDF file, is:
> > 
> > Creating output file that is 2772P x 2333L.
> > Processing input file
> > HDF4_EOS:EOS_GRID:"MOD09GHK.A2006239.h19v05.004.2006241155729.hdf":MOD_Grid_L2g_2d:sur_refl_b01_1.
> > Using internal nodata values (eg. 144) for image
> > HDF4_EOS:EOS_GRID:"MOD09GHK.A2006239.h19v05.004.2006241155729.hdf":MOD_Grid_L2g_2d:sur_refl_b01_1.
> > ERROR 1: GDreadfield() failed for block.
> > ERROR 1: IReadBlock failed at X offset 0, Y offset 1
> > ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 1
> > Creating output file that is 2772P x 2333L.
> > Processing input file
> > HDF4_EOS:EOS_GRID:"MOD09GHK.A2006239.h19v05.004.2006241155729.hdf":MOD_Grid_L2g_2d:sur_refl_b02_1.
> > Using internal nodata values (eg. 144) for image
> > HDF4_EOS:EOS_GRID:"MOD09GHK.A2006239.h19v05.004.2006241155729.hdf":MOD_Grid_L2g_2d:sur_refl_b02_1.
> > ERROR 1: GDreadfield() failed for block.
> > ERROR 1: IReadBlock failed at X offset 0, Y offset 1
> > ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 1
> > Creating output file that is 2772P x 2333L.
> > [...]
> > 
> > Is it really a  64-bit problem or is something in my systems
> > configuration? I've had problems understanding and applying variables,
> > shared libraries. But I think I've corrected this.
> 
> Nikos,
> 
> I have not encountered problems with HDF4 on Ubuntu 64 bit but I build
> my HDF4 and GDAL libraries from source.  I would encourage you to file
> a quite specific ticket on the issue.
> 
> Best regards,

Thank you Frank. I will hunt it a bit more... (it's probably related
with my previous posts in which you also pointed out to build from
source -e.g. for OGDI, expat -).

If I fail I will open a ticket. I just want to avoid doing so if errors
are due to my limited experiences.

( I still have problems getting a no-error build on my 64-bit system
including ogdi, hdf, expat, grass support )

Greetings,

Nikos





More information about the gdal-dev mailing list