Title: “Geospatial reprojection in Python 2024 - what’s available and what’s next” Speaker: Max Jones (ORCID: 0000-0003-0180-8928 ) When: Wednesday, September 25, 4PM EDT Where:Launch Meeting - Zoom Abstract:
This Pangeo showcase will cover a work-in-progress guidebook on existing warp resampling / reprojection methods in Python, along with some memory and statistical wall-time profiling results. Following a short presentation, we will discuss tips and tricks along with pain points for geospatial reprojection. Lastly, we’ll brainstorm what’s required to move the ecosystem forward.
In today’s showcase the question came up whether GDAL can provide an index and weights for a warp task, and I had asked this on the mailing list earlier this year. Even Rouault provided a summary of the potential for that and where to look in the source code:
I’ll be pursuing this, I had similar interest for this in exactextract and did enough to actually get hold of the index there, which I will dig up or illustrate if it’s currently possible. I’ve also worked on an entirely abstract approximate polygon rasterization here - rasterization and extracting values are obviously complementary - something that I haven’t found much audience for elsewhere but I think here will find some interest.
I also think that some of the geobox->geobox transformation that is in odc.geo could be used for some of this abstraction, it implements quiet a bit of the warper logic for bespoke use. I’ll try to follow up soon with more actual examples (and less just-talking).
Thanks for the excellent overview and performance testing. I checked on PyResample and probably left the wrong impression during the meeting. The application does split the resampling task into two parts, but the “weights” are not really included in the data returned in the first - just the mapping (indexing) information. I suspect the intention was to split the time consuming processing into the first step, with calculating weights not really being the processing that takes a lot of time, thus could be included in the second step. There was no intention of allowing any “tweaking” of the weights, and I’m not sure any of the algorithms or interpolation methods really lend themselves to this this adjustment.
I too started an assessment of reprojection options last year, but focusing on the different algorithms and interpolation techniques, and on the different quality factors. One of points not addressed above is the risk of sampling errors - leading to aliasing and moiré patterns in the projected outputs. To minimize these, several of the interpolation techniques include “smoothing” functions - e.g., the Elliptical Weighted Average technique in Pyresample, for swath to grid projection, and I believe GDAL’s lanczos (gdalwarp).