Re: [gdal-dev] Using RasterIO in Python to crop images

2010-01-20 Thread Jose Gomez-Dans
Hi, 2010/1/19 Roger André ran...@gmail.com Assuming that I have an 8bit, paletted image named foo.png, if I wanted to extract a 50 x 50 pixel tile that had it's origin at pixel coords (0,0), I would do something like this: in_ds = gdal.Open('foo.png') band = dataset.GetRasterBand(1)

[gdal-dev] Using RasterIO in Python to crop images

2010-01-18 Thread Roger André
Hi all, I'd like to do some cropping based on pixel coordinates in a script I'm writing. I'm familiar with using the srcwin option to gdal_translate, but have not done this using the API before. Reading the API docs and some of the previous postings to this list, it appears that the RasterIO