[Gdal-dev] Error in ogrct.cpp file in ogr folder

Frank Warmerdam fwarmerdam at gmail.com
Fri Feb 11 12:22:13 EST 2005


On Fri, 11 Feb 2005 18:02:17 +0100, Lorenzo Moretti
<lorenzo.moretti at bologna.enea.it> wrote:
>  
> Hi all 
> 
>  
> I have a problem with GDAL linked to PROJ library not installed in default
> directory (usr/local). 
> 
>  
> THIS PROBLEM IS ONLY CONNECTED TO RASTER REPROJECTION. Example in THUBAN
> software (it works with GDAL-OGR) you can reproject vector files but with
> raster you have always this error: 

Lorenzo, 

I don't know why the problems you are encountering would only affect
rasters, and not vector reprojection. Perhaps it is just that Thuban uses
PROJ.4 or something else directly instead of through ogr for vector
reprojection?
  
> ERROR 6: Unable to load PROJ.4 library (libproj.dylib), creation of 
> OGRCoordinateTransformation failed.
>  
> I have a Mac OS X and in the file ogr/ogrct.cpp row 144-148 I have changed: 
> 
>  
>   #ifdef WIN32 
>   #  define LIBNAME      "proj.dll" 
>   #else 
> - #  define LIBNAME      "libproj.so" 
>   #endif 
> 
>  
>   #ifdef WIN32 
>   #  define LIBNAME      "proj.dll" 
>   #else 
> + #  define LIBNAME      "libproj.dylib" 
>   #endif 

In CVS the code was changed to:

#ifdef WIN32
#  define LIBNAME      "proj.dll"
#elif defined(__APPLE__)
#  define LIBNAME      "libproj.dylib"
#else
#  define LIBNAME      "libproj.so"
#endif

A while ago. 

> I have discovered a wrong link inside my libgdal.dylib about the link to
> libproj.dylib library outside normal /usr/local/lib folder. 

I think you will need to give more specific information. What link line was
used when you built PROJ.4 in statically?  What error message did you
get?  What does the dump of shared library dependencies look like on this
GDAL? 

For the dynamically loaded (default) case, you will need to define the 
PROJSO environment variable to point to the directory where PROJ.4 sits
if it is not in the LD_LIBRARY_PATH or equivelent. 

> This is an error in GDAL library. GDAL must work outside normal /usr/local
> folder installation. 

Oh, that word "must" is so strong.  I don't even let my wife tell me what
I "must" do.  Nevertheless, I am interested in ensuring that GDAL can be used
with PROJ.4 in unusual directories. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list