<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=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-AU;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-AU link=blue vlink=purple><div class=WordSection1><div><div><div><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'>I have received many useful suggestions, but I am still struggling with what should be a simple problem. I am trying to translate a series of lat/lon coordinates in WGS84 coordinates to lat/lon coordinates for my map (AGD66). The code is below, and seems to mirror sample code in the GDAL tutorials. When I create the coordinate transform, I get error message “No PROJ.4 translation for source SRS, coordinate transformation initialization failed”.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'>PROJ.dll is in the right place, and GDAL_DATA and PROJ_LIB are correctly defined. I don’t think the error is here because when I put illegal parameters (e.g. EPSG:111111) it throws an exception.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'>I have noticed that when I add a projection to the SRS it seems to help, but I’m not up to that yet. All I want to do is transform from one datum to another (in code). Can anyone see the simple mistake I must be making?<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>Dim</span> WGS84SRS <span style='color:blue'>As</span> <span style='color:blue'>New</span> <span style='color:#2B91AF'>OGRSpatialReference</span> <span style='color:green'>' Coordinate system in WGS84</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>Dim</span> MapSRS <span style='color:blue'>As</span> <span style='color:blue'>New</span> <span style='color:#2B91AF'>OGRSpatialReference</span> <span style='color:green'>' Coordinate system of map</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>Dim</span> ctWGS84toMap <span style='color:blue'>As</span> <span style='color:blue'>New</span> <span style='color:#2B91AF'>OGRCoordinateTransformation</span> <span style='color:green'>' Coordinate transform from WGS84 to map</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>Dim</span> WGS84WKT <span style='color:blue'>As</span> <span style='color:blue'>String</span>, MapWKT <span style='color:blue'>As</span> <span style='color:blue'>String</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>With</span> WGS84SRS<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> GDALError = .SetProjCS(<span style='color:#A31515'>"WGS84 Datum"</span>)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#2B91AF'>Debug</span>.Assert(GDALError = <span style='color:#2B91AF'>OGRError</span>.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> GDALError = .SetWellKnownGeogCS(<span style='color:#A31515'>"WGS84"</span>) <span style='color:green'>' Define WGS84 coordinate system</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#2B91AF'>Debug</span>.Assert(GDALError = <span style='color:#2B91AF'>OGRError</span>.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> WGS84WKT = .ExportToWkt<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>End</span> <span style='color:blue'>With</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>With</span> MapSRS<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> GDALError = .SetProjCS(<span style='color:#A31515'>"Map Datum"</span>)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#2B91AF'>Debug</span>.Assert(GDALError = <span style='color:#2B91AF'>OGRError</span>.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> GDALError = .SetWellKnownGeogCS(<span style='color:#A31515'>"EPSG:4202"</span>) <span style='color:green'>' Australian Geodetic 1966</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#2B91AF'>Debug</span>.Assert(GDALError = <span style='color:#2B91AF'>OGRError</span>.OGRERR_NONE, GetLastErrorMsg())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> MapWKT = .ExportToWkt<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>End</span> <span style='color:blue'>With</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> ctWGS84toMap = <span style='color:#2B91AF'>GDAL</span>.CreateCoordinateTransformation(WGS84SRS, MapSRS) <span style='color:green'>' Create a coordinate transformation - WGS84 to map<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green;mso-fareast-language:EN-US'>WGS84WKT = "PROJCS["WGS84 Datum",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green;mso-fareast-language:EN-US'>UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AUTHORITY["EPSG","4326"]]]"<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green;mso-fareast-language:EN-US'>MapWKT = "PROJCS["Map Datum",GEOGCS["AGD66",DATUM["Australian_Geodetic_Datum_1966",SPHEROID["Australian National Spheroid",6378160,298.25,AUTHORITY["EPSG","7003"]],TOWGS84[-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29],AUTHORITY["EPSG","6202"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4202"]]]"<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>_______________________________________<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Marc Hillman, Melbourne, Australia<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a href="http://users.tpg.com.au/users/mhillman/">http://users.tpg.com.au/users/mhillman/</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>marc .hillman @ t p g . c o m . a u<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Eagles may soar, but weasels don't get sucked into jet engines.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Early bird gets the worm, but the second mouse gets the cheese.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>If Barbie is so popular, why do you have to buy her friends?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>All those who believe in psychokinesis, raise my hand.<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green;mso-fareast-language:EN-US'><o:p> </o:p></span></p></div></div></div></body></html>