<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=500194602-27032007><FONT face=Arial
color=#0000ff size=2>John -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500194602-27032007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=500194602-27032007><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500194602-27032007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=500194602-27032007> <FONT
face=Arial color=#0000ff size=2>- Ed</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500194602-27032007><FONT face=Arial
color=#0000ff size=2><!-- Converted from text/plain format -->
<P><FONT size=2>Ed McNierney<BR>President and Chief Mapmaker<BR>TopoZone.com /
Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North Chelmsford,
MA 01863<BR>Phone: +1 (978) 251-4242<BR>Fax: +1 (978)
251-1396<BR>ed@topozone.com</FONT> </P></FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List
[mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <B>On Behalf Of </B>John
Mitchell<BR><B>Sent:</B> Monday, March 26, 2007 10:24 PM<BR><B>To:</B>
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> 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<BR></FONT><BR></DIV>
<DIV></DIV>Frank,<BR><BR>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?<BR><BR>Thanks,<BR><BR>John Mitchell<BR><BR>
<DIV><SPAN class=gmail_quote>On 3/26/07, <B class=gmail_sendername>Frank
Warmerdam</B> <<A
href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">John
Mitchell wrote:<BR>> Hi,<BR>><BR>> When are overviews displayed (i.e.
at what scale range will a 1/2<BR>> resolution overview be displayed) for a
6 inch geotiff that has gdaladdo<BR>> -r average file.tif 2 4 8 16 32 64
128<BR>> run against.<BR><BR>John,<BR><BR>Based on my re-reading of
GDALRasterBand::OverviewRasterIO() in<BR>gdal/gcore/rasterio.cpp an overview
level will be used if the overviews<BR>resolution is no more than 1.2 times
the requested resolution of a<BR>RasterIO() request.<BR><BR>So if you had a
base layer of 30m x 30m pixels, and an overview of 60m x 60m<BR>pixels, and
you made a request at 49m resolution the full resolution imagery <BR>would be
used, while at 51m resolution the 60m overview would be used.<BR><BR>Does this
help?<BR><BR>Rules may vary for format drivers that implement their own
overview<BR>support - but this rule of thumb should apply to the generic GDAL
overview <BR>support.<BR><BR>Best
regards,<BR>--<BR>---------------------------------------+--------------------------------------<BR>I
set the clouds in motion - turn up | Frank Warmerdam, <A
href="mailto:warmerdam@pobox.com">warmerdam@pobox.com </A><BR>light and sound
- activate the windows | <A
href="http://pobox.com/~warmerdam">http://pobox.com/~warmerdam</A><BR>and
watch the world go round - Rush | President OSGeo, <A
href="http://osgeo.org">http://osgeo.org </A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>John J. Mitchell </BODY></HTML>