[PROJ] Performance of proj_create_crs_to_crs()

Even Rouault even.rouault at spatialys.com
Tue Feb 19 02:35:13 PST 2019


On lundi 18 février 2019 19:57:10 CET Greg Troxel wrote:
> Even Rouault <even.rouault at spatialys.com> writes:
> > The reason is that the NAD27 <-> NAD83 conversion has several dozains of
> > potential paths (one per US state), and PROJ explore them.
> 
> (understood about not using WGS84 as an intermediate being the real
> issue)
> 
> I am curious about the "one per state" comment.  I realize NAD27 is
> complicated, but I would think that if there are NAD27-NAD83 transforms
> that are valid for a state (because of a local model, or maybe because
> there is some NAD83 HARN that is specific for the state, but I'd think
> that's a different CRS codepoint), that there would be some process to
> only use them in their region of validity.  But the basic pipeline
> request is just SRIDs and not region (which is as I expect it).
> 
> Can you elaborate?  Or is it just that there are multiple intermediate
> datums, but really these all end being the same?

OK, I was indeed a bit approximative in my answer.

There are "just" 6 transformations registered in the EPSG database between 
NAD27 and NAD83 using different grids (conus, ntv1, ntv2, etc...)

But before my change, the code that lists datum transformations also did a 
self-join to find all CRS X for which we have NAD27 --> X and X --> NAD83 
transformations. For X == WGS84, you have 85 NAD27 -> WGS84 transformations. A 
lot of them are actually registered in the EPSG database as concatenated 
transformations from NAD27 to NAD83 and NAD83 to WGS84 (the NAD83 to WGS84 
transformations are actually duplicate of the same operations doing NAD83 to 
NAD83(HARN) as you rightly mentionned). So in the end, you had (NAD27 -> NAD83 
-> X=WGS84) -> NAD83. The code eventually realized that there was a NAD83-
>WGS84->NAD83 useless roundtrip and simplified all the results, but there was 
of course significant processing time in doing all those lookups and 
filtering.

In the case of EPSG:3005 which is a projected CRS with "Canada - British 
Columbia" area of use, the research space of datum transformation can be 
restricted, but currently the spatial testing is done quite late in the 
process in code, and not at the SQL level.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list