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

Off-by-one in Robinson projection? #1172

Closed
QuLogic opened this Issue Nov 13, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@QuLogic
Copy link
Contributor

QuLogic commented Nov 13, 2018

In Robinson, i is limited by:

proj.4/src/PJ_robin.c

Lines 87 to 91 in 330e8bf

if( i < 0 ){
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
}
if (i >= NODES) i = NODES - 1;

to 0 <= i <= NODES - 1 and i + 1 is never used in s_forward. Here, NODES is set to 18, but there are 19 entries in X and Y. In s_inverse, i + 1 is used.

So, is the last entry in the X and Y tables supposed to be applied in s_forward (and accidentally not), or is it only there for s_inverse? If this is intentional, I guess a comment would be helpful to make this clear. Of am I just misreading something here?

@kbevers

This comment has been minimized.

Copy link
Member

kbevers commented Nov 13, 2018

I have no idea, to be honest. It does seem plausible that there's been made a mistake here. Usually when these types of problems show up I have a look in the original papers that describe the projection. I haven't got the time for that at the moment so I would suggest you do that yourself if you need a quick answer to this :-)

rouault added a commit to rouault/proj.4 that referenced this issue Feb 24, 2019

@kbevers kbevers closed this in 9118523 Feb 24, 2019

kbevers added a commit that referenced this issue Feb 24, 2019

Merge pull request #1292 from rouault/fix_robinson
Robinson: fix wrong values for forward path for latitudes >= 87.5 (fixes #1172), and fix inaccurace inverse method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.