Let's say I want to write a single pixel or a 1D array of pixels (e.g.all at the same latitude) of pixels to a single-band of a Float32 GeoTIFF using the Python GDAL bindings. How can I do so? Or is it not possible?
I currently have the following method for truly 2D ndarrays. But occasionally I get requests for a pixel or line of pixels, which cause this method to fail.
I'm trying to write a new image where the entire extent of the new image is either just one pixel or just a line of pixels. Thus, I've tried just setting xoff and yoff to 0, and this fails the same way as without xoff and yoff. The error I'm getting is
expected array of dim 2, e.g. when the shape of my ndarray is
(4,) (and when the GDAL raster is initialized with
RasterXSize to 4 and
RasterYSize to 1 via a pertinent
out_raster.SetGeoTransform (EPSG:4326 location and size) method).