Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No inverse method available" #4165

Closed
dvargas74 opened this issue Jun 5, 2024 · 7 comments
Closed

"No inverse method available" #4165

dvargas74 opened this issue Jun 5, 2024 · 7 comments

Comments

@dvargas74
Copy link

Hi,

I'm testing projected grids and I'm getting error 2048 - No inverse method available.

What is wrong in this pipeline?

+proj=pipeline +step +proj=tmerc lat_0=0 lon_0=24 k=0.9996 x_0=500000 y_0=0 ellps=GRS80 +step +proj=gridshift +grids=projected_grid.tif

@dvargas74
Copy link
Author

I get an test error when running "gie" program with "gridshift.gie" file for the operation:

"operation +proj=gridshift +grids=tests/test_gridshift_projected.tif"

gridshift: Invalid latitude

I'm using PROJ v9.4.0

@rouault
Copy link
Member

rouault commented Jun 5, 2024

I get an test error when running "gie" program with "gridshift.gie" file for the operation:

I suspect some misconfiguration in your system. Are you sure you aren't mixing PROJ versions?

@dvargas74
Copy link
Author

dvargas74 commented Jun 5, 2024

This is the header obtained when running "projinfo" and "proj" programs:

Rel. 9.4.0, March 1st, 2024

All tests are succeeded except the one for this operation

On the other hand, here a piece of code for debugging this issue:

PJ_COORD source = proj_coord(-598000.000, -1160020.000, 0.000, 0);
PJ_CONTEXT* context = proj_context_create();
PJ *pj = proj_create(context, "+proj=gridshift +grids=test_gridshift_projected.tif");
double x = proj_roundtrip(pj, PJ_DIRECTION::PJ_FWD, 1, &source);

Should be right? What about the pipeline at the beginning of this conversation?

@rouault
Copy link
Member

rouault commented Jun 5, 2024

Should be right? What about the pipeline at the beginning of this conversation?

both looks OK

@dvargas74
Copy link
Author

Then, what could be the problem?
This is very important for us. Any idea about what I can do?
Does the code above work fine on your end?

@rouault
Copy link
Member

rouault commented Jun 5, 2024

Does the code above work fine on your end?

yes, it does (and the related tests runs fine on the continuation integration on all major platforms):

I've just successfully tested the following:

$ cat test.cpp
#include <stdio.h>
#include <proj.h>

int main() {
    PJ_COORD source = proj_coord(-598000.000, -1160020.000, 0.000, 0);
    PJ_CONTEXT* context = proj_context_create();
    PJ *pj = proj_create(context, "+proj=gridshift +grids=test_gridshift_projected.tif");
    PJ_COORD res = proj_trans(pj, PJ_FWD, source);
    printf("%f %f\n", res.xy.x, res.xy.y);
    PJ_COORD res2 = proj_trans(pj, PJ_INV, res);
    printf("%f %f\n", res2.xy.x, res2.xy.y);

    return 0;
}

$ g++ -I../src test.cpp -o mytest -Llib -lproj && LD_LIBRARY_PATH=$PWD/lib PROJ_DATA=data/for_tests/tests:data PROJ_DEBUG=ON ./mytest 
pj_open_lib(proj.ini): call fopen(data/proj.ini) - succeeded
pj_open_lib(proj.db): call fopen(data/proj.db) - succeeded
pj_open_lib(test_gridshift_projected.tif): call fopen(data/for_tests/tests/test_gridshift_projected.tif) - succeeded
-5597999.884995 -6160019.977850
-598000.000000 -1160020.000000

Then, what could be the problem?

I don't know. I'm pretty bad at diagnosing issues I can't reproduce locally. Maybe compare the log messages you get by setting PROJ_DEBUG=ON with the ones above. Otherwise I have nothing better to suggest than running through a debugger and stepping ...

@dvargas74
Copy link
Author

Thank you so much for your help. I'll check, again, everything on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants