[Proj] Grown error if re-projecting from 4269 to LCC (2285) and backward multiple times

vanadovv at hetnet.nl vanadovv at hetnet.nl
Wed Nov 1 04:29:13 PDT 2017


Hi Thomas,
LCCA: good suggestion!
As far as I can tell, there are two significant differences between LCC and LCCA.
LCC has an iteration loop criterion (in the inverse) of 1e-10, whereas LCCA is somewhat more accurate with 1e-12.
Furthermore LCCA works with a Newton iteration scheme. This could be faster than iteration by successive approximation, but there are a couple of minor inefficiencies in the code, like function calls instead of inline, but YMMV.
Oscar van Vlijmen
----Origineel Bericht----
Van : knudsen.thomas at gmail.com
Datum : 01/11/2017 07:58
Aan : vanadovv at hetnet.nl, proj at lists.maptools.org
Onderwerp : Re: [Proj] Grown error if re-projecting from 4269 to LCC (2285) and backward multiple times
 Oscar,
 
  
 
 
  I certainly agree that the deviation is quite high - my comment was more related
 
 
  to the expection of exact roundtrips, which I find unrealistic.
 
 
  
 
 
  Nevertheless, looking into the PROJ.4 code, I see there is an alternative
 
 
  implementation of LCC, called LCCA, which I had forgotten about, which
 
 
  actually seems to roundtrip exactly.
 
 
  
 
 
  In the master branch of PROJ.4, over at 
  https://github.com/OSGeo/proj.4,
 
 
  and comming in the next release, there is a tool "gie" for doing (a.o.)
 
 
  roundtrip tests. It is still lacking in docs, but I think you can follow this example:
 
 
  
 
 
  With this input file:
 
 
  
 
 
  $ cat lcc-lcca.gie
 
 
  
 
 
  
   BEGIN
  
  
   
  
  
   -------------------------------------------------------------------------------
  
  
   operation +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 \
  
  
                       +lat_0=47  +lon_0=-120.8333333333333 \
  
  
                       +x_0=500000.0001016001 +y_0=0        \
  
  
                       +units=us-ft +ellps=GRS80 +towgs84=0,0,0  +no_defs
  
  
   -------------------------------------------------------------------------------
  
  
   tolerance   0.0010 mm
  
  
   accept     -118.5293900000000300   48.7408309999860520
  
  
   roundtrip   1000
  
  
   
  
  
   
  
  
   -------------------------------------------------------------------------------
  
  
   operation +proj=lcca +lat_1=48.73333333333333 +lat_2=47.5 \
  
  
                        +lat_0=47  +lon_0=-120.8333333333333 \
  
  
                        +x_0=500000.0001016001 +y_0=0        \
  
  
                        +units=us-ft +ellps=GRS80 +towgs84=0,0,0  +no_defs
  
  
   -------------------------------------------------------------------------------
  
  
   tolerance   0.0 mm
  
  
   accept     -118.5293900000000300   48.7408309999860520
  
  
   roundtrip   1000
  
  
   END
  
 
 
  
 
 
  I get this output:
 
 
  
 
 
  $ gie lcc-lcca.gie
 
 
  
   
  
  
   -------------------------------------------------------------------------------
  
  
   Reading file '..\..\..\proj\lcc-lcca.gie'
  
  
   -------------------------------------------------------------------------------
  
  
   +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47  +lon_0=-120....
  
  
   -------------------------------------------------------------------------------
  
  
        FAILURE in lcc-lcca.gie(11):
  
  
        roundtrip deviation: 1.550 mm, expected: 0.001 mm
  
  
   -------------------------------------------------------------------------------
  
  
   total:  1 tests succeeded,   1 tests FAILED!
  
  
   -------------------------------------------------------------------------------
  
 
 
  
 
 
  i.e. lcca roundtrips exactly, while lcc diverges heavily.
 
 
  
 
 
  So Dmitry: This seems to be your workaround - define your projection using lcca,
 
 
  rather than letting the epsg-list select lcc for you.
 
 
  
 
 
  /Thomas
 
 
  
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20171101/1d5e8dc6/attachment.html>


More information about the Proj mailing list