[Gdal-dev] when are overviews displayed for a 6 inch geotiff that has gdaladdo -r average file.tif 2 4 8 16 32 64 128

Ed McNierney ed at TOPOZONE.COM
Mon Mar 26 19:51:24 PDT 2007


John -
 
In order to calculate a scale ratio, like 1:10,000 you need to know the
output resolution of the image.  The conversion is governed by the value
specified by the MapServer RESOLUTION keyword, which has a default value
of 72 if not otherwise specified.  This is the assumed resolution of the
output image device in pixels per inch.  A scale of 1:10,000 means that
one something on the map equals 10,000 somethings on the ground.  So one
inch on the map equals 10,000 inches on the ground.  Since you know that
one inch on the map equals 72 pixels (through the RESOLUTION setting),
you now know that 72 pixels equals 10,000 inches.  That's a resolution
of 10,000/72 = 138.89 inches per pixel.
 
    - Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 (978) 251-4242
Fax: +1 (978) 251-1396
ed at topozone.com 


________________________________

From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of John Mitchell
Sent: Monday, March 26, 2007 10:24 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] [Gdal-dev] when are overviews
displayed for a 6 inch geotiff that has gdaladdo -r average file.tif 2 4
8 16 32 64 128


Frank,

Thanks for the information.  I am creating external overviews and would
like to use the same algorithm that you described below for internal
overviews.  If I would like an overview to display if the overviews
resolution is no more than 1.2 times the requested resolution, then how
can I convert from resolution to scale so that my minimum scale within
mapserver for an overview matches the correct resolution?

Thanks,

John Mitchell


On 3/26/07, Frank Warmerdam <warmerdam at pobox.com> wrote: 

	John Mitchell wrote:
	> Hi,
	>
	> When are overviews displayed (i.e. at what scale range will a
1/2
	> resolution overview be displayed) for a 6 inch geotiff that
has gdaladdo
	> -r average file.tif 2 4 8 16 32 64 128
	> run against.
	
	John,
	
	Based on my re-reading of GDALRasterBand::OverviewRasterIO() in
	gdal/gcore/rasterio.cpp an overview level will be used if the
overviews
	resolution is no more than 1.2 times the requested resolution of
a
	RasterIO() request.
	
	So if you had a base layer of 30m x 30m pixels, and an overview
of 60m x 60m
	pixels, and you made a request at 49m resolution the full
resolution imagery 
	would be used, while at 51m resolution the 60m overview would be
used.
	
	Does this help?
	
	Rules may vary for format drivers that implement their own
overview
	support - but this rule of thumb should apply to the generic
GDAL overview 
	support.
	
	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 
	
	




-- 
John J. Mitchell 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070326/4c483df2/attachment.htm>


More information about the MapServer-users mailing list