diff options
| author | Didier Richard <didier.richard@ign.fr> | 2008-01-05 10:56:38 +0000 |
|---|---|---|
| committer | Didier Richard <didier.richard@ign.fr> | 2008-01-05 10:56:38 +0000 |
| commit | 8a5fea73e1ac646bfe2db7dee8358116fef28fba (patch) | |
| tree | 6413773f07e0d586c75db426eed99320ae392b51 /src | |
| parent | 7104a2afee4bb7f0a76da2d6d213fee5f13c5a34 (diff) | |
| download | PROJ-8a5fea73e1ac646bfe2db7dee8358116fef28fba.tar.gz PROJ-8a5fea73e1ac646bfe2db7dee8358116fef28fba.zip | |
Add eqr and gslabsgm
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1428 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.am | 4 | ||||
| -rw-r--r-- | src/PJ_eqr.c | 36 | ||||
| -rw-r--r-- | src/PJ_glabsgm.c | 44 | ||||
| -rw-r--r-- | src/makefile.vc | 6 | ||||
| -rw-r--r-- | src/pj_list.h | 2 |
5 files changed, 87 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index f17249f3..9d777211 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,7 @@ libproj_la_SOURCES = \ PJ_aea.c PJ_bipc.c PJ_bonne.c PJ_eqdc.c \ PJ_imw_p.c PJ_krovak.c PJ_lcc.c PJ_poly.c \ PJ_rpoly.c PJ_sconics.c proj_rouss.c \ - PJ_cass.c PJ_cc.c PJ_cea.c PJ_eqc.c \ + PJ_cass.c PJ_cc.c PJ_cea.c PJ_eqc.c PJ_eqr.c \ PJ_gall.c PJ_labrd.c PJ_lsat.c PJ_merc.c \ PJ_mill.c PJ_ocea.c PJ_omerc.c PJ_somerc.c \ PJ_tcc.c PJ_tcea.c PJ_tmerc.c \ @@ -40,7 +40,7 @@ libproj_la_SOURCES = \ PJ_wag7.c PJ_lcca.c PJ_geos.c \ PJ_boggs.c PJ_collg.c PJ_crast.c PJ_denoy.c \ PJ_eck1.c PJ_eck2.c PJ_eck3.c PJ_eck4.c \ - PJ_eck5.c PJ_fahey.c PJ_fouc_s.c PJ_gins8.c \ + PJ_eck5.c PJ_fahey.c PJ_fouc_s.c PJ_gins8.c PJ_glabsgm.c \ PJ_gn_sinu.c PJ_goode.c PJ_hatano.c PJ_loxim.c \ PJ_mbt_fps.c PJ_mbtfpp.c PJ_mbtfpq.c PJ_moll.c \ PJ_nell.c PJ_nell_h.c PJ_putp2.c PJ_putp3.c \ diff --git a/src/PJ_eqr.c b/src/PJ_eqr.c new file mode 100644 index 00000000..f984e83b --- /dev/null +++ b/src/PJ_eqr.c @@ -0,0 +1,36 @@ +#ifndef lint +static const char SCCSID[]="@(#)PJ_eqr.c 4.5 07/07/18 ??? ???"; +#endif +#define PROJ_PARMS__ \ + double rc; + +#define PJ_LIB__ +# include <projects.h> +PROJ_HEAD(eqr, "Equidistant Cylindrical (Generalized)") + "\n\tCyl, Sph\n\tk_0= lat_ts="; +FORWARD(s_forward); /* spheroid */ + xy.x = P->rc * lp.lam * P->k0 * P->ra; + xy.y = (lp.phi - P->phi0) * P->k0 * P->ra; + return (xy); +} +INVERSE(s_inverse); /* spheroid */ + lp.lam = (xy.x * P->a) / (P->k0 * P->rc); + lp.phi = ((xy.y * P->a) / P->k0) + P->phi0; + return (lp); +} +FREEUP; if (P) pj_dalloc(P); } +ENTRY0(eqr) + /* DGR, 2007-08-29 : due to Geoconcept bad implementation */ + /* phi0 no longer use lat_ts ! */ + if ((P->rc = cos(pj_param(P->params, "rlat_ts").f)) <= 0.) E_ERROR(-24); + P->inv = s_inverse; + P->fwd = s_forward; +#if 0 + /* + * if set to 0. the computation is being made on a sphere! + * We simply approximate this as the projection is only + * used for displaying + */ + P->es = 0.; +#endif +ENDENTRY(P) diff --git a/src/PJ_glabsgm.c b/src/PJ_glabsgm.c new file mode 100644 index 00000000..d094239c --- /dev/null +++ b/src/PJ_glabsgm.c @@ -0,0 +1,44 @@ +#ifndef lint +static const char SCCSID[]="@(#)PJ_glabsgm.c 4.5 07/09/24 ??? ???"; +#endif +#define PROJ_PARMS__ \ + double lamc;\ + double phic;\ + double c;\ + double n1;\ + double n2; + +#define PJ_LIB__ +# include <projects.h> +PROJ_HEAD(glabsgm, "Gauss Laborde (Sphere Geometric Mean)") + "\n\tCyl, Sph&Ell\n\tlat_0= lon_0= k_0="; +FORWARD(s_forward); /* spheroid */ + double L, Ls, sinLs1, Ls1; + L= P->n1*lp.lam; + Ls= P->c+P->n1*log(pj_tsfn(-1.0*lp.phi,-1.0*sin(lp.phi),P->e)); + sinLs1= sin(L)/cosh(Ls); + Ls1= log(pj_tsfn(-1.0*asin(sinLs1),0.0,0.0)); + xy.x= P->n2*P->ra*Ls1; + xy.y= P->n2*P->ra*atan(sinh(Ls)/cos(L)); + return (xy); +} +INVERSE(s_inverse); /* spheroid */ + double L, LC, sinC; + L= atan(sinh(xy.x*P->a/P->n2)/cos(xy.y*P->a/P->n2)); + sinC= sin(xy.y*P->a/P->n2)/cosh(xy.x*P->a/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); + return (lp); +} +FREEUP; if (P) pj_dalloc(P); } +ENTRY0(glabsgm) + 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->y0-= P->n2*P->phic; + P->inv= s_inverse; + P->fwd= s_forward; +ENDENTRY(P) diff --git a/src/makefile.vc b/src/makefile.vc index 6c8723a7..9614bcab 100644 --- a/src/makefile.vc +++ b/src/makefile.vc @@ -23,7 +23,7 @@ EXE_PROJ = proj_i.lib # Set the version number for the DLL. Normally we leave this blank since # we want software that is dynamically loading the DLL to have no problem # with version numbers. -VERSION=_fw +VERSION= azimuthal = \ PJ_aeqd.obj PJ_gnom.obj PJ_laea.obj PJ_mod_ster.obj \ @@ -36,10 +36,10 @@ conic = \ PJ_rpoly.obj PJ_sconics.obj PJ_lcca.obj cylinder = \ - PJ_cass.obj PJ_cc.obj PJ_cea.obj PJ_eqc.obj \ + PJ_cass.obj PJ_cc.obj PJ_cea.obj PJ_eqc.obj PJ_eqr.obj \ PJ_gall.obj PJ_labrd.obj PJ_lsat.obj PJ_merc.obj \ PJ_mill.obj PJ_ocea.obj PJ_omerc.obj PJ_somerc.obj \ - PJ_tcc.obj PJ_tcea.obj PJ_tmerc.obj PJ_geos.obj + PJ_tcc.obj PJ_tcea.obj PJ_tmerc.obj PJ_geos.obj PJ_glabsgm.obj misc = \ PJ_airy.obj PJ_aitoff.obj PJ_august.obj PJ_bacon.obj \ diff --git a/src/pj_list.h b/src/pj_list.h index e3eb3726..64ae4a34 100644 --- a/src/pj_list.h +++ b/src/pj_list.h @@ -30,6 +30,7 @@ PROJ_HEAD(eck4, "Eckert IV") PROJ_HEAD(eck5, "Eckert V") PROJ_HEAD(eck6, "Eckert VI") PROJ_HEAD(eqc, "Equidistant Cylindrical (Plate Caree)") +PROJ_HEAD(eqr, "Equidistant Cylindrical (Generalized)") PROJ_HEAD(eqdc, "Equidistant Conic") PROJ_HEAD(euler, "Euler") PROJ_HEAD(fahey, "Fahey") @@ -39,6 +40,7 @@ PROJ_HEAD(gall, "Gall (Gall Stereographic)") PROJ_HEAD(geocent, "Geocentric") PROJ_HEAD(geos, "Geostationary Satellite View") PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") +PROJ_HEAD(glabsgm, "Gauss Laborde (Sphere Geometric Mean)") PROJ_HEAD(gn_sinu, "General Sinusoidal Series") PROJ_HEAD(gnom, "Gnomonic") PROJ_HEAD(goode, "Goode Homolosine") |
