Problem
resampling goes straight into gdalcubes::cube_view(). The mechanism is the same one that #92 hit for aggregation: gdalcubes 0.7.5 reads a value it does not know as a default and raises no error. For resampling that default is "near".
Measured by round-tripping values through cube_view(...)$resampling:
bilinear -> bilinear
bilinaer -> near
foo -> near
Bilinear -> bilinear # case-insensitive
cubic -> cubic
So dft_stac_cube(aoi, resampling = "bilinaer") returns a nearest-neighbour cube and caches it under the misspelt key, with no warning. The three callers are stac_cube_assemble() (R/dft_stac_cube.R, used by the cube and the composite) and fetch_extent_to() (R/dft_stac_fetch.R).
Ask
Validate resampling the same way #92 validates aggregation:
- Build the allowed set by measuring the
cube_view() round trip, not from ?cube_view.
- Match case-insensitively.
- Run the check before any network call.
- Pin the set with a behaviour test.
Found by the /code-check round-3 review on #92.
Landed (#98, v0.21.0)
The full round trip on gdalcubes 0.7.5 found more than the five values above:
- Twelve come back unchanged and form the allowed set:
near bilinear cubic cubicspline lanczos average mode max min med q1 q3.
- Two are honoured under another name:
mean -> average and median -> med. These are refused, and the error names the spelling to use, so each method has one spelling. Refusing them breaks calls that used to give correct output, hence a minor release.
- Everything else becomes
near, including GDAL's sum, rms and gauss, plus nearest.
The check runs at all three entry points and again at both cube_view() call sites. fetch_extent_to() also gained the #92 aggregation_check() it lacked.
Problem
resamplinggoes straight intogdalcubes::cube_view(). The mechanism is the same one that #92 hit foraggregation: gdalcubes 0.7.5 reads a value it does not know as a default and raises no error. Forresamplingthat default is"near".Measured by round-tripping values through
cube_view(...)$resampling:So
dft_stac_cube(aoi, resampling = "bilinaer")returns a nearest-neighbour cube and caches it under the misspelt key, with no warning. The three callers arestac_cube_assemble()(R/dft_stac_cube.R, used by the cube and the composite) andfetch_extent_to()(R/dft_stac_fetch.R).Ask
Validate
resamplingthe same way #92 validatesaggregation:cube_view()round trip, not from?cube_view.Found by the
/code-checkround-3 review on #92.Landed (#98, v0.21.0)
The full round trip on gdalcubes 0.7.5 found more than the five values above:
near bilinear cubic cubicspline lanczos average mode max min med q1 q3.mean -> averageandmedian -> med. These are refused, and the error names the spelling to use, so each method has one spelling. Refusing them breaks calls that used to give correct output, hence a minor release.near, including GDAL'ssum,rmsandgauss, plusnearest.The check runs at all three entry points and again at both
cube_view()call sites.fetch_extent_to()also gained the #92aggregation_check()it lacked.