Ejemplo n.º 1
0
int pj_eck1_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=eck1   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };
    XY s_fwd_expect[] = {
        { 204680.88820295094,  102912.17842606473},
        { 204680.88820295094, -102912.17842606473},
        {-204680.88820295094,  102912.17842606473},
        {-204680.88820295094, -102912.17842606473},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 0.0019434150820034624,  0.00097170229538813102},
        { 0.0019434150820034624, -0.00097170229538813102},
        {-0.0019434150820034624,  0.00097170229538813102},
        {-0.0019434150820034624, -0.00097170229538813102},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
Ejemplo n.º 2
0
int pj_bonne_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=bonne   +ellps=GRS80  +lat_1=0.5 +lat_2=2"};
    char s_args[] = {"+proj=bonne   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 222605.29609715697,   55321.139565494814},
        { 222605.29609923941,  -165827.64779905154},
        {-222605.29609715697,   55321.139565494814},
        {-222605.29609923941,  -165827.64779905154},
    };

    XY s_fwd_expect[] = {
        { 223368.11557252839,   55884.555246393575},
        { 223368.11557463196,  -167517.59936969393},
        {-223368.11557252839,   55884.555246393575},
        {-223368.11557463196,  -167517.59936969393},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.0017966987691132891,  0.50090436853737497},
        { 0.0017966982774478867,  0.4990956309655612},
        {-0.0017966987691132891,  0.50090436853737497},
        {-0.0017966982774478867,  0.4990956309655612},
    };

    LP s_inv_expect[] = {
        { 0.0017905615332457991,  0.50089524631087834},
        { 0.0017905610449335603,  0.49910475320072978},
        {-0.0017905615332457991,  0.50089524631087834},
        {-0.0017905610449335603,  0.49910475320072978},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 3
0
Archivo: PJ_sts.c Proyecto: Kitware/VTK
int pj_fouc_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=fouc   +ellps=GRS80  +lat_1=0.5 +lat_2=2 +n=0.5"};
    char s_args[] = {"+proj=fouc   +a=6400000    +lat_1=0.5 +lat_2=2 +n=0.5"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        {222588.12067589167,  111322.31670069379},
        {222588.12067589167,  -111322.31670069379},
        {-222588.12067589167,  111322.31670069379},
        {-222588.12067589167,  -111322.31670069379},
    };

    XY s_fwd_expect[] = {
        {223351.10900341379,  111703.9077217125},
        {223351.10900341379,  -111703.9077217125},
        {-223351.10900341379,  111703.9077217125},
        {-223351.10900341379,  -111703.9077217125},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        {0.0017966305685702751,  0.00089831528410111959},
        {0.0017966305685702751,  -0.00089831528410111959},
        {-0.0017966305685702751,  0.00089831528410111959},
        {-0.0017966305685702751,  -0.00089831528410111959},
    };

    LP s_inv_expect[] = {
        {0.0017904931101116717,  0.00089524655487369749},
        {0.0017904931101116717,  -0.00089524655487369749},
        {-0.0017904931101116717,  0.00089524655487369749},
        {-0.0017904931101116717,  -0.00089524655487369749},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 4
0
Archivo: PJ_sts.c Proyecto: Kitware/VTK
int pj_mbt_s_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=mbt_s   +ellps=GRS80  +lat_1=0.5 +lat_2=2 +n=0.5"};
    char s_args[] = {"+proj=mbt_s   +a=6400000    +lat_1=0.5 +lat_2=2 +n=0.5"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        {204131.51785027285,  121400.33022550763},
        {204131.51785027285,  -121400.33022550763},
        {-204131.51785027285,  121400.33022550763},
        {-204131.51785027285,  -121400.33022550763},
    };

    XY s_fwd_expect[] = {
        {204831.24057099217,  121816.46669603503},
        {204831.24057099217,  -121816.46669603503},
        {-204831.24057099217,  121816.46669603503},
        {-204831.24057099217,  -121816.46669603503},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        {0.0019593827209883237,  0.00082369854658027549},
        {0.0019593827209883237,  -0.00082369854658027549},
        {-0.0019593827209883237,  0.00082369854658027549},
        {-0.0019593827209883237,  -0.00082369854658027549},
    };

    LP s_inv_expect[] = {
        {0.0019526892859206603,  0.00082088471512331508},
        {0.0019526892859206603,  -0.00082088471512331508},
        {-0.0019526892859206603,  0.00082088471512331508},
        {-0.0019526892859206603,  -0.00082088471512331508},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 5
0
Archivo: PJ_sts.c Proyecto: Kitware/VTK
int pj_qua_aut_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=qua_aut   +ellps=GRS80  +lat_1=0.5 +lat_2=2 +n=0.5"};
    char s_args[] = {"+proj=qua_aut   +a=6400000    +lat_1=0.5 +lat_2=2 +n=0.5"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        {222613.54903309655,  111318.07788798446},
        {222613.54903309655,  -111318.07788798446},
        {-222613.54903309655,  111318.07788798446},
        {-222613.54903309655,  -111318.07788798446},
    };

    XY s_fwd_expect[] = {
        {223376.62452402918,  111699.65437918637},
        {223376.62452402918,  -111699.65437918637},
        {-223376.62452402918,  111699.65437918637},
        {-223376.62452402918,  -111699.65437918637},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        {0.0017966305684046586,  0.00089831528412872229},
        {0.0017966305684046586,  -0.00089831528412872229},
        {-0.0017966305684046586,  0.00089831528412872229},
        {-0.0017966305684046586,  -0.00089831528412872229},
    };

    LP s_inv_expect[] = {
        {0.0017904931099477471,  0.00089524655490101819},
        {0.0017904931099477471,  -0.00089524655490101819},
        {-0.0017904931099477471,  0.00089524655490101819},
        {-0.0017904931099477471,  -0.00089524655490101819},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 6
0
Archivo: PJ_sts.c Proyecto: Kitware/VTK
int pj_kav5_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=kav5   +ellps=GRS80  +lat_1=0.5 +lat_2=2 +n=0.5"};
    char s_args[] = {"+proj=kav5   +a=6400000    +lat_1=0.5 +lat_2=2 +n=0.5"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        {200360.90530882866,  123685.08247699818},
        {200360.90530882866,  -123685.08247699818},
        {-200360.90530882866,  123685.08247699818},
        {-200360.90530882866,  -123685.08247699818},
    };

    XY s_fwd_expect[] = {
        {201047.7031108776,  124109.05062917093},
        {201047.7031108776,  -124109.05062917093},
        {-201047.7031108776,  124109.05062917093},
        {-201047.7031108776,  -124109.05062917093},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        {0.0019962591348533314,  0.00080848256185253912},
        {0.0019962591348533314,  -0.00080848256185253912},
        {-0.0019962591348533314,  0.00080848256185253912},
        {-0.0019962591348533314,  -0.00080848256185253912},
    };

    LP s_inv_expect[] = {
        {0.0019894397264987643,  0.00080572070962591153},
        {0.0019894397264987643,  -0.00080572070962591153},
        {-0.0019894397264987643,  0.00080572070962591153},
        {-0.0019894397264987643,  -0.00080572070962591153},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 7
0
int pj_rhealpix_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=rhealpix   +ellps=GRS80  +lat_1=0.5 +lat_2=2"};
    char s_args[] = {"+proj=rhealpix   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 222390.10394923863,  130406.58866448226},
        { 222390.10394923863, -130406.58866448054},
        {-222390.10394923863,  130406.58866448226},
        {-222390.10394923863, -130406.58866448054},
    };

    XY s_fwd_expect[] = {
        { 223402.14425527418,  131588.04444199943},
        { 223402.14425527418, -131588.04444199943},
        {-223402.14425527418,  131588.04444199943},
        {-223402.14425527418, -131588.04444199943},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.0017986411845524453,  0.00076679453057823619},
        { 0.0017986411845524453, -0.00076679453057823619},
        {-0.0017986411845524453,  0.00076679453057823619},
        {-0.0017986411845524453, -0.00076679453057823619},
    };

    LP s_inv_expect[] = {
        { 0.0017904931097838226,  0.00075990887733981202},
        { 0.0017904931097838226, -0.00075990887733981202},
        {-0.0017904931097838226,  0.00075990887733981202},
        {-0.0017904931097838226, -0.00075990887733981202},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 8
0
int pj_cass_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=cass   +ellps=GRS80  +lat_1=0.5 +lat_2=2"};
    char s_args[] = {"+proj=cass   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 222605.28577699114,   110642.22925399939},
        { 222605.28577699114,  -110642.22925399939},
        {-222605.28577699114,   110642.22925399939},
        {-222605.28577699114,  -110642.22925399939},
    };

    XY s_fwd_expect[] = {
        { 223368.10520348375,  111769.14504058579},
        { 223368.10520348375, -111769.14504058579},
        {-223368.10520348375,  111769.14504058579},
        {-223368.10520348375, -111769.14504058579},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.0017966305684613522,   0.00090436947663183841},
        { 0.0017966305684613522,  -0.00090436947663183841},
        {-0.0017966305684613522,   0.00090436947663183841},
        {-0.0017966305684613522,  -0.00090436947663183841},
    };

    LP s_inv_expect[] = {
        { 0.0017904931100023887,   0.00089524655445477922},
        { 0.0017904931100023887,  -0.00089524655445477922},
        {-0.0017904931100023887,   0.00089524655445477922},
        {-0.0017904931100023887,  -0.00089524655445477922},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 9
0
int pj_poly_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=poly   +ellps=GRS80  +lat_1=0.5 +lat_2=2"};
    char s_args[] = {"+proj=poly   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 222605.285770237475,  110642.194561440483},
        { 222605.285770237475, -110642.194561440483},
        {-222605.285770237475,  110642.194561440483},
        {-222605.285770237475, -110642.194561440483},
    };

    XY s_fwd_expect[] = {
        { 223368.105210218986,  111769.110491224754},
        { 223368.105210218986, -111769.110491224754},
        {-223368.105210218986,  111769.110491224754},
        {-223368.105210218986, -111769.110491224754},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.00179663056846135222,  0.000904369476631838518},
        { 0.00179663056846135222, -0.000904369476631838518},
        {-0.00179663056846135222,  0.000904369476631838518},
        {-0.00179663056846135222, -0.000904369476631838518},
    };

    LP s_inv_expect[] = {
        { 0.0017904931100023887,  0.000895246554454779222},
        { 0.0017904931100023887, -0.000895246554454779222},
        {-0.0017904931100023887,  0.000895246554454779222},
        {-0.0017904931100023887, -0.000895246554454779222},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 10
0
int pj_qsc_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=qsc   +ellps=GRS80  +lat_1=0.5 +lat_2=2"};
    char s_args[] = {"+proj=qsc   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 304638.450843852363,  164123.870923793991},
        { 304638.450843852363, -164123.870923793991},
        {-304638.450843852363,  164123.870923793962},
        {-304638.450843852421, -164123.870923793904},
    };

    XY s_fwd_expect[] = {
        { 305863.792402890511,  165827.722754715243},
        { 305863.792402890511, -165827.722754715243},
        {-305863.792402890511,  165827.722754715243},
        {-305863.792402890569, -165827.722754715156},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.00132134098471627126,  0.000610652900922527926},
        { 0.00132134098471627126, -0.000610652900922527926},
        {-0.00132134098471627126,  0.000610652900922527926},
        {-0.00132134098471627126, -0.000610652900922527926},
    };

    LP s_inv_expect[] = {
        { 0.00131682718763827234,  0.000604493198178676161},
        { 0.00131682718763827234, -0.000604493198178676161},
        {-0.00131682718763827234,  0.000604493198178676161},
        {-0.00131682718763827234, -0.000604493198178676161},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 11
0
int pj_stere_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=stere   +ellps=GRS80  +lat_1=0.5 +lat_2=2 +n=0.5"};
    char s_args[] = {"+proj=stere   +a=6400000    +lat_1=0.5 +lat_2=2 +n=0.5"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 445289.70910023432,  221221.76694834774},
        { 445289.70910023432, -221221.76694835056},
        {-445289.70910023432,  221221.76694834774},
        {-445289.70910023432, -221221.76694835056},
    };

    XY s_fwd_expect[] = {
        { 223407.81025950745,  111737.938996443},
        { 223407.81025950745, -111737.938996443},
        {-223407.81025950745,  111737.938996443},
        {-223407.81025950745, -111737.938996443},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.0017966305682022392,  0.00090436947502443507},
        { 0.0017966305682022392, -0.00090436947502443507},
        {-0.0017966305682022392,  0.00090436947502443507},
        {-0.0017966305682022392, -0.00090436947502443507},
    };

    LP s_inv_expect[] = {
        { 0.001790493109747395,  0.00089524655465513144},
        { 0.001790493109747395, -0.00089524655465513144},
        {-0.001790493109747395,  0.00089524655465513144},
        {-0.001790493109747395, -0.00089524655465513144},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 12
0
int pj_tpeqd_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=tpeqd   +ellps=GRS80  +lat_1=0.5 +lat_2=2 +n=0.5"};
    char s_args[] = {"+proj=tpeqd   +a=6400000    +lat_1=0.5 +lat_2=2 +n=0.5"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        {-27750.758831679042,  -222599.40369177726},
        {-250434.93702403645,  -222655.93819326628},
        {-27750.758831679042,  222599.40369177726},
        {-250434.93702403645,  222655.93819326628},
    };

    XY s_fwd_expect[] = {
        {-27845.882978485075,  -223362.43069526015},
        {-251293.37876465076,  -223419.15898590829},
        {-27845.882978485075,  223362.43069526015},
        {-251293.37876465076,  223419.15898590829},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        {-0.00089855554821257374,  1.2517966304145272},
        {0.0008985555481998515,  1.2517966304145272},
        {-0.00089855431859741167,  1.2482033692781642},
        {0.00089855431859741167,  1.2482033692781642},
    };

    LP s_inv_expect[] = {
        {-0.00089548606640108474,  1.2517904929571837},
        {0.0008954860663883625,  1.2517904929571837},
        {-0.000895484845182587,  1.248209506737604},
        {0.00089548484516986475,  1.248209506737604},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 13
0
int pj_laea_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=laea   +ellps=GRS80  +lat_1=0.5 +lat_2=2"};
    char s_args[] = {"+proj=laea   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 222602.471450095181,  110589.82722441027},
        { 222602.471450095181, -110589.827224408786},
        {-222602.471450095181,  110589.82722441027},
        {-222602.471450095181, -110589.827224408786},
    };

    XY s_fwd_expect[] = {
        { 223365.281370124663,  111716.668072915665},
        { 223365.281370124663, -111716.668072915665},
        {-223365.281370124663,  111716.668072915665},
        {-223365.281370124663, -111716.668072915665},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.00179663056847900867,  0.000904369475966495845},
        { 0.00179663056847900867, -0.000904369475966495845},
        {-0.00179663056847900867,  0.000904369475966495845},
        {-0.00179663056847900867, -0.000904369475966495845},
    };

    LP s_inv_expect[] = {
        { 0.00179049311002060264,  0.000895246554791735271},
        { 0.00179049311002060264, -0.000895246554791735271},
        {-0.00179049311002060264,  0.000895246554791735271},
        {-0.00179049311002060264, -0.000895246554791735271},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 14
0
int pj_merc_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=merc   +ellps=GRS80  +lat_1=0.5 +lat_2=2"};
    char s_args[] = {"+proj=merc   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 222638.981586547132,  110579.965218249708},
        { 222638.981586547132, -110579.965218249112},
        {-222638.981586547132,  110579.965218249708},
        {-222638.981586547132, -110579.965218249112},
    };

    XY s_fwd_expect[] = {
        { 223402.144255274179,  111706.743574944077},
        { 223402.144255274179, -111706.743574944485},
        {-223402.144255274179,  111706.743574944077},
        {-223402.144255274179, -111706.743574944485},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        { 0.00179663056823904264,  0.00090436947522799056},
        { 0.00179663056823904264, -0.00090436947522799056},
        {-0.00179663056823904264,  0.00090436947522799056},
        {-0.00179663056823904264,  -0.00090436947522799056},
    };

    LP s_inv_expect[] = {
        { 0.00179049310978382265,  0.000895246554845297135},
        { 0.00179049310978382265, -0.000895246554858019272},
        {-0.00179049310978382265,  0.000895246554845297135},
        {-0.00179049310978382265, -0.000895246554858019272},
    };

    return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}
Ejemplo n.º 15
0
int pj_vandg2_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=vandg2   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 223395.24785043663,  111718.49103722633},
        { 223395.24785043663, -111718.49103722633},
        {-223395.24785043663,  111718.49103722633},
        {-223395.24785043663, -111718.49103722633},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
}
Ejemplo n.º 16
0
int pj_vandg3_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=vandg3   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 223395.24955283134,  111704.51990442065},
        { 223395.24955283134, -111704.51990442065},
        {-223395.24955283134,  111704.51990442065},
        {-223395.24955283134, -111704.51990442065},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
}
Ejemplo n.º 17
0
int pj_wag7_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=wag7   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 198601.87695731167,  125637.0457141714},
        { 198601.87695731167, -125637.0457141714},
        {-198601.87695731167,  125637.0457141714},
        {-198601.87695731167, -125637.0457141714},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
}
Ejemplo n.º 18
0
int pj_wink2_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=wink2   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 223387.39643378611,  124752.03279744535},
        { 223387.39643378611, -124752.03279744535},
        {-223387.39643378611,  124752.03279744535},
        {-223387.39643378611, -124752.03279744535},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
}
Ejemplo n.º 19
0
int pj_nicol_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=nicol   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 223374.561814139714,  111732.553988545071},
        { 223374.561814139714, -111732.553988545071},
        {-223374.561814139714,  111732.553988545071},
        {-223374.561814139714, -111732.553988545071},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
}
Ejemplo n.º 20
0
int pj_putp3p_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=putp3p   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 178238.118539984745,  89124.5607860879827},
        { 178238.118539984745, -89124.5607860879827},
        {-178238.118539984745,  89124.5607860879827},
        {-178238.118539984745, -89124.5607860879827},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 0.00224405032969050844,  0.00112202516475805899},
        { 0.00224405032969050844, -0.00112202516475805899},
        {-0.00224405032969050844,  0.00112202516475805899},
        {-0.00224405032969050844, -0.00112202516475805899},

    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 21
0
int pj_gstmerc_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=gstmerc   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };


    XY s_fwd_expect[] = {
        { 223413.46640632182,  111769.14504058557},
        { 223413.46640632182, -111769.14504058668},
        {-223413.46640632302,  111769.14504058557},
        {-223413.46640632302, -111769.14504058668},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 0.0017904931097109673,  0.0008952465544509083},
        { 0.0017904931097109673, -0.0008952465544509083},
        {-0.0017904931097109673,  0.0008952465544509083},
        {-0.0017904931097109673, -0.0008952465544509083},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 22
0
int pj_putp5_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=putp5   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 226367.21338056153,  113204.56855847509},
        { 226367.21338056153, -113204.56855847509},
        {-226367.21338056153,  113204.56855847509},
        {-226367.21338056153, -113204.56855847509},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 0.00176671315102969553,  0.000883356575387199546},
        { 0.00176671315102969553, -0.000883356575387199546},
        {-0.00176671315102969553,  0.000883356575387199546},
        {-0.00176671315102969553, -0.000883356575387199546},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 23
0
int pj_cc_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=cc   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        {223402.14425527418,  111712.41554059254},
        {223402.14425527418,  -111712.41554059254},
        {-223402.14425527418,  111712.41554059254},
        {-223402.14425527418,  -111712.41554059254},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        {0.0017904931097838226,  0.00089524655481905597},
        {0.0017904931097838226,  -0.00089524655481905597},
        {-0.0017904931097838226,  0.00089524655481905597},
        {-0.0017904931097838226,  -0.00089524655481905597},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 24
0
int pj_ocea_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=ocea   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        {127964312562778.156,  1429265667691.05786},
        {129394957619297.641,  1429265667691.06812},
        {127964312562778.188, -1429265667691.0498},
        {129394957619297.688, -1429265667691.03955},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 179.999999999860108,  2.79764548403721305e-10},
        {-179.999999999860108,  2.7976454840372327e-10},
        { 179.999999999860108, -2.7976454840372327e-10},
        {-179.999999999860108, -2.79764548403721305e-10},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 25
0
int pj_wag2_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=wag2   +a=6400000  +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 206589.88809996162,   120778.04035754716},
        { 206589.88809996162,  -120778.04035754716},
        {-206589.88809996162,   120778.04035754716},
        {-206589.88809996162,  -120778.04035754716},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 0.0019360240367390709,   0.00082795765763814082},
        { 0.0019360240367390709,  -0.00082795765763814082},
        {-0.0019360240367390709,   0.00082795765763814082},
        {-0.0019360240367390709,  -0.00082795765763814082},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 26
0
int pj_nell_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=nell   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 223385.132504695706,  111698.23644718733},
        { 223385.132504695706, -111698.23644718733},
        {-223385.132504695706,  111698.23644718733},
        {-223385.132504695706, -111698.23644718733},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 0.00179049310989310567,  0.000895246554910125161},
        { 0.00179049310989310567, -0.000895246554910125161},
        {-0.00179049310989310567,  0.000895246554910125161},
        {-0.00179049310989310567, -0.000895246554910125161},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 27
0
int pj_collg_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=collg   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        {249872.921577929839,  99423.1747884602082},
        {254272.532301245432,  -98559.3077607425657},
        {-249872.921577929839,  99423.1747884602082},
        {-254272.532301245432,  -98559.3077607425657},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        {0.00158679719207879865,  0.00101017310941749921},
        {0.001586769215623956,  -0.00101018201458258111},
        {-0.00158679719207879865,  0.00101017310941749921},
        {-0.001586769215623956,  -0.00101018201458258111},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 28
0
int pj_wink1_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char s_args[] = {"+proj=wink1   +a=6400000    +lat_1=0.5 +lat_2=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY s_fwd_expect[] = {
        { 223385.13164095284,  111701.07212763709},
        { 223385.13164095284,  -111701.07212763709},
        {-223385.13164095284,  111701.07212763709},
        {-223385.13164095284,  -111701.07212763709},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP s_inv_expect[] = {
        { 0.0017904931098931057,  0.00089524655489191132},
        { 0.0017904931098931057, -0.00089524655489191132},
        {-0.0017904931098931057,  0.00089524655489191132},
        {-0.0017904931098931057, -0.00089524655489191132},
    };

    return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}
Ejemplo n.º 29
0
int pj_labrd_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=labrd   +ellps=GRS80  +lon_0=0.5 +lat_0=2"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        { 166973.166090228391, -110536.912730266107},
        { 166973.168287157256, -331761.993650884193},
        {-278345.500519976194, -110469.032642031714},
        {-278345.504185269645, -331829.870790275279},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        {0.501797719349373672, 2.00090435742047923},
        {0.501797717380853658, 1.99909564058898681},
        {0.498202280650626328, 2.00090435742047923},
        {0.498202282619146342, 1.99909564058898681},
    };

    return pj_generic_selftest (e_args, 0, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, 0, inv_in, e_inv_expect, 0);
}
Ejemplo n.º 30
0
int pj_ups_selftest (void) {
    double tolerance_lp = 1e-10;
    double tolerance_xy = 1e-7;

    char e_args[] = {"+proj=ups   +ellps=GRS80  +lat_1=0.5 +lat_2=2 +n=0.5"};

    LP fwd_in[] = {
        { 2, 1},
        { 2,-1},
        {-2, 1},
        {-2,-1}
    };

    XY e_fwd_expect[] = {
        {2433455.5634384668,  -10412543.301512826},
        {2448749.1185681992,  -10850493.419804076},
        {1566544.4365615332,  -10412543.301512826},
        {1551250.8814318008,  -10850493.419804076},
    };

    XY inv_in[] = {
        { 200, 100},
        { 200,-100},
        {-200, 100},
        {-200,-100}
    };

    LP e_inv_expect[] = {
        {-44.998567498074834,  64.9182362867341},
        {-44.995702709112308,  64.917020250675748},
        {-45.004297076028529,  64.915804280954518},
        {-45.001432287066002,  64.914588377560719},
    };

    return pj_generic_selftest (e_args, 0, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, 0, inv_in, e_inv_expect, 0);
}