[gdal-dev] pixel/line mapping for two images.

Chris.Barker at noaa.gov Chris.Barker at noaa.gov
Wed Sep 16 12:58:31 EDT 2009


Belaid MOA wrote:
> Thanks for the reply. I do not see how anti-aliasing techniques could be 
> used here.

anti-aliasing when warping rasters requires computing how much the 
pixels of the source and destination overlap each-other.

> Does anyone else have simple answers to the two elementary questions?

sure:

>  > > According to GDAL code, a pixel/line (i,j), more precisely its center
>  > > (i+0.5,j+0.5), of the first image is mapped to the pixel/line (p,q) 
> of the
>  > > second image, where p and q are doubles that usually have fraction 
> parts.
>  > > My questions are: what is the meaning for these fractions?

the point in the middle of a pixel in the source raster represents a 
particular lat-long location -- p and q are the location in the second 
image for  the same lat-long -- chances are slim that it's going to land 
exactly on a pixel boundary, hence the fraction. Just like the middle of 
the source pixel is i+0.5, j+0.5, the middle of a destination pixel 
would be p+0.5, q+0.5.

 > Is it  possible to use these fractions to compute the overlap between
> the pixels of the two images using GDAL?

yup -- think about the above, and do a little arithmatic (which i s the 
arithmetic done in the anti-aliasing code.

HTH,

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the gdal-dev mailing list