Closed mdsumner closed 5 months ago
Thanks Michael, we should probably raise ValueError
on such inputs, PR is welcome. 0
should be allowed though, I would not clip to 0
however, raise an error when negative dimensions are requested, or whatever numpy.zeros
would do in such case , which is ValueError: negative dimensions are not allowed
.
sorry, is that typo about allowing 0?
I can't tell if you mean
or something else I'm not understanding (?)
0 is ok, less than 0 is not
I was just getting into this ... thanks! haha
I noticed that values of
shape
can be negative, this doesn't seem desirable, it has the effect of flipping the transform as expected.I only noticed because I wanted to do the GDAL thing of setting one of the dimensions to zero, whereby you only need to use the shape of one side and it helpfully calculates the other from the aspect ratio of the extent. This is nice because it gives a very short heuristic for "about this detailed" that matches how images work, rather than having to specify a specific resolution or do gymnastics to work out the ratio.
So, maybe negative shape should be disallowed, and if it's of interest I could PR the
shape = [0, n]
orshape = [n, 0]
.Thanks!