[gdal-dev] Problem with OGRCreateCoordinateTransformation

Reinaldo Escada Chohfi rec at geodesign.com.br
Fri Apr 10 10:48:13 EDT 2009


Hello,

The code compiles because it is part of a bigger program.  This is 
just the portion on Coordinate Transformation.

Any additional comment is welcomed.

I did not compile GDAL. I am using gdalwin32exe141 & gdalwin32dev141 
pre-built GDAL.

Thanks for your help.

Reinaldo

At 01:25 AM 4/10/2009, Howard Butler wrote:

>On Apr 9, 2009, at 9:38 PM, Reinaldo Escada Chohfi wrote:
>
>>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";
>
>I don't see how this could compile.  You need to instantiate
>oSourceSRS and oTargetSRS with OSRNewSpatialReference, and then use a
>call like OSRImportFromEPSG or OSRSetFromUserInput on the objects to
>get valid SpatialReferences.
>
>>
>>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?
>
>No, it is loaded at runtime unless you use have PROJ_FLAGS = - 
>DPROJ_STATIC in your nmake.opt when you compile.  Otherwise, you must
>ensure that GDAL_DATA and/or PROJ_LIB environment variables are set,
>and the necessary data can be found in those locations *and* the
>proj.dll that was linked with GDAL at compile time is able to be found
>at runtime.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090410/939d9e53/attachment.html


More information about the gdal-dev mailing list