<html>
<body>
<font size=3>Hello,<br><br>
The code compiles because it is part of a bigger program.&nbsp; This is
just the portion on Coordinate Transformation.<br><br>
Any additional comment is welcomed. <br><br>
I did not compile GDAL. I am using gdalwin32exe141 &amp; gdalwin32dev141
pre-built GDAL.<br><br>
Thanks for your help.<br><br>
Reinaldo<br><br>
At 01:25 AM 4/10/2009, Howard Butler wrote:<br><br>
<blockquote type=cite class=cite cite="">On Apr 9, 2009, at 9:38 PM,
Reinaldo Escada Chohfi wrote:<br><br>
<blockquote type=cite class=cite cite="">Hello all,<br><br>
We place this piece of code to test how coordinate transformation&nbsp;
<br>
works with OGR.<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OGRSpatialReference oSourceSRS,
oTargetSRS;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OGRCoordinateTransformation
*poCT;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double&nbsp; x1, y1;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
oSourceSRS=&quot;EPSG:4326&quot;;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
oTargetSRS=&quot;EPSG:4989&quot;;</blockquote><br>
I don't see how this could compile.&nbsp; You need to instantiate&nbsp;
<br>
oSourceSRS and oTargetSRS with OSRNewSpatialReference, and then use
a&nbsp; <br>
call like OSRImportFromEPSG or OSRSetFromUserInput on the objects
to&nbsp; <br>
get valid SpatialReferences.<br><br>
<blockquote type=cite class=cite cite=""><br>
The program compiles fine, but it gives the following runtime
error:<br><br>
ERROR 6: Unable to load PROJ.4 library (proj.dll), creation of<br>
OGRCoordinateTransformation failed.<br><br>
Isn't PROj.4 (proj.lib) built in OGR?<br>
</blockquote><br>
No, it is loaded at runtime unless you use have PROJ_FLAGS = -
DPROJ_STATIC in your nmake.opt when you compile.&nbsp; Otherwise, you
must&nbsp; <br>
ensure that GDAL_DATA and/or PROJ_LIB environment variables are
set,&nbsp; <br>
and the necessary data can be found in those locations *and* the&nbsp;
<br>
proj.dll that was linked with GDAL at compile time is able to be
found&nbsp; <br>
at runtime.</font></blockquote></body>
</html>