[PROJ] Calculating meridian convergence
Thomas Knudsen
knudsen.thomas at gmail.com
Wed Jun 1 04:09:44 PDT 2022
Hello Roger,
If you use the "proj" command line application, you get the expected value:
$ echo 13.100962 55.600783 | proj -V +proj=tmerc +lon_0=15 +k_0=0.9996
+x_0=500000
#Transverse Mercator
# Cyl, Sph&Ell
# approx
# +proj=tmerc +lon_0=15 +k_0=0.9996 +x_0=500000 +break_cs2cs_recursion
# +ellps=GRS80
#Final Earth figure: ellipsoid
# Major axis (a): 6378137.000
# 1/flattening: 298.257222
# squared eccentricity: 0.006694380023
Longitude: 13d6'3.463"E [ 13.100962 ]
Latitude: 55d36'2.819"N [ 55.600783 ]
Easting (x): 380351.08
Northing (y): 6163285.60
Meridian scale (h) : 0.99977560 ( -0.02244 % error )
Parallel scale (k) : 0.99977560 ( -0.02244 % error )
Areal scale (s): 0.99955126 ( -0.04487 % error )
Angular distortion (w): 0.000
Meridian/Parallel angle: 90.00000
Convergence : -1d34'1.635" [ -1.56712087 ]
Max-min (Tissot axis a-b) scale error: 0.99978 0.99978
The differing results from your code may be a matter of your PR
instantiation leading to taking the code branch in
https://github.com/OSGeo/PROJ/blob/ced8793aa170dd4792f331633e62726808a2e75d/src/4D_api.cpp#L2469
Could you try to instantiate a plain, classic PROJ PJ using
proj_create("proj=tmerc lon_0=15 k_0=0.9996 x_0=500000 ellps=GRS80"),
then calling proj_factors with that as input. It should send you through
the code branch at
https://github.com/OSGeo/PROJ/blob/ced8793aa170dd4792f331633e62726808a2e75d/src/4D_api.cpp#L2499
which may (or may not) give you the result you expect.
If it doesn't, please file a ticket over at
https://github.com/OSGeo/PROJ/issues
/Thomas
Den ons. 1. jun. 2022 kl. 11.49 skrev Roger Oberholtzer <
roger.oberholtzer at gmail.com>:
> I am trying to determine the meridian convergence for a point. The
> projection is defined as:
>
> PJ *proj = proj_normalize_for_visualization(0,
> proj_create_crs_to_crs(0, "EPSG:4326", "EPSG:3006", 0));
>
> The source lat/longs are wgs84 from a GPS receiver. The projection is
> Sweref99. That is working just fine. In my case, the LONG/LAT are in
> degrees.
>
> PJ_COORD ivals, vals;
> vals.xyz.x = LONG;
> vals.xyz.y = LAT;
> vals.xyz.z = HEIGHT;
> ivals = proj_trans(tinfo->Proj, PJ_FWD, vals);
>
> So far, so good.
>
> I need to do some rotations of the projected points. Towards that end,
> I would like to determine the meridian convergence. I am expecting to
> use this as a correction to a yaw value that my GPS receiver also
> provides via an integrated IMU.
>
> PJ_FACTORS factors;
>
> vals.lp.lam = proj_torad(LONG);
> vals.lp.phi = proj_torad(LAT);
>
> factors = proj_factors(tinfo->Proj, vals);
>
> I must be doing something incorrectly, as I get similar results for
> data from different locations. Or I am missing a step. Or I am just
> doing something totally wrong.
>
> Data from west of the Sweref99 central meridian (convergence should be
> -1.56713° according to the Swedish authority):
>
> LAT 55.600783
> LONG 13.100962
> ALT 13.463000
> E 380351.081178
> N 6163285.609844
> angular_distortion 0.567652
> meridian_parallel_angle 1.570796
> meridian_convergence -0.004468
>
> Data from east of the Sweref99 central meridian (convergence should be
> 0.40007° according to the Swedish authority):
>
> LAT 58.618118
> LONG 15.468616
> ALT 79.686000
> E 527220.410693
> N 6497625.569591
> angular_distortion 0.645715
> meridian_parallel_angle 1.570796
> meridian_convergence -0.004696
>
> angular_distortion, meridian_parallel_angle, and meridian_convergence
> are the values returned by proj_factors().
>
> This is with proj 8.2.1 on Linux. It is generally working fine. It's just
> this.
>
> Any pointers would be greatly appreciated.
>
> --
> Roger Oberholtzer
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20220601/ded7165a/attachment.htm>
More information about the PROJ
mailing list