<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Courier New";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#1F497D">Did you compile gdal yourself, or use a pre-built package.&nbsp; It is also possible GDAL_DATA environment variable isn’t set.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#1F497D">kss<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> gdal-dev-bounces@lists.osgeo.org [mailto:gdal-dev-bounces@lists.osgeo.org]
<b>On Behalf Of </b>dev4cx4m9z@snkmail.com<br>
<b>Sent:</b> Tuesday, October 18, 2011 4:12 AM<br>
<b>To:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> RE: [gdal-dev] Confused about datum transformations<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">I’m not sure the code will help too much, but here are the relevant code fragments. I’m using a hand crafted VB.net wrapper which explains some of the syntax<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">Private WGS84SRS As New OGRSpatialReference&nbsp;&nbsp;&nbsp;&nbsp; ' Coordinate system in WGS84<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">Private MapSRS As OGRSpatialReference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Coordinate system of map<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">Private ctWGS84toMap As OGRCoordinateTransformation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Coordinate transform from WGS84 to map<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">With WGS84SRS<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp; GDALError = .SetProjCS(&quot;WGS84 Datum&quot;)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp; Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp; GDALError = .SetWellKnownGeogCS(&quot;WGS84&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Define WGS84 coordinate system<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp; Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">End With<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">With MapSRS<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp;&nbsp; GDALError = .SetProjCS(&quot;Map coordinate system&quot;)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp;&nbsp; Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp;&nbsp; GDALError = .ImportFromEPSG(3577)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">&nbsp;&nbsp;&nbsp;&nbsp; Debug.Assert(GDALError = OGRError.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">End With<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">ctWGS84toMap = GDAL.CreateCoordinateTransformation(WGS84SRS, MapSRS)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Create a coordinate transformation - WGS84 to map<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU">Debug.Assert(ctWGS84toMap IsNot Nothing, GetLastErrorMsg())<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-AU">Marc,<br>
<br>
Can you provide the code leading to the error?<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-AU">On Tue, Oct 18, 2011 at 1:21 PM, Marc Hillman &lt;<a href="mailto:dev4cx4m9z@snkmail.com">dev4cx4m9z@snkmail.com</a>&gt; wrote:<o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-AU">I have a GIS database, and all data is stored in WGS84 datum. I have developed an application using GDAL, and I now need to translate my WGS84 coordinates to
 several different datums, depending what map is loaded. I seem to be going around in circles, and need a nudge in the right direction. I am defining an OGRSpatialReference for each datum (WGS84 and current map) and then attempting to create an OGRCoordinateTransformation
 for the transformation.. This last step fails with a PROJ.4 error (“No PROJ.4 translation for destination SRS, coordinate transformation initialization failed”<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-AU">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-AU">My question is - Do I need PROJ.4 to do the translation? Can I not just use ImportFromWKT to define my OGRSpatialReference? If so, is there a nice canned list
 of all the WKT somewhere? &nbsp;I’m keen to avoid PROJ.4 if possible as I’m not sure I can build it.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-AU">&nbsp;<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-AU"><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-AU"><br>
<br clear="all">
<br>
-- <br>
Best regards,<br>
Chaitanya kumar CH.<br>
<br>
&#43;91-9494447584<br>
17.2416N 80.1426E<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-AU">No virus found in this message.<br>
Checked by AVG - <a href="http://www.avg.com">www.avg.com</a><br>
Version: 2012.0.1831 / Virus Database: 2092/4558 - Release Date: 10/17/11<o:p></o:p></span></p>
</div>
<br>This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited. If
you are not the intended recipient, please contact the sender by reply
email and delete the original message.
&nbsp;&nbsp;&shy;&shy;&nbsp;&nbsp;</body>
</html>