<div dir="ltr"><div><div>Hi<br></div>The differences in the UTM coordinates are smaller than 5 cm. This agrees with a rounding error in the 6th decimal place of the geographic coordinates. Your geographic coordinates are presented with 6 decimal places. If in some of the cases they are not actually rounded, the results will be different.<br></div><div>Regards<br><br></div><div>José<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-11 17:07 GMT+00:00 Adri CS <span dir="ltr">&lt;<a href="mailto:acsantome@gmail.com" target="_blank">acsantome@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>I built Proj4 4.8.0 for Windows with MinGW. I&#39;m trying to reproject some WGS84 lat/long coordinates (degrees) from Brazil to UTM Sirgas 2000. The UTM zone would be 23S.<br><br></div>**) Using the cs2cs app:<br><br></div><i>cs2cs.exe -f %.6f +init=epsg:3273 +proj=latlong +to +init=epsg:31938 input.txt &gt; output.txt</i><br><br></div>**The input file would contain coords like this: -45.491596     -23.570147 769.750000<br><br></div>And the output would be: 449834.145105    7393276.784821 769.750000<br><br>/***********************************************/<br><br></div>**) Using the api (I omit the error checking):<br><br></div><span style="color:rgb(192,192,192)">    </span><i>projPJ wgs = pj_init_plus(&quot;+init=epsg:32723 +proj=latlong&quot;);<br></i></div><i>projPJ sirgas = = pj_init_plus(&quot;+init=epsg:31983&quot;);<br></i></div><i>double lat = -45.491596;<br></i></div><i>double lon = -23.570147;<br>double alt = 769.750000;<br><br></i></div><div><i>lat *= DEG_TO_RAD;<br></i></div><div><i>lon *= DEG_TO_RAD;<br></i></div><i><br></i><div><div><div><div><div><div><div><i>pj_transform(wgs, sirgas, 1, 1, &amp;lon, &amp;lat, &amp;alt);</i><br><br></div><div>This outputs: 449834.127632      7393276.821296       769.750000<br><br></div><div>In both cases, the left part of the returned UTM easting and northing coordinates are the same, but the numbers after the decimal point are different.<br><br> I&#39;m only transforming the input lat/lon coordintates when using the 
api, since if I transform them before calling cs2cs, it will output wron
 coords (the easting will have 7 digits before the decimal points).<br><br></div><div>What&#39;s happening here? The only difference I can see it&#39;s the transformation of the lat/lon coordinates from degrees to radians: I&#39;m multypling directly while in the cs2cs source, there&#39;s a call to the <i>dmstor</i> function (which I can&#39;t call directly, it seems).<br></div><div><br></div><div>Thanks for your time &amp; cheers!<span class="HOEnZb"><font color="#888888"><br>Adri.<br></font></span></div></div></div></div></div></div></div></div>
<br>_______________________________________________<br>
Proj mailing list<br>
<a href="mailto:Proj@lists.maptools.org">Proj@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/proj" target="_blank">http://lists.maptools.org/mailman/listinfo/proj</a><br></blockquote></div><br></div>