[Gdal-dev] modis sinusoidal tiles: bug in gdal?

Frank Warmerdam warmerdam at pobox.com
Tue Nov 6 08:40:24 EST 2007


Vincent Schut wrote:
> The puzzle:
> Then I tried to merge some modis tiles by using VRT, using vrt_merge.py.
> I was very puzzeled when I got an error message telling me it wouldn't
> merge my tiles because they did not have the same scale. 

Vincent,

vrt_merge.py isn't part of GDAL - could you provide a pointer to the
version you are using?

> After some
> investigation, it indeed appeared they didn't! Pixel size (as calculated
> by gdal) is different per tile. At around (0,0) degrees latlong, pixels
> are square and of size 463.312716527916677 meters. The further one goes
> from the equator or 0 deg longitude, the more the pixel size in that
> direction differs from this 463.312716527916677 and pixels are not
> square anymore.

I see the pixels are just very slightly not-square.  The actually bounds
in sinusoidal projection are apparently computed from the lat/long bounds
for the image so they are sensitive to small differences due to floating
point error, and issues in the sinusoidal equations.  I see the differences
are roughly 12 digits into the pixel size and represent a difference in
pixel size of roughly one billionth of a meter or (I think) roughly one
millionth of a meter in the origin/corner values.

I believe the issue is an undue sensitivity to slight differences in
pixel size in vrt_merge.py.

> the gdalinfo's:
> 
> tile h18 v09 (ul = 0,0, note the square pixels)
> Origin = (0.000000000000000,-0.000000000000000)
> Pixel Size = (463.312716527916677,-463.312716527916677)

> 
> tile: h17 v01

> Origin = (-1111950.519667000044137,8895604.157332999631763)
> Pixel Size = (463.312716527916677,-463.312716527499731)

> 
> tile h08 v06
> Origin = (-11119505.196667000651360,3335851.558999999891967)
> Pixel Size = (463.312716527917246,-463.312716527916677)

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the gdal-dev mailing list