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

Incorrect Bilinear and cubicspline resampling at the poles #10524

Open
ThalesMML opened this issue Jul 30, 2024 · 3 comments
Open

Incorrect Bilinear and cubicspline resampling at the poles #10524

ThalesMML opened this issue Jul 30, 2024 · 3 comments

Comments

@ThalesMML
Copy link

What is the bug?

Firstly, "average" resampling method works correclty. But bilinear and cubicspline don't. I use GDAL to create six 8192x8192 files from 21600x10800 height map. About an area of 1024x4800 pixels on both poles are excessively blurred if bilinear or cubicspline are used instead of average.

Steps to reproduce the issue

Use bilinear and average resmaplings to create north face of cubic world map.

These are the lines I use from the guide here: https://medievalengineerswiki.com/w/Planet_Modding/Real_World_Data

gdal_translate ETOPO1_Bed_g_geotiff.tif -scale -12000 12000 0 65535 -ot UInt16 -a_srs "+proj=longlat" ETOPO1_editable.tif
gdal_translate ETOPO1_editable.tif ETOPO1_editable.vrt

set PROJ_IGNORE_CELESTIAL_BODY=YES
set GDAL_PAM_ENABLED=NO

gdal_translate up.vrt up.tif -co COPY_SRC_MDD=YES
gdalwarp -dstnodata None -r average -wt Float32 -multi -wo SOURCE_EXTRA=100 -wo SAMPLE_GRID=YES ETOPO1_editable.vrt up.tif

Versions and provenance

Windows 11
GDAL 3.9.1
Miniconda3

Additional context

No response

@mdsumner
Copy link
Contributor

mdsumner commented Aug 1, 2024

can you show graphics of what you see in the problem areas? This is a very strange bend of the use of the warper geolocation method, using a geolocation array that might as well be an assigned transform (or bbox).

I think you can probably use QSC (Quadrilateralized Spherical Cube) instead, and give those "real world" target extents (earth radius) for this source as per the example on this page, and then convert those to suitable PNGs.

https://proj.org/en/9.4/operations/projections/qsc.html

But, if you could show some images of what you see for a face vs what you expect (I have some residual doubts I'm doing something wrong, - the faces I see in this method give approximately the same whole-world longlat as output, which can't be right - but at any rate I think you can shortcut it all using QSC with one source input rather than crafting the gnomonic faces like this).

@ThalesMML
Copy link
Author

ThalesMML commented Aug 2, 2024

Blurred area for South pole:
blurred_area
This image has not enough resolution to show excessive blur, it is just for showing boundaries of blurred area which immediately stops outside of it.

North pole has blurred area same size but it is positioned right next to this.

@rouault
Copy link
Member

rouault commented Aug 12, 2024

Likely same issue as #10512

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

3 participants