<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta content="MSHTML 6.00.6000.17092" name="GENERATOR">
</head>
<body>
<div><font face="Arial" size="2"><span class="097451014-09122010">Hi all,</span></font></div>
<div><font face="Arial" size="2"><span class="097451014-09122010"></span></font> </div>
<div><font face="Arial" size="2"><span class="097451014-09122010">I have downloaded gdal-1.7.3 and build this via VS2008 succesfully. Furthermore I created an evironment variable GDAL_DATA that points to my location of the folder "gdal-1.7.3\data".
</span></font></div>
<div><font face="Arial" size="2"><span class="097451014-09122010"></span></font> </div>
<div><font face="Arial" size="2"><span class="097451014-09122010">I copied the gdal17.dll towards my release location of my VS2008 application that will use this dll and added the gdal_i.lib and include files to my application aswell. The needed #includes are
also in my project and know when the following code is called:</span></font></div>
<div><font face="Arial" size="2"><span class="097451014-09122010"></span></font><font face="Arial" size="2"><font color="#a31515" size="2"><font color="#a31515" size="2"></font></font><font color="#a31515" size="2"><font color="#a31515" size="2"><font color="#000000"></font> </div>
</font></font></font>
<div><font face="Courier" size="2">void CGeoLoc::ConvertDeltaToLatLon(int nr, double *x, double *y)<br>
{<br>
double tx = m_geoX, <br>
ty = m_geoY;</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2"> OGRSpatialReference out, in;<br>
OGRCoordinateTransformation *trans;<br>
OGRErr ogrErr;<br>
<br>
ogrErr = out.importFromEPSG(4326);</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2"> double xref = m_geoX, yref = m_geoY;<br>
if (m_geoSystem != GS_MERCATOR)<br>
{<br>
ogrErr = in.importFromEPSG(3857);<br>
trans = OGRCreateCoordinateTransformation(&m_spatialRef, &in);</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2"> if( trans == NULL || !trans->Transform(1, &xref, &yref))<br>
AfxMessageBox("Transform of point failed." );<br>
}</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2"> for (int i=0; i < nr; i++)<br>
{<br>
x[i] += xref;<br>
y[i] += yref;<br>
}<br>
<br>
trans = OGRCreateCoordinateTransformation(&in, &out);<br>
if( trans == NULL || !trans->Transform(nr, x, y))<br>
AfxMessageBox("Transform of point failed." );<br>
}</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span class="097451014-09122010">My code builds perfectly and also runs, so no issues there, but unfortunately the importFromEPSG fails in finding my geocoordinate systems and returns ogrErr = 6. What am
I doing wrong? Or what do I need to add to get my application to work with gdal?</span></span></div>
<div><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span class="097451014-09122010"></span></span> </div>
<div><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span class="097451014-09122010">The code did work with the FWtools version (which I didn't like due to the large amount of used DLL's for functions I don't need. So I would really like to use the gdal
build only. </span></span></div>
<div><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span class="097451014-09122010"></span></span> </div>
<div><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span class="097451014-09122010">Kind regards,</span></span></div>
<div><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span class="097451014-09122010">Pim</span></span></div>
<font face="monospace">This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html</font></body>
</html>