HDF4 Error Spatial Allocator


#1

I am using the spatial allocator tools from CMAS in order to collect land use data.

In running this program I get a generic hdf4 error:

HDF4 error

I wanted to see if anyone has any information on what causes an error like this.

I am using hdf 4.2.10 (--disable-netcdf --disable-fortran) with hdf 5.-1.8-13 (--enable-cxx)

I am also using gdal 1.11.0
(./configure --prefix={GDAL_PATH}/local --with-static-proj4={PROP4_PATH}/local --with-geos={GEOS_PATH}/local/bin/geos-config --with-libtiff=internal --with-png=internal --with-jpeg=internal --with-libz=internal --with-png=internal --with-geotiff=internal --with-libtiff=internal --enable-static --without-curl --without-expat --without-mysql --without-dwgdirect --without-odbc --without-python --without-oci --without-sqlite3 --without-oci-include --without-oci-lib --without-pg --without-ld-shared)


#2

UPDATE:

I’ve gotten past the generic HDF4 Error with some help from CMAS

Here is what I was directed to do:
Use h4dump (ncdump for h4 file in Spatial Allocator alias) to check the variable name in your file.

The old MODIS file variable is: Land_Cover_Type_1

The new MODIS file variable is: LC_Type1

If you have new MODIS variable, you need to do this:
In geo_functions.cpp and in string getHDF4VarAttrInfo function:

attStr = string ( attBuff );
//attStr.erase (count);

In computeGridLandUse.cpp
//MODIS tile land cover class variable: may change depending on NASA MODIS LC products

//string modisVarName = string ( "Land_Cover_Type_1" );
string modisVarName = string ( "LC_Type1" );`

Repeat what was done on computeGridLandUse.cpp to computeGridLandUse)beld4.cpp
Somehow, the new MODIS file “long_name” attribute count is set to 100, not real char counts like before.

Run the make file in the src/raster directory

make clean
make
make install