Closed Multihuntr closed 2 years ago
@Multihuntr thank you for showing the work around. I think we should not add this feature. As you point out, we only have to write one line of code in our applications to batch multiply.
Sure thing. Makes sense.
I think that most people who are using
affine
will also be usingrasterio
and, thus, working withnumpy
arrays. It would be nice to be able to transparently batch convert numpy arrays of coordinates with justanAffine * aNumpyArray
.As far as I know, it's standard to have lists of coordinates in numpy arrays shaped
[..., 2]
because it makes operations like "add (2, 1) to all coordinates" a very simple numpy operation (arr + (2, 1)
).This is what I would like to work:
There is a work-around: you can transpose the input, and combine back into a numpy array with:
But, I think it would be much nicer if
aff * arr
was just supported to do this operation automatically.