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

discussion points about "regularizing grids" #8

Open
mdsumner opened this issue Mar 14, 2023 · 1 comment
Open

discussion points about "regularizing grids" #8

mdsumner opened this issue Mar 14, 2023 · 1 comment

Comments

@mdsumner
Copy link
Member

mdsumner commented Mar 14, 2023

There's a huge family of these, and some very different perspectives in the R, Python, and GDAL communities. I wanted to lay out the different cases I'm aware of (and hopefully expand on this with examples and illustrations).

user specifies grid (dim, ext)

  1. gridding from irregular data (griddata, gdal_grid, barycentric triang, kriging, idw, thin-plate spline, gam, akima, other smoothers)

  2. literal points-in-cells (no smoothing)

  3. constructing a regular grid from geolocation arrays (warping ) - this is the usual satellite-swath issue, but lots of details, bowtie, different density of coord arrays, sometimes model meshes fit here, and a mess of how the coord arrays are linked to the data (or not)

grid derived from data

  1. reading from literal XYZ gridded (the GDAL XYZ driver, all points present and exactly regular)

  2. deriving grid from literal XYZ gridded (all points regular, all present or enough to tell) - less limiting than GDAL XYZ

5a) alt, the points have some irregularity (but within noise level, because precisison loss etc, sp Pix and Grid conflated these a bit, and the gridded()<- precision thing is now built into raster, stars and terra in different ways)

  1. detecting regular grid from degenerate rectilinear arrays (that are regular increasing/decreasing or nearly so - GHRSST an example where precision was lost)

  2. detecting regular grid from curvilinear - but the intent was a regular projected grid originally, they just lost that info and stored longlat arrays (the entropy problem!)

(note those last two 6,7 are not warping, literally a human-interpretation and intervention - but warping can work this case too, just warping is literally open ended in terms of grid definition, these are cases where a grid exists but was not specified - sometimes you can guess it out though, like polar sea ice, and there are very very many examples with different details - ocean models, netcdf, grib, etc)

5 and 5a need a bit more thought just wanted to get the rough idea down

@mdsumner
Copy link
Member Author

4, 5 ,and 5a is covered by https://github.com/hypertidy/vaster/blob/main/R/from_xyz.R

3 we can do the basic cases with terra::project() or stars::st_warp (when the dataset has recognized geolocation arrays), when the geo arrays aren't recognized we can create with vapour::vrt(dsn, geolocation = c(xsds, ysds)) and then warp with vapour, terra, stars or elsewhere

bowtie and other complexities aren't covered by gdal

2 is trivial, and 1 has examples in the vignette here - but could be upgraded with better examples and to tie in the GDAL and python analogs

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

1 participant