[Proj] Proj-5.0.0 cct path to gridfiles

Kristian Evers kreve at sdfe.dk
Tue Feb 20 13:44:22 PST 2018


To wrap this up I’ve replicated your original cs2cs call with cct:

$ cat stevejking.sh
echo -3.5 55 0 | ./cs2cs -f %.4f +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs \
    +to +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy \
    +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb +geoidgrids=OSGM15_GTX_OSGBtoGRS80.gtx +units=m +no_defs


echo -3.5 55 0 | ./cct +proj=pipeline \
    +step +proj=hgridshift +grids=OSTN15_NTv2_OSGBtoETRS.gsb +inv \
    +step +proj=vgridshift +grids=OSGM15_GTX_OSGBtoGRS80.gtx \
    +step +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy

$ ./stevejking.sh
304146.0646	568298.2999 -53.2179
  304146.0646    568298.2999      -53.2179        0.0000

/Kristian


> On 20 Feb 2018, at 09:33, Kristian Evers <kreve at sdfe.dk> wrote:
> 
> Steve,
> 
> I haven't looked into why you have a problem, but I immediately notice that with the way you use cct, you might as well just use cs2cs. At least for this this transformation - I appreciate the interest in using the new tools though. So for the sake of demonstration I wanted to show how the "correct" way to do the transformation in question cct is:
> 
> You now have:
> 
> cs2cs +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +to +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb +geoidgrids=OSGM15_GTX_OSGBtoGRS80.gtx +units=m +no_defs
> 
> which you then try to replicate with ctt:
> 
> cct -t0 +proj=pipeline +step +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +inv +step +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb +geoidgrids=OSGM15_GTX_OSGBtoGRS80.gtx +units=m +no_defs
> 
> There's a few things that can be simplified.
> 
> 1. you don't need the first +proj=longlat (remember, we are not describing the input and output, but the recipe to go from input to output)
> 2. The +no_defs are unnecessary unless you use aea, lcc or the lagrng projections.
> 3. the +nadgrids and +geoidgrids are now considered deprecated - instead +proj=hgridshift and +proj=vgridshift should be used as individual steps in a pipeline
> 
> So with that in mind, here's how I would set up the transformation with cct:
> 
> Cct -t0 +proj=pipeline +step +proj=hgridshift +grids=OSTN15_NTv2_OSGBtoETRS.gsb \
>                                        +step +proj=vgridshift +grids=OSGM15_GTX_OSGBtoGRS80.gtx \
>                                        +step +proj=tmerc ++lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy
> 
> So first I ignore the input system you originally defined since it is basically a no-op using +proj=latlong. Afther that I define two steps that handle the datumshift by means of horizontal and vertical grids. In the last step I apply the transverse Mercator projection.
> 
> I hope this gives a better understanding of the differences between the two approaches to transformations in PROJ.
> 
> /Kristian
> 
> Ps. The above is untested - it might contain some errors but the general idea should be clear I think.
> 
> -----Oprindelig meddelelse-----
> Fra: proj-bounces at lists.maptools.org [mailto:proj-bounces at lists.maptools.org] På vegne af stevejking
> Sendt: 20. februar 2018 08:48
> Til: proj at lists.maptools.org
> Emne: Re: [Proj] Proj-5.0.0 cct path to gridfiles
> 
> Hi Thomas & Kristian,
> Thanks for the replies.
> 
> Yes, setting PROJ-LIB works as a temporary fix.
> 
> I've uploaded the cs2cs and cct strings, grid files and a couple of
> coordinate pairs. In a bit of a hurry this morning.
> https://1drv.ms/f/s!AvBQ7Pt73oO6iGeGDh4livK-EKAJ Hope that helps.
> 
> The cs2cs one works fine, the cct one has the above error, but works if the
> full path to gridfiles is given. 
> 
> Steve
> 
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/PROJ-4-f3840930.html
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj



More information about the Proj mailing list