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

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to