[gdal-dev] GDALDataset creation from Image subset

Chaitanya kumar CH chaitanya.ch at gmail.com
Thu Jul 8 06:33:10 EDT 2010


Francois,

This is what gdal_translate utility does with the '-srcwin' option. You can
see it's code at
http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_translate.cpp
You need to translate the projection window according to the block within
the image. For that you have to modify the transformation matrix from
GDALGetGeoTransform() and and set a new one with GDALSetGeoTransform().

On Thu, Jul 8, 2010 at 3:47 PM, Francois Maass <fieliesm at gmail.com> wrote:

> Good day list!
>
> I have an image (Tiff or Pix) read into a GDALDataset as well as the
> following:
> 1. The (x,y) coordinates/offset of the top-left corner of a block within
> the image,
> 2. The width and length of the block
>
> I want to create a GDALDataset that only contains this specific block of
> the given image.
> Simply put, I want to extract a little block or chip from an existing
> GDALDataset, and put it into its own GDALDataset.
>
> Can this be done, and how?
> Thank you for your time and efforts!
>
> Warm Regards,
> Francois Maass
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100708/bf1182a3/attachment.html


More information about the gdal-dev mailing list