You might take a look at whether GMT can do what you need by using the grdmath command. The documentation for it is here, http://gmt.soest.hawaii.edu/gmt/doc/gmt/html/man/grdmath.html. I find that it is a frustratingly difficult tool to learn how to use, but capable of things similar to what you've described below.
Roger -- On Thu, Jun 11, 2009 at 7:14 PM, Belaid MOA <[email protected]> wrote: > 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()<http://www.gdal.org/gdal__alg_8h.html#7671696d085085a0bfba3c3df9ffcc0a> > * 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=9660824> > > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev >
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
