You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that with Interpolations.jl and Proj.jl, we can already get native resampling pretty easily using Images.jl's inverse warp functionality. This is only doable if we have a known desired output grid for now, but automatic grid generation doesn't seem like that much of a challenge.
But one thing I've been wondering about is how we would treat the sum, quartile, etc methods of resampling.
I looked into the GDAL code and it looks like they approximate grid cells as quadrilaterals, and then perform intersections between the source and target grids. Basically, you take the grid points in target space, project them back to source space, and perform an intersection-area-weighted-operation on each target grid cell in source space. The GDAL source code is linked here, where you can see what they are doing.
See the graphic below for what the (smooth) projected grid lines look like in target space:
We could even go a step beyond GDAL in correctness (as a stretch goal) and offer subsampled sum/mean/median/etc via OnlineStats and GeometryOps. The effect is probably minimal but may be worth considering for some cases.
But we could even use GDAL's quadrilateral approximation. The only issue is that GDAL's discontinuity handling is fairly complicated, we probably don't want to reimplement that :D
The text was updated successfully, but these errors were encountered:
It seems that with Interpolations.jl and Proj.jl, we can already get native resampling pretty easily using Images.jl's inverse warp functionality. This is only doable if we have a known desired output grid for now, but automatic grid generation doesn't seem like that much of a challenge.
But one thing I've been wondering about is how we would treat the sum, quartile, etc methods of resampling.
I looked into the GDAL code and it looks like they approximate grid cells as quadrilaterals, and then perform intersections between the source and target grids. Basically, you take the grid points in target space, project them back to source space, and perform an intersection-area-weighted-operation on each target grid cell in source space. The GDAL source code is linked here, where you can see what they are doing.
See the graphic below for what the (smooth) projected grid lines look like in target space:
We could even go a step beyond GDAL in correctness (as a stretch goal) and offer subsampled sum/mean/median/etc via OnlineStats and GeometryOps. The effect is probably minimal but may be worth considering for some cases.
But we could even use GDAL's quadrilateral approximation. The only issue is that GDAL's discontinuity handling is fairly complicated, we probably don't want to reimplement that :D
The text was updated successfully, but these errors were encountered: