I have transform vector that I have gotten from bbox with sentinelhub:
transform=bbox.get_transform_vector(10,10)
>>>
(-101.7359960059834, 10.0, 0, 20.8312118894487, 0, -10.0)
The type of this affine vector is tuple:
type(transform)
>>>tuple
I want to define this transform to be affine transform in rasterio, e.g to change it type to be affine.Affine a,so it will look like this:
Affine((-101.7359960059834, 10.0, 0, 20.8312118894487, 0, -10.0)
I haven't found any way to change it, I have tried:
#try1
Affine(transform)
#try2
affine(transform)
but obviously non of them work.
I have also tried:
rasterio.transform.guard_transform(transform)
but then I get this error:
TypeError: GDAL-style transforms have been deprecated. This exception
will be raised for a period of time to highlight potentially confusing
errors, but will eventually be removed.
I still haven't found the way to create affine type from tuple.
My end goal: to get my tuple as type affine in rasterio
Best Answer
If you do this:
it is corroborated that correct method is 'Affine'. So, by using following command you have desired answer without any error.
You can get same result as follows:
With a help to rasterio.Affine;
So, when you do:
you got an error because you require 6 positional arguments as float (not a tuple).