[Gdal-dev] Issues with hdf4 subdatasets on win xp using gdal trunk

Simone Gannecchini simboss1 at gmail.com
Sun May 20 11:36:43 EDT 2007


Hi list,
I am having some issues working with hdf4 driver on some modis aqua data.

I am working with gdal trunk which I built myself two days ago on my windows
xp box.

I have a test dataset that I want to access which is now located on my hard
drive under c:\roger. Dataset name is NJ2007136092911.L3_NURC_temp.

When I am inside the c:\roger directory everything works as expected. I can
do a gdalinfo on the main dataset and I am also able to do a gdalinfo on the
subdatasets I need.

If I browse to c:\ and I issue the following command:

gdalinfo c:\\roger\\NJ2007136092911.L3_NURC_temp
I get the information for the whole dataset correctly. Here below you have
an excerpt:


>>
C:\>gdalinfo c:\\roger\\NJ2007136092911.L3_NURC_temp

Driver: HDF4/Hierarchical Data Format Release 4 Size is 512, 512 Coordinate
System is `'
Metadata:
....
  mapProjectionSystem=NRL(USGS)
  mapProjection=temp
  mapUpperLeft=38.4999999999998, 11.5
  mapUpperRight=38.4999999999998, 16.5
  mapLowerLeft=33.9979685274162, 11.5
  mapLowerRight=33.9979685274162, 16.5
 
prodList=albedo_ch1,albedo_ch2,btemp_ch3,btemp_ch4,btemp_ch5,l2_flags,sst,re
f_dif,K_PAR,suspend,c_660
....
Subdatasets:
 
SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:1

  SUBDATASET_1_DESC=[556x500] albedo_ch1 (16-bit integer)
 
SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:2

  SUBDATASET_2_DESC=[556x500] albedo_ch2 (16-bit integer)
 
SUBDATASET_3_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:3

  SUBDATASET_3_DESC=[556x500] btemp_ch3 (16-bit integer)
 
SUBDATASET_4_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:4

  SUBDATASET_4_DESC=[556x500] btemp_ch4 (16-bit integer)
 
SUBDATASET_5_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:5

  SUBDATASET_5_DESC=[556x500] btemp_ch5 (16-bit integer)
 
SUBDATASET_6_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:6

  SUBDATASET_6_DESC=[556x500] l2_flags (32-bit unsigned integer)
 
SUBDATASET_7_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:7

  SUBDATASET_7_DESC=[556x500] sst (16-bit integer)
 
SUBDATASET_8_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:8

  SUBDATASET_8_DESC=[556x500] ref_dif (8-bit unsigned integer)
 
SUBDATASET_9_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp"
:9

  SUBDATASET_9_DESC=[556x500] K_PAR (8-bit unsigned integer)
 
SUBDATASET_10_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp
":
10
  SUBDATASET_10_DESC=[556x500] suspend (8-bit unsigned integer)
 
SUBDATASET_11_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp
":
11
  SUBDATASET_11_DESC=[556x500] c_660 (16-bit integer)
 
SUBDATASET_12_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp
":
16
  SUBDATASET_12_DESC=[28x26] CP_Longitudes (64-bit floating-point)
 
SUBDATASET_13_NAME=HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp
":
17
  SUBDATASET_13_DESC=[28x26] CP_Latitudes (64-bit floating-point) Corner
Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

>>

Problems arise if now I try to access any of the subdatasets like as
follows:


>>
C:\>gdalinfo HDF4_SDS:UNKNOWN:"c:\\roger\\NJ2007136092911.L3_NURC_temp":7

I get the following error:

ERROR 4: `'HDF4_SDS:UNKNOWN:c:\\roger\\NJ2007136092911.L3_NURC_temp:7'' does
not  exist in the file system, and is not recognised as a supported dataset
name.

GDALOpen failed - 4
`'HDF4_SDS:UNKNOWN:c:\\roger\\NJ2007136092911.L3_NURC_temp:7'' does not
exist in  the file system, and is not recognised as a supported dataset
name.

>>

I tried the same command with a different dataset and the same problem
arises when I try to access them. I tried to do the same using gdalinfo from
FWTools 1.2.2 experiencing the same problems. However, using OpenEV from the
same FWTools distro I have been able to open up a subdataset and to
visualize it correctly.


I hope that someone can shed some light here. It has been a while since the
last time I played with gdal and HDF hence it might be me doing something
wrong.

Thx a lot,
Simone.






-------------------------------------------------------
Eng. Simone Giannecchini
President /CEO GeoSolutions S.A.S.
Via Carignoni 51
55041  Camaiore (LU)
Italy

phone: +39 0584983027
fax:   +39 0584983027
mob:   +39 333 8128928 


http://www.geo-solutions.it

-------------------------------------------------------




More information about the Gdal-dev mailing list