<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 15 (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:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
{font-family:Menlo;
panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.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>
</head>
<body lang="en-PK" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:#0D1117"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#E4E8EC;mso-fareast-language:EN-GB">I want to use this to translate WSG84 to UMT and I am able to execute this command
from terminal<br>
echo 56 12 | cs2cs +init=epsg:4326 +to +init=epsg:25832 with output as 6231950.54 1920310.71 0.00 now trying to achieve it from c++ code and here is my way<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">PJ_CONTEXT *C;<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">PJ *P;<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">C = proj_context_create();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">P = proj_create_crs_to_crs(C, "EPSG:4326", "EPSG:6677", NULL);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">PJ_COORD input_coords, output_coords;<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">input_coords = proj_coord(56,12, 0, 0);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">output_coords = proj_trans(P, PJ_FWD, input_coords);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">std::string result = "";<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">result.append(std::to_string(output_coords.xy.x)+","+ std::to_string(output_coords.xy.y));<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">proj_destroy(P);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">proj_context_destroy(C);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#0D1117"><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:EN-GB">But it return to me same coordinates what i send in input i.e, 56,12. Kindly help
thanks</span><span style="font-size:9.0pt;font-family:Menlo;color:#E4E8EC;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>