当前位置: 首页>>代码示例>>C++>>正文


C++ pj_param函数代码示例

本文整理汇总了C++中pj_param函数的典型用法代码示例。如果您正苦于以下问题:C++ pj_param函数的具体用法?C++ pj_param怎么用?C++ pj_param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pj_param函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pj_calloc

PJ *PROJECTION(rhealpix) {
    struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
    if (0==Q)
        return freeup_new (P);
    P->opaque = Q;

    Q->north_square = pj_param(P->ctx, P->params,"inorth_square").i;
    Q->south_square = pj_param(P->ctx, P->params,"isouth_square").i;

    /* Check for valid north_square and south_square inputs. */
    if (Q->north_square < 0 || Q->north_square > 3) {
        E_ERROR(-47);
    }
    if (Q->south_square < 0 || Q->south_square > 3) {
        E_ERROR(-47);
    }
    if (P->es) {
        Q->apa = pj_authset(P->es); /* For auth_lat(). */
        Q->qp = pj_qsfn(1.0, P->e, P->one_es); /* For auth_lat(). */
        P->a = P->a*sqrt(0.5*Q->qp); /* Set P->a to authalic radius. */
        P->ra = 1.0/P->a;
        P->fwd = e_rhealpix_forward;
        P->inv = e_rhealpix_inverse;
    } else {
        P->fwd = s_rhealpix_forward;
        P->inv = s_rhealpix_inverse;
    }

    return P;
}
开发者ID:Maasik,项目名称:proj.4,代码行数:30,代码来源:PJ_healpix.c

示例2: setup_eqdc

 void setup_eqdc(Parameters& par, par_eqdc& proj_parm)
 {
     double cosphi, sinphi;
     int secant;
     proj_parm.phi1 = pj_param(par.params, "rlat_1").f;
     proj_parm.phi2 = pj_param(par.params, "rlat_2").f;
     if (fabs(proj_parm.phi1 + proj_parm.phi2) < EPS10) throw proj_exception(-21);
         pj_enfn(par.es, proj_parm.en);
 
     proj_parm.n = sinphi = sin(proj_parm.phi1);
     cosphi = cos(proj_parm.phi1);
     secant = fabs(proj_parm.phi1 - proj_parm.phi2) >= EPS10;
     if( (proj_parm.ellips = (par.es > 0.)) ) {
         double ml1, m1;
         m1 = pj_msfn(sinphi, cosphi, par.es);
         ml1 = pj_mlfn(proj_parm.phi1, sinphi, cosphi, proj_parm.en);
         if (secant) { /* secant cone */
             sinphi = sin(proj_parm.phi2);
             cosphi = cos(proj_parm.phi2);
             proj_parm.n = (m1 - pj_msfn(sinphi, cosphi, par.es)) /
                 (pj_mlfn(proj_parm.phi2, sinphi, cosphi, proj_parm.en) - ml1);
         }
         proj_parm.c = ml1 + m1 / proj_parm.n;
         proj_parm.rho0 = proj_parm.c - pj_mlfn(par.phi0, sin(par.phi0),
             cos(par.phi0), proj_parm.en);
     } else {
         if (secant)
             proj_parm.n = (cosphi - cos(proj_parm.phi2)) / (proj_parm.phi2 - proj_parm.phi1);
         proj_parm.c = proj_parm.phi1 + cos(proj_parm.phi1) / proj_parm.n;
         proj_parm.rho0 = proj_parm.c - par.phi0;
     }
     // par.inv = e_inverse;
     // par.fwd = e_forward;
     // par.spc = fac;
 }
开发者ID:4x4falcon,项目名称:fosm-merkaartor,代码行数:35,代码来源:eqdc.hpp

示例3: fabs

PJ *PROJECTION(merc) {
    double phits=0.0;
    int is_phits;

    if( (is_phits = pj_param(P->ctx, P->params, "tlat_ts").i) ) {
        phits = fabs(pj_param(P->ctx, P->params, "rlat_ts").f);
        if (phits >= M_HALFPI) E_ERROR(-24);
    }

    if (P->es) { /* ellipsoid */
        if (is_phits)
            P->k0 = pj_msfn(sin(phits), cos(phits), P->es);
        P->inv = e_inverse;
        P->fwd = e_forward;
    }

    else { /* sphere */
        if (is_phits)
            P->k0 = cos(phits);
        P->inv = s_inverse;
        P->fwd = s_forward;
    }

    return P;
}
开发者ID:Maasik,项目名称:proj.4,代码行数:25,代码来源:PJ_merc.c

示例4: pj_calloc

PJ *PROJECTION(utm) {
	int zone;
    struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
    if (0==Q)
        return freeup_new (P);
    P->opaque = Q;

	if (!P->es)
        E_ERROR(-34);
	P->y0 = pj_param (P->ctx, P->params, "bsouth").i ? 10000000. : 0.;
	P->x0 = 500000.;
	if (pj_param (P->ctx, P->params, "tzone").i) /* zone input ? */
		if ((zone = pj_param(P->ctx, P->params, "izone").i) > 0 && zone <= 60)
			--zone;
		else
			E_ERROR(-35)
	else /* nearest central meridian input */
		if ((zone = (int)(floor ((adjlon (P->lam0) + M_PI) * 30. / M_PI))) < 0)
			zone = 0;
		else if (zone >= 60)
			zone = 59;
	P->lam0 = (zone + .5) * M_PI / 30. - M_PI;
	P->k0 = 0.9996;
	P->phi0 = 0.;

    return setup (P);
}
开发者ID:Kitware,项目名称:VTK,代码行数:27,代码来源:proj_etmerc.c

示例5: setup_tpeqd

void setup_tpeqd(Parameters& par, par_tpeqd& proj_parm)
{
    double lam_1, lam_2, phi_1, phi_2, A12, pp;
    /* get control point locations */
    phi_1 = pj_param(par.params, "rlat_1").f;
    lam_1 = pj_param(par.params, "rlon_1").f;
    phi_2 = pj_param(par.params, "rlat_2").f;
    lam_2 = pj_param(par.params, "rlon_2").f;
    if (phi_1 == phi_2 && lam_1 == lam_2) throw proj_exception(-25);
    par.lam0 = adjlon(0.5 * (lam_1 + lam_2));
    proj_parm.dlam2 = adjlon(lam_2 - lam_1);
    proj_parm.cp1 = cos(phi_1);
    proj_parm.cp2 = cos(phi_2);
    proj_parm.sp1 = sin(phi_1);
    proj_parm.sp2 = sin(phi_2);
    proj_parm.cs = proj_parm.cp1 * proj_parm.sp2;
    proj_parm.sc = proj_parm.sp1 * proj_parm.cp2;
    proj_parm.ccs = proj_parm.cp1 * proj_parm.cp2 * sin(proj_parm.dlam2);
    proj_parm.z02 = aacos(proj_parm.sp1 * proj_parm.sp2 + proj_parm.cp1 * proj_parm.cp2 * cos(proj_parm.dlam2));
    proj_parm.hz0 = .5 * proj_parm.z02;
    A12 = atan2(proj_parm.cp2 * sin(proj_parm.dlam2),
                proj_parm.cp1 * proj_parm.sp2 - proj_parm.sp1 * proj_parm.cp2 * cos(proj_parm.dlam2));
    proj_parm.ca = cos(pp = aasin(proj_parm.cp1 * sin(A12)));
    proj_parm.sa = sin(pp);
    proj_parm.lp = adjlon(atan2(proj_parm.cp1 * cos(A12), proj_parm.sp1) - proj_parm.hz0);
    proj_parm.dlam2 *= .5;
    proj_parm.lamc = HALFPI - atan2(sin(A12) * proj_parm.sp1, cos(A12)) - proj_parm.dlam2;
    proj_parm.thz0 = tan(proj_parm.hz0);
    proj_parm.rhshz0 = .5 / sin(proj_parm.hz0);
    proj_parm.r2z0 = 0.5 / proj_parm.z02;
    proj_parm.z02 *= proj_parm.z02;
    // par.inv = s_inverse;
    // par.fwd = s_forward;
    par.es = 0.;
}
开发者ID:TheRyaz,项目名称:c_reading,代码行数:35,代码来源:tpeqd.hpp

示例6: pj_calloc

PJ *PROJECTION(labrd) {
    double Az, sinp, R, N, t;
    struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
    if (0==Q)
        return freeup_new (P);
    P->opaque = Q;

    Q->rot  = pj_param(P->ctx, P->params, "bno_rot").i == 0;
    Az = pj_param(P->ctx, P->params, "razi").f;
    sinp = sin(P->phi0);
    t = 1. - P->es * sinp * sinp;
    N = 1. / sqrt(t);
    R = P->one_es * N / t;
    Q->kRg = P->k0 * sqrt( N * R );
    Q->p0s = atan( sqrt(R / N) * tan(P->phi0) );
    Q->A = sinp / sin(Q->p0s);
    t = P->e * sinp;
    Q->C = .5 * P->e * Q->A * log((1. + t)/(1. - t)) +
          - Q->A * log( tan(M_FORTPI + .5 * P->phi0))
          + log( tan(M_FORTPI + .5 * Q->p0s));
    t = Az + Az;
    Q->Ca = (1. - cos(t)) * ( Q->Cb = 1. / (12. * Q->kRg * Q->kRg) );
    Q->Cb *= sin(t);
    Q->Cc = 3. * (Q->Ca * Q->Ca - Q->Cb * Q->Cb);
    Q->Cd = 6. * Q->Ca * Q->Cb;

    P->inv = e_inverse;
    P->fwd = e_forward;

    return P;
}
开发者ID:Kitware,项目名称:VTK,代码行数:31,代码来源:PJ_labrd.c

示例7: setup_airy

 void setup_airy(Parameters& par, par_airy& proj_parm)
 {
     double beta;
     proj_parm.no_cut = pj_param(par.params, "bno_cut").i;
     beta = 0.5 * (HALFPI - pj_param(par.params, "rlat_b").f);
     if (fabs(beta) < EPS)
         proj_parm.Cb = -0.5;
     else {
         proj_parm.Cb = 1./tan(beta);
         proj_parm.Cb *= proj_parm.Cb * log(cos(beta));
     }
     if (fabs(fabs(par.phi0) - HALFPI) < EPS)
         if (par.phi0 < 0.) {
             proj_parm.p_halfpi = -HALFPI;
             proj_parm.mode = S_POLE;
         } else {
             proj_parm.p_halfpi =  HALFPI;
             proj_parm.mode = N_POLE;
         }
     else {
         if (fabs(par.phi0) < EPS)
             proj_parm.mode = EQUIT;
         else {
             proj_parm.mode = OBLIQ;
             proj_parm.sinph0 = sin(par.phi0);
             proj_parm.cosph0 = cos(par.phi0);
         }
     }
     // par.fwd = s_forward;
     par.es = 0.;
 }
开发者ID:Jopie64,项目名称:boost-svn,代码行数:31,代码来源:airy.hpp

示例8: sizeof

PJ *PROJECTION(imw_p) {
    double del, sig, s, t, x1, x2, T2, y1, m1, m2, y2;
    int err;
    struct pj_opaque *Q = static_cast<struct pj_opaque*>(pj_calloc (1, sizeof (struct pj_opaque)));
    if (nullptr==Q)
        return pj_default_destructor (P, ENOMEM);
    P->opaque = Q;

    if (!(Q->en = pj_enfn(P->es))) return pj_default_destructor (P, ENOMEM);
    if( (err = phi12(P, &del, &sig)) != 0) {
        return destructor(P, err);
    }
    if (Q->phi_2 < Q->phi_1) { /* make sure P->phi_1 most southerly */
        del = Q->phi_1;
        Q->phi_1 = Q->phi_2;
        Q->phi_2 = del;
    }
    if (pj_param(P->ctx, P->params, "tlon_1").i)
        Q->lam_1 = pj_param(P->ctx, P->params, "rlon_1").f;
    else { /* use predefined based upon latitude */
        sig = fabs(sig * RAD_TO_DEG);
        if (sig <= 60)      sig = 2.;
        else if (sig <= 76) sig = 4.;
        else                sig = 8.;
        Q->lam_1 = sig * DEG_TO_RAD;
    }
    Q->mode = NONE_IS_ZERO;
    if (Q->phi_1 != 0.0)
        xy(P, Q->phi_1, &x1, &y1, &Q->sphi_1, &Q->R_1);
    else {
        Q->mode = PHI_1_IS_ZERO;
        y1 = 0.;
        x1 = Q->lam_1;
    }
    if (Q->phi_2 != 0.0)
        xy(P, Q->phi_2, &x2, &T2, &Q->sphi_2, &Q->R_2);
    else {
        Q->mode = PHI_2_IS_ZERO;
        T2 = 0.;
        x2 = Q->lam_1;
    }
    m1 = pj_mlfn(Q->phi_1, Q->sphi_1, cos(Q->phi_1), Q->en);
    m2 = pj_mlfn(Q->phi_2, Q->sphi_2, cos(Q->phi_2), Q->en);
    t = m2 - m1;
    s = x2 - x1;
    y2 = sqrt(t * t - s * s) + y1;
    Q->C2 = y2 - T2;
    t = 1. / t;
    Q->P = (m2 * y1 - m1 * y2) * t;
    Q->Q = (y2 - y1) * t;
    Q->Pp = (m2 * x1 - m1 * x2) * t;
    Q->Qp = (x2 - x1) * t;

    P->fwd = e_forward;
    P->inv = e_inverse;
    P->destructor = destructor;

    return P;
}
开发者ID:Navionics,项目名称:proj.4,代码行数:59,代码来源:imw_p.cpp

示例9: setup_gn_sinu

 void setup_gn_sinu(Parameters& par, par_gn_sinu& proj_parm)
 {
     if (pj_param(par.params, "tn").i && pj_param(par.params, "tm").i) {
         proj_parm.n = pj_param(par.params, "dn").f;
         proj_parm.m = pj_param(par.params, "dm").f;
     } else
         throw proj_exception(-99);
     setup(par, proj_parm);
 }
开发者ID:VTREEM,项目名称:IFCPlusPlus_old,代码行数:9,代码来源:gn_sinu.hpp

示例10: setup_urmfps

 void setup_urmfps(Parameters& par, par_urmfps& proj_parm)
 {
     if (pj_param(par.params, "tn").i) {
         proj_parm.n = pj_param(par.params, "dn").f;
         if (proj_parm.n <= 0. || proj_parm.n > 1.)
             throw proj_exception(-40);
     } else
         throw proj_exception(-40);
     setup(par, proj_parm);
 }
开发者ID:Jopie64,项目名称:boost-svn,代码行数:10,代码来源:urmfps.hpp

示例11: pj_calloc

PJ *PROJECTION(stere) {
    struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
    if (0==Q)
        return freeup_new (P);
    P->opaque = Q;

    Q->phits = pj_param (P->ctx, P->params, "tlat_ts").i ?
               pj_param (P->ctx, P->params, "rlat_ts").f : HALFPI;

    return setup(P);
}
开发者ID:GEO-IASS,项目名称:proj.4,代码行数:11,代码来源:PJ_stere.c

示例12: setup_lagrng

 void setup_lagrng(Parameters& par, par_lagrng& proj_parm)
 {
     double phi1;
     if ((proj_parm.rw = pj_param(par.params, "dW").f) <= 0) throw proj_exception(-27);
     proj_parm.hrw = 0.5 * (proj_parm.rw = 1. / proj_parm.rw);
     phi1 = pj_param(par.params, "rlat_1").f;
     if (fabs(fabs(phi1 = sin(phi1)) - 1.) < TOL) throw proj_exception(-22);
     proj_parm.a1 = pow((1. - phi1)/(1. + phi1), proj_parm.hrw);
     par.es = 0.;
     // par.fwd = s_forward;
 }
开发者ID:Belial2010,项目名称:Pedestrian-Detection-Project,代码行数:11,代码来源:lagrng.hpp

示例13: setup_tpers

            inline void setup_tpers(Parameters& par, par_nsper<T>& proj_parm)
            {
                T omega, gamma;

                omega = pj_param(par.params, "dtilt").f * geometry::math::d2r<T>();
                gamma = pj_param(par.params, "dazi").f * geometry::math::d2r<T>();
                proj_parm.tilt = 1;
                proj_parm.cg = cos(gamma); proj_parm.sg = sin(gamma);
                proj_parm.cw = cos(omega); proj_parm.sw = sin(omega);
                setup(par, proj_parm);
            }
开发者ID:maxmods,项目名称:bah.mod,代码行数:11,代码来源:nsper.hpp

示例14: pj_calloc

PJ *PROJECTION(lcc) {
    double cosphi, sinphi;
    int secant;
    struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));

    if (0==Q)
        return pj_default_destructor (P, ENOMEM);
    P->opaque = Q;


    Q->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
    if (pj_param(P->ctx, P->params, "tlat_2").i)
        Q->phi2 = pj_param(P->ctx, P->params, "rlat_2").f;
    else {
        Q->phi2 = Q->phi1;
        if (!pj_param(P->ctx, P->params, "tlat_0").i)
            P->phi0 = Q->phi1;
    }
    if (fabs(Q->phi1 + Q->phi2) < EPS10)
        return pj_default_destructor(P, PJD_ERR_CONIC_LAT_EQUAL);

    Q->n = sinphi = sin(Q->phi1);
    cosphi = cos(Q->phi1);
    secant = fabs(Q->phi1 - Q->phi2) >= EPS10;
    if( (Q->ellips = (P->es != 0.)) ) {
        double ml1, m1;

        P->e = sqrt(P->es);
        m1 = pj_msfn(sinphi, cosphi, P->es);
        ml1 = pj_tsfn(Q->phi1, sinphi, P->e);
        if (secant) { /* secant cone */
            sinphi = sin(Q->phi2);
            Q->n = log(m1 / pj_msfn(sinphi, cos(Q->phi2), P->es));
            Q->n /= log(ml1 / pj_tsfn(Q->phi2, sinphi, P->e));
        }
        Q->c = (Q->rho0 = m1 * pow(ml1, -Q->n) / Q->n);
        Q->rho0 *= (fabs(fabs(P->phi0) - M_HALFPI) < EPS10) ? 0. :
            pow(pj_tsfn(P->phi0, sin(P->phi0), P->e), Q->n);
    } else {
        if (secant)
            Q->n = log(cosphi / cos(Q->phi2)) /
               log(tan(M_FORTPI + .5 * Q->phi2) /
               tan(M_FORTPI + .5 * Q->phi1));
        Q->c = cosphi * pow(tan(M_FORTPI + .5 * Q->phi1), Q->n) / Q->n;
        Q->rho0 = (fabs(fabs(P->phi0) - M_HALFPI) < EPS10) ? 0. :
            Q->c * pow(tan(M_FORTPI + .5 * P->phi0), -Q->n);
    }

    P->inv = e_inverse;
    P->fwd = e_forward;

    return P;
}
开发者ID:ampimis,项目名称:RtkGps,代码行数:53,代码来源:PJ_lcc.c

示例15: setup_tpers

 void setup_tpers(Parameters& par, par_nsper& proj_parm)
 {
     double omega, gamma;
     omega = pj_param(par.params, "dtilt").f * DEG_TO_RAD;
     gamma = pj_param(par.params, "dazi").f * DEG_TO_RAD;
     proj_parm.tilt = 1;
     proj_parm.cg = cos(gamma);
  proj_parm.sg = sin(gamma);
     proj_parm.cw = cos(omega);
  proj_parm.sw = sin(omega);
     setup(par, proj_parm);
 }
开发者ID:AlexMioMio,项目名称:boost,代码行数:12,代码来源:nsper.hpp


注:本文中的pj_param函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。