[Proj] Time for a new release?

Roger Bivand Roger.Bivand at nhh.no
Fri Nov 17 04:13:31 EST 2017

... and please explain PJ_FWD in the example - is it the macro in line 357
ff. in proj.h?

/* Apply transformation to observation - in forward or inverse direction */
    PJ_FWD   =  1,   /* Forward    */
    PJ_IDENT =  0,   /* Do nothing */
    PJ_INV   = -1    /* Inverse    */

The question about non-existent inverses will bite for PJ_INV - am I looking
in the right place i pj_internal.c, line 80 ff:

PJ_COORD pj_inv4d (PJ_COORD coo, PJ *P) {
    if (0!=P->inv4d)
        return P->inv4d (coo, P);
    if (0!=P->inv3d) {
        coo.lpz  =  pj_inv3d (coo.xyz, P);
        return coo;
    if (0!=P->inv) {
        coo.lp  =  pj_inv (coo.xy, P);
        return coo;
    proj_errno_set (P, EINVAL);
    return proj_coord_error ();

so a no-inverse definition sets an error number and returns HUGE_VAL,
pj_internal.c line 56:

/* Work around non-constness of MSVC HUGE_VAL by providing functions rather
than constants */
PJ_COORD proj_coord_error (void) {
    PJ_COORD c;
    c.v[0] = c.v[1] = c.v[2] = c.v[3] = HUGE_VAL;
    return c;

Can P->inv4d, P->inv3d and P->inv be read in the API?

These are the kinds of things that the migration guide could helpfully show.


Roger Bivand
NHH Norwegian School of Economics, Bergen, Norway
Sent from: http://osgeo-org.1560.x6.nabble.com/PROJ-4-f3840930.html

More information about the Proj mailing list