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

Inverse +proj=cass: fix non-convergence on inputs where easting=false_easting or northing=false_northing #4386

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

rouault
Copy link
Member

@rouault rouault commented Jan 17, 2025

Fixes #4385

For a unknown reason, a test in pj_generic_inverse_2d() was skipping adding the iterative correction terms when the input was such that easting=false_easting or northing=false_northing, causing the function to do nothing useful and fail after its maximum allowed number of iterations was reached. The remove tests might or might not have been needed... Only future will tell...

…_easting or northing=false_northing

Fixes OSGeo#4385

For a unknown reason, a test in pj_generic_inverse_2d() was skipping
adding the iterative correction terms when the input was such that
easting=false_easting or northing=false_northing, causing the function
to do nothing useful and fail after its maximum allowed number of
iterations was reached. The remove tests might or might not have been
needed... Only future will tell...
@rouault rouault added the funded through GSP Work funded through the GDAL Sponsorship Program label Jan 17, 2025
@rouault rouault added this to the 9.6.0 milestone Jan 17, 2025
Copy link
Contributor

@jjimenezshaw jjimenezshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pj_generic_inverse_2d is used in
src/projections/cass.cpp
src/projections/adams.cpp (three times)
src/projections/wink2.cpp

Should we test those projections in that circumstance as well?

@rouault
Copy link
Member Author

rouault commented Jan 17, 2025

Should we test those projections in that circumstance as well?

Seems to work fine.

$ echo 0 0 | bin/proj +proj=adams_ws2 +x_0=100000 +y_0=200000 | bin/proj -I +proj=adams_ws2 +x_0=100000 +y_0=200000
0dE 0dN

$ echo 0 0 | bin/proj +proj=wink2 +x_0=100000 +y_0=200000 | bin/proj -I +proj=wink2 +x_0=100000 +y_0=200000
0dE 0dN

@jjimenezshaw
Copy link
Contributor

$ echo 0 0 | bin/proj +proj=adams_ws2 +x_0=100000 +y_0=200000 | bin/proj -I +proj=adams_ws2 +x_0=100000 +y_0=200000

Should it be this to change around the y=0 once applied the false northing?
echo 300000 200000 | bin/proj +proj=adams_ws2 +x_0=100000 +y_0=200000

@rouault
Copy link
Member Author

rouault commented Jan 17, 2025

Should it be this to change around the y=0 once applied the false northing?
echo 300000 200000 | bin/proj +proj=adams_ws2 +x_0=100000 +y_0=200000

hum, you meant with the -I flag right?

Wrks fine:

$ echo 300000 200000 | bin/proj -d 8 -I +proj=adams_ws2 +x_0=100000 +y_0=200000
3.59296648 0.00000000

$ echo 3.59296648 0.00000000 | bin/proj -d 8 +proj=adams_ws2 +x_0=100000 +y_0=200000
300000.00005671 200000.00000000

@rouault rouault merged commit e1733c3 into OSGeo:master Jan 18, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
funded through GSP Work funded through the GDAL Sponsorship Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cassini projection on some 100km points fails
2 participants