[gdal-dev] crop an image

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Thu Jul 16 15:56:52 EDT 2009


Hello,
I need to crop an image based on a polygon from a shapefile.
Could not figure how to do it so I used gdal_translate and I specified the 
extent of the shapefile like this
gdal_translate -projwin -428734.998712 20337 1.497532 -387578.449250 
172036.180727 EstMtl.img rssMtl.img

But the polygon is irregular. So the new image contains the region I need 
with some extra.  From this new image Is there a way to assign "nodata" to 
pixels outside the irregular polygon?

Or maybe there is a way to crop an image from an irregular polygon?
thanks
Steve


Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090716/70664fec/attachment-0001.html


More information about the gdal-dev mailing list