[gdal-dev] crop polygon GDAL

John C. Tull john.tull at wildnevada.org
Thu Jul 3 11:50:39 EDT 2008


On Jul 3, 2008, at 5:49 AM, Harun ÖZTÜRK wrote:

> Hi everyone,
>
> Is there a simple way to crop same part of raster using via gdal.  
> Could
> somebody send sample or usage of this operation? Thanks.

gdal_rasterize (http://www.gdal.org/gdal_rasterize.html) 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.

Example crop:
gdal_rasterize -b 1 -b 2 -b 3 -burn 255 -l shapefile_layer_name -i  
shapefile.shp raster_file.tif

Regards,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080703/14f51c4d/attachment.html


More information about the gdal-dev mailing list