<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=925041413-25042005><FONT face=Arial
color=#0000ff size=2>Nick -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=925041413-25042005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=925041413-25042005><FONT face=Arial
color=#0000ff size=2>Gdalwarp "warps" an image from one representation to
another. That can be a change in projection, or a change in spatial
resolution, or both (or neither, I suppose <g>). I wasn't
specifically talking about creating pyramids, although that is another option
you should investigate.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=925041413-25042005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=925041413-25042005><FONT face=Arial
color=#0000ff size=2> - Ed</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=925041413-25042005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=925041413-25042005><FONT face=Arial
color=#0000ff size=2>
<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>ed@topozone.com<BR>(978) 251-4242
</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>Nick
Dabner<BR><B>Sent:</B> Monday, April 25, 2005 1:58 AM<BR><B>To:</B>
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> Re: [UMN_MAPSERVER-USERS]
Zooming to match a raster scale<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/enriched format -->
<DIV>Ed, </DIV><BR>
<DIV>Thanks for the quick response. Followed your workings and got what is a
near perfect match for another scale. In doing so, I can see how is resolution
is used, which was some explanation I hadn't found detailed elsewhere. Kept it
at 72 dpi. </DIV><BR>
<DIV>Yes, preview is slow, but the results are nice. Gdalwarp changes
projections if I am not mistaken. Do you mean gdal_translate to create the
raster pyramids? Will have to give this a try later today as my rasters do vary,
especially with inner-city areas. It loooks like I would supply the output size
in pixels (x,y) to get the the desired scale. </DIV><BR>
<DIV>Definately info like this is helpful for us non-geo-versed. Need this kind
of info in the --verbose docs! </DIV><BR>
<DIV>Cheers, </DIV><BR>
<DIV>Nick </DIV><BR>
<DIV>On 25/04/2005, at 11:55 AM, Ed McNierney wrote: </DIV><BR>
<BLOCKQUOTE>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>Nick -</SMALL></FONT></FONT>
</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>I'm not sure what your "unit"
is supposed to mean, but I can describe the process for taking the pixel size
and finding the right MINSCALE/MAXSCALE values.</SMALL></FONT></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>The MINSCALE and MAXSCALE
values are the denominators of scale ratios, like 1:10,000 scale.
MINSCALE 10000 means "a minimum scale of 1:10,000", where one meter on the map
equals 10,000 meters on the ground. The problem becomes, "what's one
meter on the map"?</SMALL></FONT></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>The RESOLUTION statement
answers that question. The default value is 72, meaning that 72 pixels
in a MapServer output image are presumed to occupy one inch on the
screen. This is actually unlikely to be an accurate value unless you're
running a 20-year-old Macintosh, but it often doesn't matter - it's
mostly used for internal calculations.</SMALL></FONT></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>So, if 72 pixels are presumed
to cover one inch on the screen, and your image has a source resolution of
1.26956817 meters per pixel, then one inch on the screen will show 72 *
1.26956817 meters or 91.40890824 meters of image. Since 91.40890824
meters equals 3598.7687 inches, this means one inch on the screen shows
3598.7687 inches on the ground - a scale ratio of
1:3598.7687</SMALL></FONT></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>If you displayed that image
at the "scale" of 3598.7687 you should get a pixel-for-pixel replica of your
source image. If you use a different RESOLUTION statement, you need to
adjust accordingly.</SMALL></FONT></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>For calculating the IMGEXT
values, you simply need to make the X extent and Y extent equal the number of
(X or Y) pixels in the image times 1.26956817.</SMALL></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#000ff0><SMALL>Yes, there are better-quality
ways of resampling images, but - as you saw in Preview - they're slow.
MapServer doesn't use them, but you can use various tools (including gdalwarp,
from the GDAL distribution) to resample images offline and create "pyramids"
of varying resolutions. This will improve the display quality of your
images while keeping the performance fast - at the expense of extra disk space
and preprocessing work.</SMALL></FONT></FONT> </DIV>
<DIV> </DIV>
<DIV> <FONT face=Arial><FONT color=#000ff0><SMALL>-
Ed</SMALL></FONT></FONT> </DIV><BR>
<DIV><SMALL>Ed McNierney</SMALL> </DIV></BLOCKQUOTE></BODY></HTML>