Exemplo n.º 1
0
static XY e_rhealpix_forward(LP lp, PJ *P) { /* ellipsoid */
    struct pj_opaque *Q = P->opaque;
    XY xy;
    lp.phi = auth_lat(P, lp.phi, 0);
    xy = healpix_sphere(lp);
    return combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 0);
}
Exemplo n.º 2
0
 // INVERSE(e_healpix_inverse)  ellipsoid
 // Project coordinates from cartesian (x, y) to geographic (lon, lat)
 inline void inv(T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
 {
     /* Check whether (x, y) lies in the HEALPix image. */
     if (in_image(xy_x, xy_y, 0, 0, 0) == 0) {
         lp_lon = HUGE_VAL;
         lp_lat = HUGE_VAL;
         BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
     }
     healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
     lp_lat = auth_lat(this->params(), m_proj_parm, lp_lat, 1);
 }
Exemplo n.º 3
0
 // INVERSE(e_rhealpix_inverse)  ellipsoid
 // Project coordinates from cartesian (x, y) to geographic (lon, lat)
 inline void inv(T xy_x, T xy_y, T& lp_lon, T& lp_lat) const
 {
     /* Check whether (x, y) lies in the rHEALPix image. */
     if (in_image(xy_x, xy_y, 1, this->m_proj_parm.north_square, this->m_proj_parm.south_square) == 0) {
         lp_lon = HUGE_VAL;
         lp_lat = HUGE_VAL;
         BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
     }
     combine_caps(xy_x, xy_y, this->m_proj_parm.north_square, this->m_proj_parm.south_square, 1);
     healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
     lp_lat = auth_lat(this->params(), m_proj_parm, lp_lat, 1);
 }
Exemplo n.º 4
0
static LP e_healpix_inverse(XY xy, PJ *P) { /* ellipsoid */
    LP lp = {0.0,0.0};

    /* Check whether (x, y) lies in the HEALPix image. */
    if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
        lp.lam = HUGE_VAL;
        lp.phi = HUGE_VAL;
        pj_ctx_set_errno(P->ctx, -15);
        return lp;
    }
    lp = healpix_sphere_inverse(xy);
    lp.phi = auth_lat(P, lp.phi, 1);
    return lp;
}
Exemplo n.º 5
0
static LP e_rhealpix_inverse(XY xy, PJ *P) { /* ellipsoid */
    struct pj_opaque *Q = P->opaque;
    LP lp = {0.0,0.0};

    /* Check whether (x, y) lies in the rHEALPix image. */
    if (in_image(xy.x, xy.y, 1, Q->north_square, Q->south_square) == 0) {
        lp.lam = HUGE_VAL;
        lp.phi = HUGE_VAL;
        pj_ctx_set_errno(P->ctx, -15);
        return lp;
    }
    xy = combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 1);
    lp = healpix_sphere_inverse(xy);
    lp.phi = auth_lat(P, lp.phi, 1);
    return lp;
}
Exemplo n.º 6
0
static XY e_healpix_forward(LP lp, PJ *P) { /* ellipsoid  */
    lp.phi = auth_lat(P, lp.phi, 0);
    return healpix_sphere(lp);
}
Exemplo n.º 7
0
 // FORWARD(e_rhealpix_forward)  ellipsoid
 // Project coordinates from geographic (lon, lat) to cartesian (x, y)
 inline void fwd(T const& lp_lon, T lp_lat, T& xy_x, T& xy_y) const
 {
     lp_lat = auth_lat(this->params(), m_proj_parm, lp_lat, 0);
     healpix_sphere(lp_lon, lp_lat, xy_x, xy_y);
     combine_caps(xy_x, xy_y, this->m_proj_parm.north_square, this->m_proj_parm.south_square, 0);
 }
Exemplo n.º 8
0
 // FORWARD(e_healpix_forward)  ellipsoid
 // Project coordinates from geographic (lon, lat) to cartesian (x, y)
 inline void fwd(T const& lp_lon, T lp_lat, T& xy_x, T& xy_y) const
 {
     lp_lat = auth_lat(this->params(), m_proj_parm, lp_lat, 0);
     return healpix_sphere(lp_lon, lp_lat, xy_x, xy_y);
 }