Sampling a raster dataset using a regular grid