<div dir="ltr">Start by checking whether your call to proj_create_crs_to_crs succeeds (i.e. whether it returns NULL or not, as also suggested in the PROJ documentation over at <a href="https://proj.org/development/quickstart.html">https://proj.org/development/quickstart.html</a>). And in general always check the return status of function calls, cf. e.g. <a href="https://proj.org/development/errorhandling.html">https://proj.org/development/errorhandling.html</a><div><div><br></div><div>If NULL is returned, your PROJ installation is probably not complete (lacking support files and/or setting of environment variables). In that case follow the tracks laid out in <a href="https://proj.org/resource_files.html">https://proj.org/resource_files.html</a></div><div><br></div><div>/Thomas<br><div><br></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den ons. 29. mar. 2023 kl. 12.43 skrev Ali Akram <<a href="mailto:devtoona@gmail.com">devtoona@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I want to use this to translate WSG84 to UMT and I am able to execute this command from terminal<br><span style="background-color:rgb(204,204,204)">echo 56 12 | cs2cs +init=epsg:4326 +to +init=epsg:25832</span> with output as <span style="background-color:rgb(204,204,204)">6231950.54 1920310.71 0.00</span> now trying to achieve it from c++ code and here is my way<br><br><span style="background-color:rgb(204,204,204)">PJ_CONTEXT *C;</span><br><span style="background-color:rgb(204,204,204)">PJ *P;<br>C = proj_context_create();</span><br><br><span style="background-color:rgb(204,204,204)">P = proj_create_crs_to_crs(C, "EPSG:4326", "EPSG:6677", NULL);<br>PJ_COORD input_coords, output_coords;<br>input_coords = proj_coord(56,12, 0, 0);<br>output_coords = proj_trans(P, PJ_FWD, input_coords);<br>std::string result = "";<br>result.append(std::to_string(output_coords.xy.x)+","+ std::to_string(output_coords.xy.y));<br>proj_destroy(P);<br>proj_context_destroy(C);</span><br><br><br>But it returns to me the same coordinates that I send in input i.e, 56,12 .</div><div>Kindly help thanks<br></div><div><br></div><div>Regards,</div><div>Ali</div></div>
_______________________________________________<br>
PROJ mailing list<br>
<a href="mailto:PROJ@lists.osgeo.org" target="_blank">PROJ@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
</blockquote></div>