<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Greetings Everyone,<br> <br> 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.<br><br> A first elementray solution I was thinking of is to use <u><a class="code" href="http://www.gdal.org/gdal__alg_8h.html#7671696d085085a0bfba3c3df9ffcc0a" title="Create image to image transformer.">GDALCreateGenImgProjTransformer()</a></u> to create the transformer between the first and the second image. Then, loop over the pixels of the second image and call <u>GDALGenImgProjTransform()</u> 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 <u>Create()</u><br><br> 1- Any inputs on how to improve this elementray solution? Is it possible to use GDALWrapper for that?<br> 2- Is there an easy way for creating an output file with the same metadata as the second image?<br> 3- Is there any code I can look at for doing the masking?<br> <u></u> <br> Any help on this is very appreciated.<br><br> Thanks a lot in advance.<br><br>~Belaid...<br><br> <br> <br /><hr />Windows Live helps you keep up with all your friends, <a href='http://go.microsoft.com/?linkid=9660824' target='_new'>in one place.</a></body>
</html>