[FWTools] gdal_retile and calculating resolutions

Frank Warmerdam warmerdam at pobox.com
Mon Sep 7 17:24:47 EST 2009


David R Robison wrote:
> I am using gdal_retile to create an image pyramid. However, I need to 
> create a .properties file to support the 
> org.geotools.gce.imagepyramid.ImagePyramidReader 
> <http://atlas.openplans.org/%7Eaaime/apidocs/org/geotools/gce/imagepyramid/ImagePyramidReader.html>. 
> To fill out the .properties files I need to know the resolution for each 
> level in the pyramid. Is there an easy way to calculate/retrieve the 
> resolution of each level of tiles? Thanks, David

David,

You can see the sizes of overview layers in the gdalinfo output.

eg.

Band 1 Block=512x16 Type=Byte, ColorInterp=Gray
   Overviews: 256x256

In this case the base layer is 512x512 so you can compute the
resolution as being half of the base layer. The base layer description
looks like:

Size is 512, 512
...
Origin = (440720.000000000000000,3751320.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)

So, the overview has the same origin, but a pixel size of 120x120.

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    | Geospatial Programmer for Rent



More information about the FWTools mailing list