[Gdal-dev] Re: [GRASSLIST:6144] r.proj and gdawarp give differernt
results
Paul Kelly
paul-grass at stjohnspoint.co.uk
Sun Mar 13 14:41:30 EST 2005
Hello Maciek
On Sun, 13 Mar 2005, Maciek Sieczka wrote:
> The problem is that output of r.proj and gdalwarp is always different,
> although the projection parameters and resampling method used are identical
> in both approaches.
[...]
> In case presented here the shift is 14.25 m - resolution of ETM pan. Please
> see the attached screendumps. This phenomenon is not limited to the
> projections used in this example and occures in any resolution. Depending on
> the amount of rotation required during the reprojection, the rows interval,
> seperating the identically and differeretly reprojected parts of image,
> differs.
>
> Would it be a bug or a result of different reprojection algorithms?
Well they are different in the sense that (as far as I understand it)
gdalwarp is a forward projection designed for projecting whole images
where the image *is* the region of interest and you don't have prior
knowledge of the boundary co-ordinates in the new co-ordinate system.
r.proj is more a backward projection where you have a region of interest
in a new co-ordinate system and you want to take the portion of the image
that overlaps with your new system and project it in there. So r.proj
does a backward projection for every cell in the new region, and does an
interpolation to find the most appropriate pixels in the original image
to re-sample in there.
> Since these two methods differ which one is right or better?
It depends on whether you are converting a whole image to another
projection for unknown future uses or sending it on to someone else (use
gdalwarp), or are working on a GIS project covering a certain area and you
need to project in data from a different source that covers the region you
are working on (use r.proj).
There is plenty of detail in the r.proj man page on how it works but not
so much in the gdalwarp page so I could be wrong with what I said about
the forward projection. In particular, I'm not too sure at all how it
decides what the grid layout in the projected image should be.
But maybe these ideas will put you on the right track to understanding the
difference.
Paul
More information about the Gdal-dev
mailing list