
Convenience constructor: derive the transform from extent + dims (or res).
grid_spec.RdGive the pixel grid either directly as dims (nx, ny) or as res (pixel
size), from which dims is derived and the extent snapped to a whole number
of pixels. Exactly one of the two.
Arguments
- crs
CRS string in any GDAL-interpretable form.
- extent
Numeric length 4: xmin, ymin, xmax, ymax.
- dims
Integer dimensions
c(nx, ny). Provide this ORres, not both.- dtype
dtype string from the garry vocabulary.
- res
Pixel resolution in the units of
crs: a scalar (square pixels) orc(xres, yres). Derivesdimsfromextentand snapsextentto a whole number of pixels (anchored at the top-left, so the resolution is exactlyres). Provide this ORdims, not both.
See also
grid_from_bbox() and grid_from_src(), the higher-level
constructors that derive a grid from an area of interest;
GridSpec(), the underlying class constructor.