-
Notifications
You must be signed in to change notification settings - Fork 803
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
Fixed rHealpix projection, closing #1206. #1207
Conversation
Thanks for the fix. We can apply it to the 5.2 branch but that isn't going to be very helpful for future releases as I am not expecting to put out a patch release for 5.2. Please open a PR against master instead. Should the need for a 5.2.1 release arise I'll cherry-pick all bug fixes into the 5.2 branch. Regarding tests, you can add them here: https://github.com/OSGeo/proj.4/blob/ac6f0021a3ce6110e5a0a917aec9c0c614443e84/test/gie/builtins.gie#L1911-L1954 Just add another section with your new test coordinates and a bit of text explaining what you are testing. |
Thanks for the hint @kbevers. Changed target to master (w. rebase). |
Nice. It would be great if you can tests that has a few coordinates in each square of the projection. Hopefully we can avoid similar regressions in the future then. |
Was having problems with
Ended up just building it (to get the error above) then running |
Maybe you need to re-run
Does that mean you've created some new tests? |
Numerical test results based on function output, rather than mathematical derivation. Verified global coverage with graphical eyeballing through cartopy.
Great! So this PR is ready for merging now, yes? |
Confirmed. The images above were produced with the changes from this PR, the existing (limited) tests pass, as do the additional tests, so merge away if happy 👍 |
….4 (master / v6.0). Xref: OSGeo/PROJ#1207.
Hi, The data you see here from OpenStreetMap was reprojected from lat/long Geometry storage in PostgreSQL 11.2/PostGIS 2.5.1 to rhealpix, then generalized, and subsequently back-transformed to lat/long Geometry. Considering the strange cut up just over Tasmania and New Zealand, I suspect this is the same issue, as that line corresponds with the envelope of the rhealpix projection. Or am I overlooking another potential issue? In Ubuntu, I see "proj-bin 4.9.3-2" listed as cartographic projection library. |
@pelson. As I ran into an issue with rhealpix, likely caused by this bug as I wrote in the post above, can you elaborate a bit about healpix? Was the healpix projection also affected by this regression in the v4.9.1+ proj libraries, or not? Your current statement leaves me guessing whether or not I can safely switch to healpix instead of rhealpix. If both projections were affected, switching projections would not make sense. |
Well, don't know if this is the whole story, but doing a test with the same Geofabrik extract and using Healpix instead of rHealpix, seems to preliminary indicate that at least Healpix is still working in the v4.9.3-2 library: Would appreciate some formal confirmation though... and I need to do some further testing with other parts of the globe. |
Looks very likely that it is the same issue.
healpix and rhealpix aren't the same (polyhedral) projection, so "safely" is a matter of context. With regards to the bug that was introduced, my comments definitely suggest it did impact both "rHealpix" and plain-old "healpix" (we should call it something like tHealpix, since one is rectangles and the other triangles...), but the extent of the code-changes suggests that a fix was only needed in the rHealpix case. There was quite a lot of churn of The pictures I attached do show the extent of the issue well though, so if you know your region of interest then it may be that switching to Sorry I don't have any more detail than that to hand. |
Hi @pelson Appreciate your response, thanks. Unfortunately, as I understand it now, the issue with the healpix projection will affect me as well, looking at this image you posted of the problem if that is accurate as you state, as I need global coverage: https://user-images.githubusercontent.com/810663/50390569-84d6b900-0730-11e9-842d-308ece1993e1.png So it is clear I will need to wait for an update to PostGIS to include the fix to proj4, or Ubuntu if proj4 is installed by default in Ubuntu and doesn't come with PostGIS... I am not to familiar with this Ubuntu stuff and all these different components like proj4 and their release cycles. Do you potentially have any idea when this change might trickle down to PostGIS and / or Ubuntu? |
Sorry I have no idea. I'd imagine you'll be talking multiple months. The change will be part of the v6.0 release of Proj4, which is due imminently (1st March is the schedule). It is plausible that there will need to be some work downstream to be able to use the new release, and then Ubuntu will need to package it and ensure that all tools using Proj4 are compatible with the new release. In essence - quite a bit of work. Truth be told, if you are using Ubuntu, you might find you can get hold of an old version of Proj4 that doesn't exhibit the bug (v4.9.1 according to my bug report). This is probably the quickest way of "fixing" the issue you are seeing. |
Thanks for the insights. I will need to contemplate other options then. |
NOTE: Targets the 5.2 branch, as this is a bug fix.
I dug into the issue in #1206 and found a patch for the original code. Because the code has been factorized subsequently, it distills down to the following simple change.
No tests yet - any guidance very welcome!