Hi,

I did something similar to what Doug suggested using the GDAL python bindings to get the size, projection and pixel size of an image, then cropping and re projecting to match using gdalwarp.
You can view the code at:

https://bitbucket.org/petebunting/rsgis_scripts/src/c999df5483d3ed988feac016008f7623a28a484e/GDAL/subsetImage2Image.py?at=default

Hope this helps,

Thanks,

Dan

On 23/04/13 12:00, gdal-dev-requ...@lists.osgeo.org wrote:
Message: 7 Date: Tue, 23 Apr 2013 14:15:25 -0400 From: "Newcomb, Doug" <doug_newc...@fws.gov> To: Jonathan Greenberg <j...@illinois.edu> Cc: gdal dev <gdal-dev@lists.osgeo.org> Subject: Re: [gdal-dev] Cropping to another image? Message-ID: <CALQGVr1Abv2OubqRFVWF1=ljkftnqrcw_19ebdbe5vf6vcr...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" --j, I you wanted to use the gdal utility programs , you can use gdalinfo to get the extent of the first image and use gdal_translate -projwin with the coordinates you captured from the first command. There are a couple of ways to pythonify those two commands or other python methods into a single script for batch processing, see http://www.gdal.org/gdal_tutorial.html Doug On Tue, Apr 23, 2013 at 12:47 PM, Jonathan Greenberg <j...@illinois.edu>wrote:
>GDALers:
>
>Is there a way to easily crop one image to the the extent of another image?
>
>--j
>
>--
>Jonathan A. Greenberg, PhD
>Assistant Professor
>Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
>Department of Geography and Geographic Information Science
>University of Illinois at Urbana-Champaign
>607 South Mathews Avenue, MC 150
>Urbana, IL 61801
>Phone: 217-300-1924
>http://www.geog.illinois.edu/~jgrn/
>AIM: jgrn307, MSN:jgrn...@hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>_______________________________________________
>gdal-dev mailing list
>gdal-dev@lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to