Date
1 - 4 of 4
Calculate transformation using output dimensions
Denis Rykov
In gdalwarp we have at least two options for managing of output size of a raster:
But how I can calculate transformation (destination affine first of all) if I know output dimensions (width and height)? In other words I'm looking for how I can achieve the same result with rasterio as with gdalwarp ts option. I hope what I have requested is possible.
|
|
Alan Snow
Looks like you are most of the way there.
If you have a dataset open with `rasterio.open`, then you should be able to get the information you need for the input: with rasterio.open('/path/do/dataset.tif') as rds: left, bottom, right, top = rds.bounds src_crs = rds.crs width = rds.width height = rds.height
|
|
Alan Snow
This may be what you are looking for as well:
rasterio.transform.from_bounds
|
|
Denis Rykov
Thanks for reply.
I could not find what I need in rasterio and have created PR: https://github.com/mapbox/rasterio/pull/1409
|
|