<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jul 3, 2008, at 5:49 AM, Harun ÖZTÜRK wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; ">Hi everyone,<br>&nbsp;<br>Is there a simple way to crop same part of raster using via gdal. Could<br>somebody send sample or usage of this operation? Thanks.<br></div></span></blockquote><br></div><div>gdal_rasterize (<a href="http://www.gdal.org/gdal_rasterize.html)">http://www.gdal.org/gdal_rasterize.html)</a> is worth a look. It is the only way I have found to do raster clips using a vector. It will not trim or crop the actual raster, so you likely want to reduce the raster to a rectangle that covers the coordinates of interest. You can use gdal_translate with the -projwin option, or use gdalwarp with the -te option.</div><div><br></div><div>Example crop:</div><div>gdal_rasterize -b 1 -b 2 -b 3 -burn 255 -l shapefile_layer_name -i shapefile.shp raster_file.tif</div><div><br></div><div>Regards,</div><div>John</div></body></html>