[gdal-dev] Need some inputs on using GDAL.

Belaid MOA belaid_moa at hotmail.com
Thu Jun 11 22:14:29 EDT 2009


Greetings Everyone,
  
   I would like to programmtically use GDAL to write a C++ program that takes two Geotiff images and uses the first image to create a mask that will be applied to the second image. The first image geographically contains the second image. The mask is computed from the first image using certain criteria on the values of its pixels. The mask is used to limit the processing of the second image into only the areas specified by the mask. The results of the processing is a new image that has the same projections as the second image.

  A first elementray solution I was thinking of is to use GDALCreateGenImgProjTransformer()  to create the transformer between the first and the second image. Then, loop over the pixels of the second image and call GDALGenImgProjTransform() to find the corresponding pixel in the first image, compute the mask, and process the pixel of the first image accordingly. The results of the processing are written into disk using Create()

   1- Any inputs on how to improve this elementray solution? Is it possible to use GDALWrapper for that?
   2- Is there an easy way for creating an output file with the same metadata as the second image?
   3- Is there any code I can look at for doing the masking?
      
  Any help on this is very appreciated.

 Thanks a lot in advance.

~Belaid...

  
 
_________________________________________________________________
Windows Live helps you keep up with all your friends, in one place.
http://go.microsoft.com/?linkid=9660826
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090612/bf724580/attachment.html


More information about the gdal-dev mailing list