<html>
<body>
<font size=3>Hello,<br><br>
The code compiles because it is part of a bigger program. 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 & 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
<br>
works with OGR.<br><br>
OGRSpatialReference oSourceSRS,
oTargetSRS;<br>
OGRCoordinateTransformation
*poCT;<br>
double x1, y1;<br><br>
oSourceSRS="EPSG:4326";<br>
oTargetSRS="EPSG:4989";</blockquote><br>
I don't see how this could compile. You need to instantiate
<br>
oSourceSRS and oTargetSRS with OSRNewSpatialReference, and then use
a <br>
call like OSRImportFromEPSG or OSRSetFromUserInput on the objects
to <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. Otherwise, you
must <br>
ensure that GDAL_DATA and/or PROJ_LIB environment variables are
set, <br>
and the necessary data can be found in those locations *and* the
<br>
proj.dll that was linked with GDAL at compile time is able to be
found <br>
at runtime.</font></blockquote></body>
</html>