<div>Hi,</div><div><br></div><div>With my independent software, using the EPSG Guidance Note 7-2 formulae, I arrive for this problem at a difference of 9.3e-10 m in the easting and 1.7e-9 m in the northing for the first round-trip calculation.</div><div><br></div><div>Thirty years ago I would expect that with an accuracy of merely around 1e-7 someone could have calculated things with single instead of double precision.<br>Nowadays I could expect fewer iteration steps or a looser iteration stopping criterion, or accuracy problems with transcendental functions (sin, cos, atan, log etc.), which are not part of PROJ.</div><div><br></div><div>Greetings,</div><div>Oscar van Vlijmen</div><div><br></div><br><blockquote style="margin-right: 0px; margin-left:15px;">----Origineel Bericht----<br>Van : dmitrymefed@gmail.com<br>Datum : 31/10/2017 07:50<br>Aan : proj@lists.maptools.org<br>Onderwerp : Re: [Proj] Grown error if re-projecting from 4269 to LCC (2285) and backward multiple times<br><br><div dir="ltr">
<p class="MsoNormal"><span>Hi,</span></p>
<p class="MsoNormal"><span><br></span></p>
<p class="MsoNormal"><span>Our software stores the data with EPSG 4269 and present to the User in a local projected CRS, EPSG 2285 in examples described below. In case if an entity is modified on the UI we need to push the changes back. In that scenario we have to do </span></p>
<p class="gmail-m_-5491966359676502627gmail-MsoListParagraphCxSpFirst"><span><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span>4269 -> 2285 projection, </span></p>
<p class="gmail-m_-5491966359676502627gmail-MsoListParagraphCxSpMiddle"><span><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span>then User modifies the entity (in 2285 CRS), </span></p>
<p class="gmail-m_-5491966359676502627gmail-MsoListParagraphCxSpMiddle"><span><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span>In order to store the changes, we do 2285 -> 4269 projection </span></p>
<p class="gmail-m_-5491966359676502627gmail-MsoListParagraphCxSpLast"><span><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span>and next time the entity is requested we do 4269 -> 2285 projection again.</span></p>
<p class="MsoNormal"><span>The problem is that proj4 does not produce same results in step 2 and 4. It would be expected behavior as 2285 provides more precision due to used units US-ft, in comparison to 4269 which units are degrees. But the real issue for us is that subsequent transformations between 2285 -> 4269 -> 2285… produces growing error. Please consider the following output of cs2cs program, (in parallel I did inverse projection to obtain coordinates in EPSG 4269):</span></p>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">C:\PROJ\bin>cs2cs.exe -v +init=epsg:2285 +to +init=epsg:4269 -f %.16f</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">pj_open_lib(epsg): call fopen(C:\proj\share\epsg) - succeeded</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"> </span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">pj_open_lib(epsg): call fopen(C:\proj\share\epsg) - succeeded</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"> </span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"># ---- From Coordinate System ----</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">#Lambert Conformal Conic</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">#<span> </span>Conic, Sph&Ell</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">#<span> </span>lat_1= and lat_2= or lat_0</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"># +init=epsg:2285 +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"># +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +datum=NAD83</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"># +units=us-ft +no_defs +ellps=GRS80 +towgs84=0,0,0</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"># ---- To Coordinate System ----</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">#Lat/long (Geodetic alias)</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">#</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"># +init=epsg:4269 +proj=longlat +datum=NAD83 +no_defs +ellps=GRS80</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;"># +towgs84=0,0,0</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184066000 643350.39301622100</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309999860520 0.0000000000000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184067495000000<span>
<commented></commented> </span>643350.3930111383100000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309999721180 0.0000000000000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184069018000000<span>
<commented></commented> </span>643350.3930060574800000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309999581850 0.0000000000000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184070541000000<span>
<commented></commented> </span>643350.3930009742000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309999442440 0.0000000000000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184072063000000<span>
<commented></commented> </span>643350.3929958911600000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309999302960 0.0000000000000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184073586000000<span>
<commented></commented> </span>643350.3929908055600000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309999163550 0.0000000000000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184075109000000<span>
<commented></commented> </span>643350.3929857177400000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309999023930 0.0000000000000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">2196293.3184076636000000<span>
<commented></commented> </span>643350.3929806276000000</span></font></p>
<font size="1"><span style="font-family: monospace , monospace;"></span></font>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><font size="1"><span style="font-family: monospace , monospace;">-118.5293900000000300<span> </span>48.7408309998884450 0.0000000000000000</span></font></p>
<p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><span style="font-family: Consolas;"> </span></p><p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><span style="font-family: Consolas;">ETC. ETC.</span></p><p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><span style="font-family: Consolas;"><br></span></p><p style="margin-bottom: 1.0E-4pt;line-height: normal;" class="MsoNormal"><br></p>
<p style="margin-bottom: 1.0E-4pt;" class="MsoNormal"><span>Thanks,</span></p>
<p style="margin-bottom: 1.0E-4pt;" class="MsoNormal"><span>-Dmitry Mefed</span></p>
</div><br></blockquote><br><p></p>