[Proj] Proj-5.0.0 cct path to gridfiles
kreve at sdfe.dk
Tue Feb 20 03:33:16 EST 2018
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.
Ps. The above is untested - it might contain some errors but the general idea should be clear I think.
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.
Sent from: http://osgeo-org.1560.x6.nabble.com/PROJ-4-f3840930.html
Proj mailing list
Proj at lists.maptools.org
More information about the Proj