[Gdal-dev] ASTER HDF L1_B problem in Mac OS X

Lorenzo Moretti lorenzo.moretti at bologna.enea.it
Fri Jan 30 12:21:26 EST 2004


Hi

When I use gdalinfo for viewing subdataset in HDF file (utm zone 33 
with coordinate in lat-lon I have an error to the beginning:

[lorenzo:/usr/local/bin] ben% ./gdalinfo 
HDF4_SDS:ASTER_L1B:"/Volumes/ESTERNO/ASTER_FO_gen02/AST_L1B_003_01102002101254_05222002150244.hdf":2

ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of
OGRCoordinateTransformation failed.
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of
OGRCoordinateTransformation failed.
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of
OGRCoordinateTransformation failed.
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of
OGRCoordinateTransformation failed.
Driver: HDF4Image/HDF4 Dataset
Size is 4980, 4200
Coordinate System is:
PROJCS["UTM Zone 33, Northern Hemisphere",
     GEOGCS["WGS 84",
         DATUM["WGS_1984",
             SPHEROID["WGS 84",6378137,298.257223563,
                 AUTHORITY["EPSG","7030"]],
             TOWGS84[0,0,0,0,0,0,0],
             AUTHORITY["EPSG","6326"]],
         PRIMEM["Greenwich",0,
             AUTHORITY["EPSG","8901"]],
         UNIT["degree",0.0174532925199433,
             AUTHORITY["EPSG","9108"]],
         AXIS["Lat",NORTH],
         AXIS["Long",EAST],
         AUTHORITY["EPSG","4326"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",0],
     PARAMETER["central_meridian",15],
     PARAMETER["scale_factor",0.9996],
     PARAMETER["false_easting",500000],
     PARAMETER["false_northing",0],
     UNIT["Meter",1]]
GeoTransform =
   12.19647665061962, 0.0001816592369477914, -3.696047619047622e-05
   43.49892337703098, -2.646787148594408e-05, -0.0001322861904761889
GCP Projection = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 
84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=, Info=
           (0.5,0.5) -> (12.1965,43.4988,0)
GCP[  1]: Id=, Info=

...
snip
...

   SOUTHBOUNDINGCOORDINATE=42.811432
   TIMEOFDAY=101254443000Z
   CALENDARDATE=20020110
   FUTUREREVIEWDATE=20020312
   SCIENCEREVIEWDATE=20011201
   QAPERCENTMISSINGDATA=0.000006
   QAPERCENTOUTOFBOUNDSDATA=0.000006
   QAPERCENTINTERPOLATEDDATA=0.000000
   REPROCESSINGACTUAL=not reprocessed
   PGEVERSION=04.00R06
   PROCESSINGLEVELID=1B
   MAPPROJECTIONNAME=Universal Transverse Mercator
Corner Coordinates:
Upper Left  (  12.1964767,  43.4989234)
Lower Left  (  12.0412427,  42.9433214)
Upper Right (  13.1011397,  43.3671134)
Lower Right (  12.9459057,  42.8115114)
Center      (  12.5711912,  43.1552174)
Band 1 Block=4980x1 Type=Byte, ColorInterp=Gray

When I use gdal_translate I have the same error.
When I use Grass with r.in.gdal module I have the same error.

I see the code and in the file
../ogr/ogrct.cpp

there is

CPL_CVSID("$Id: ogrct.cpp,v 1.23 2004/01/24 09:35:00 warmerda Exp $");

/* ==================================================================== */
/*      PROJ.4 interface stuff.                                         */
/* ==================================================================== */
#ifndef PROJ_STATIC
typedef struct { double u, v; } projUV;

#define projPJ void *

#define RAD_TO_DEG      57.29577951308232
#define DEG_TO_RAD      .0174532925199432958

#endif

static projPJ       (*pfn_pj_init_plus)(const char *) = NULL;
static projPJ       (*pfn_pj_init)(int, char**) = NULL;
static projUV       (*pfn_pj_fwd)(projUV, projPJ) = NULL;
static projUV       (*pfn_pj_inv)(projUV, projPJ) = NULL;
static void     (*pfn_pj_free)(projPJ) = NULL;
static int      (*pfn_pj_transform)(projPJ, projPJ, long, int,
                                     double *, double *, double * ) = NULL;
static int         *(*pfn_pj_get_errno_ref)(void) = NULL;
static char        *(*pfn_pj_strerrno)(int) = NULL;
static char        *(*pfn_pj_get_def)(projPJ,int) = NULL;
static void         (*pfn_pj_dalloc)(void *) = NULL;

#ifdef WIN32
#  define LIBNAME      "proj.dll"
#else
#  define LIBNAME      "libproj.so"
#endif
....

snip

....
/************************************************************************/
/*                 OGRCreateCoordinateTransformation()                  */
/************************************************************************/

/**
  * Create transformation object.
  *
  * This is the same as the C function OCTNewCoordinateTransformation().
  *
  * The delete operator, or OCTDestroyCoordinateTransformation() should
  * be used to destroy transformation objects.
  *
  * @param poSource source spatial reference system.
  * @param poTarget target spatial reference system.
  * @return NULL on failure or a ready to use transformation object.
  */

OGRCoordinateTransformation*
OGRCreateCoordinateTransformation( OGRSpatialReference *poSource,
                                    OGRSpatialReference *poTarget )

{
     OGRProj4CT  *poCT;

     if( !LoadProjLibrary() )
     {
         CPLError( CE_Failure, CPLE_NotSupported,
                   "Unable to load PROJ.4 library (%s), creation of\n"
                   "OGRCoordinateTransformation failed.",
                   LIBNAME );
         return NULL;
     }

     poCT = new OGRProj4CT();
    
     if( !poCT->Initialize( poSource, poTarget ) )
     {
         delete poCT;
         return NULL;
     }
     else
     {
         return poCT;
     }
}

.....



In gdal config there is'n --with-proj=DIR and the error is from this file.
I have PROJ4.4.7 installed as shared library (libproj.dylib in Mac OS 
X in /usr/local/lib)
I have changed the name in source (libproj.so changed libproj.dylib) 
but the error remains ...

Is this file important for coordinate recognition ?

Can you help me ?


Thanx
-- 
________________________________________________________________________
||      Lorenzo Moretti        e-mail: lorenzo.moretti at bologna.enea.it     
||/|/|  ENEA prot              Web: http://wwwamb.bologna.enea.it/    
||   |  via Don Fiammelli, 2   FTP: ftp://ftpamb.bologna.enea.it/ (ris.)
~~~~~~  40128 BOLOGNA - ITALY  Ph: +39-0516098086  Fax: +39-0516098131
________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20040130/2215aa2b/attachment.html


More information about the Gdal-dev mailing list