[gdal-dev] Problem with OGRCreateCoordinateTransformation

Reinaldo Escada Chohfi rec at geodesign.com.br
Thu Apr 9 22:38:03 EDT 2009


Hello all,

We place this piece of code to test how coordinate transformation 
works with OGR.

         OGRSpatialReference oSourceSRS, oTargetSRS;
         OGRCoordinateTransformation *poCT;
         double  x1, y1;

         oSourceSRS="EPSG:4326";
         oTargetSRS="EPSG:4989";

         poCT = OGRCreateCoordinateTransformation( &oSourceSRS, &oTargetSRS );
         x1 = -45.859485925833;
         y1 = -23.2101365278;

         printf("%lf %lf \n",x1,y1);
		
		if( poCT == NULL || !poCT->Transform( 1, &x1, &y1 ) )
             printf( "Transformation failed.\n" );
         else
             printf( "(-45.859485925833,-23.2101365278) -> (%f,%f)\n",
                      x1, y1 );

The program compiles fine, but it gives the following runtime error:

ERROR 6: Unable to load PROJ.4 library (proj.dll), creation of
OGRCoordinateTransformation failed.

Isn't PROj.4 (proj.lib) built in OGR?

Any help is appreciate.

Thanks,

Reinaldo



More information about the gdal-dev mailing list