I have rasters in a PostGIS database that are not necessarily aligned (some rasters offset from the grid). I want to use
ST_SnapToGrid to align all rasters to the same grid but have some questions about how it works using nearest neighbors.
Which of these ways is how nearest neighbors works?
If the pixels are aligned then it is just the value of the source pixel, but otherwise the target pixel takes on the value of the closest source pixel. This would be akin to "moving" the pixel into the correct place.
The target pixel takes the average of the nearest neighbors, such that it might overlap 99% with source pixel A and 1% with source pixel B but take the averages of these pixels to be the value of the target pixel.
Some other way?