aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Richard <didier.richard@ign.fr>2009-03-08 14:03:40 +0000
committerDidier Richard <didier.richard@ign.fr>2009-03-08 14:03:40 +0000
commit9a8c6fbca28f95bff0ff1bfa0326071cf8ff084d (patch)
treeb452a37dae30cf09b8bf397bb962a434e02b46a3
parentd8a8b076280d228f25f595a41c0b079e290f4b6e (diff)
downloadPROJ-9a8c6fbca28f95bff0ff1bfa0326071cf8ff084d.tar.gz
PROJ-9a8c6fbca28f95bff0ff1bfa0326071cf8ff084d.zip
Correction of inverse function in gstmerc : point of projected origin was descaled.
Comments added in testIGNF header (reminder) : null grid is mandatory, otherwise tests failed. Adding logs to ChangeLog. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1540 4e78687f-474d-0410-85f9-8d5e500ac6b2
-rw-r--r--ChangeLog10
-rwxr-xr-xnad/testIGNF3
-rw-r--r--src/PJ_gstmerc.c12
3 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c9cf86a6..f781aeec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-03-08 IGNF <didier.richard@ign.fr>
+
+ * src/PJ_gstmerc.c: Correction of a bug in inv() function :
+ the projected origin coordinates where descaled.
+
+ * nad/testIGNF: Add a comment on the mandatory existance of the world grid
+ in order to make the test.
+
+ * ChangeLog: this comments
+
2009-01-26 Frank Warmerdam <warmerdam@pobox.com>
* src/*.c: Remove SCCSID and lint stuff from all source files.
diff --git a/nad/testIGNF b/nad/testIGNF
index 1e451871..ec782eb6 100755
--- a/nad/testIGNF
+++ b/nad/testIGNF
@@ -5,6 +5,9 @@
# Real points locations are found in proj_outIGNF.dist-real
# while distribution results are found in proj_outIGNF.dist
#
+# 2009-03-08 : the null grid (nad2bin < null.lla null) MUST
+# be around otherwise the LAMBE to LAMB93
+# transformations will be wrong and vice-versa
EXE=$1
usage()
diff --git a/src/PJ_gstmerc.c b/src/PJ_gstmerc.c
index bd01f8cf..23b86ee8 100644
--- a/src/PJ_gstmerc.c
+++ b/src/PJ_gstmerc.c
@@ -19,26 +19,30 @@ FORWARD(s_forward); /* spheroid */
Ls1= log(pj_tsfn(-1.0*asin(sinLs1),0.0,0.0));
xy.x= (P->XS + P->n2*Ls1)*P->ra;
xy.y= (P->YS + P->n2*atan(sinh(Ls)/cos(L)))*P->ra;
+ /*fprintf(stderr,"fwd:\nL =%16.13f\nLs =%16.13f\nLs1 =%16.13f\nLP(%16.13f,%16.13f)=XY(%16.4f,%16.4f)\n",L,Ls,Ls1,lp.lam+P->lam0,lp.phi,(xy.x*P->a + P->x0)*P->to_meter,(xy.y*P->a + P->y0)*P->to_meter);*/
return (xy);
}
INVERSE(s_inverse); /* spheroid */
double L, LC, sinC;
- L= atan(sinh((xy.x - P->XS)*P->a/P->n2)/cos((xy.y - P->YS)*P->a/P->n2));
- sinC= sin((xy.y - P->YS)*P->a/P->n2)/cosh((xy.x - P->XS)*P->a/P->n2);
+ L= atan(sinh((xy.x*P->a - P->XS)/P->n2)/cos((xy.y*P->a - P->YS)/P->n2));
+ sinC= sin((xy.y*P->a - P->YS)/P->n2)/cosh((xy.x*P->a - P->XS)/P->n2);
LC= log(pj_tsfn(-1.0*asin(sinC),0.0,0.0));
lp.lam= L/P->n1;
lp.phi= -1.0*pj_phi2(exp((LC-P->c)/P->n1),P->e);
+ /*fprintf(stderr,"inv:\nL =%16.13f\nsinC =%16.13f\nLC =%16.13f\nXY(%16.4f,%16.4f)=LP(%16.13f,%16.13f)\n",L,sinC,LC,((xy.x/P->ra)+P->x0)/P->to_meter,((xy.y/P->ra)+P->y0)/P->to_meter,lp.lam+P->lam0,lp.phi);*/
return (lp);
}
FREEUP; if (P) pj_dalloc(P); }
ENTRY0(gstmerc)
+ P->lamc= P->lam0;
P->n1= sqrt(1.0+P->es*pow(cos(P->phi0),4.0)/(1.0-P->es));
P->phic= asin(sin(P->phi0)/P->n1);
P->c= log(pj_tsfn(-1.0*P->phic,0.0,0.0))
-P->n1*log(pj_tsfn(-1.0*P->phi0,-1.0*sin(P->phi0),P->e));
P->n2= P->k0*P->a*sqrt(1.0-P->es)/(1.0-P->es*sin(P->phi0)*sin(P->phi0));
- P->XS= 0;
- P->YS= -1.0*P->n2*P->phic;
+ P->XS= 0;/* -P->x0 */
+ P->YS= -1.0*P->n2*P->phic;/* -P->y0 */
P->inv= s_inverse;
P->fwd= s_forward;
+ /*fprintf(stderr,"a (m) =%16.4f\ne =%16.13f\nl0(rad)=%16.13f\np0(rad)=%16.13f\nk0 =%16.4f\nX0 (m)=%16.4f\nY0 (m)=%16.4f\n\nlC(rad)=%16.13f\npC(rad)=%16.13f\nc =%16.13f\nn1 =%16.13f\nn2 (m) =%16.4f\nXS (m) =%16.4f\nYS (m) =%16.4f\n", P->a, P->e, P->lam0, P->phi0, P->k0, P->x0, P->y0, P->lamc, P->phic, P->c, P->n1, P->n2, P->XS +P->x0, P->YS + P->y0);*/
ENDENTRY(P)