Add function for coordinates transform X, Y => Row, Col
Since I had to do this using external lib (Rasterio), I thought it would be great to add this function to pyotb.
It's pretty straightforward :
spacing_x, _, origin_x, _, spacing_y, origin_y = self.transform
col = int((x - origin_x) / spacing_x)
row = int((origin_y - y) / spacing_y)
To make this easier I'll move the geotransform code out of to_rasterio
in order to add a new transform
property, rasterio style (as we did for shape
and dtype
).
Edited by Cresson Remi