<!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=515541803-26042005><FONT face=Arial 
color=#0000ff size=2>Nick -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=515541803-26042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=515541803-26042005><FONT face=Arial 
color=#0000ff size=2>gdalwarp lets you specify the desired output resolution 
with the -tr parameter, so you <STRONG>can</STRONG> say you want the output 
image to be 2.59 m/p.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=515541803-26042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=515541803-26042005><FONT face=Arial><FONT 
size=2><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp; - 
Ed</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=515541803-26042005><FONT face=Arial><FONT 
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&nbsp; 01863<BR>Phone: +1 (978) 251-4242<BR>Fax: +1 (978) 
251-1396<BR>ed@topozone.com</FONT> </P></SPAN></DIV></FONT></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Nick Dabner 
[mailto:dabner@optusnet.com.au] <BR><B>Sent:</B> Monday, April 25, 2005 7:33 
PM<BR><B>To:</B> Ed McNierney<BR><B>Cc:</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>Ah, yes. I see. Shame I can't specify I want 2.59 metres per pixel rather 
than xpixels and ypixels. This would allow conversion of a folder of various 
sizes images to a consistent scale. </DIV><BR>
<DIV>Cheers, </DIV><BR>
<DIV>Nick </DIV><BR>
<DIV>On 25/04/2005, at 11:15 PM, Ed McNierney wrote: </DIV><BR>
<BLOCKQUOTE>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>Nick -</SMALL></FONT></FONT> 
  </DIV>
  <DIV> </DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>Gdalwarp "warps" an image 
  from one representation to another.&nbsp; That can be a change in projection, 
  or a change in spatial resolution, or both (or neither, I suppose 
  &lt;g&gt;).&nbsp; I wasn't specifically talking about creating pyramids, 
  although that is another option you should investigate.</SMALL></FONT></FONT> 
  </DIV>
  <DIV> </DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>&nbsp;&nbsp;&nbsp;&nbsp; - 
  Ed</SMALL></FONT></FONT> </DIV>
  <DIV> </DIV><BR>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>Ed 
  McNierney</SMALL></FONT></FONT> </DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>President and Chief 
  Mapmaker</SMALL></FONT></FONT> </DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>TopoZone.com / Maps a la 
  carte, Inc.</SMALL></FONT></FONT> </DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>73 Princeton Street, Suite 
  305</SMALL></FONT></FONT> </DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>North Chelmsford, MA&nbsp; 
  01863</SMALL></FONT></FONT> </DIV>
  <DIV><FONT face=Arial><FONT 
  color=#0000ff><SMALL>ed@topozone.com</SMALL></FONT></FONT> </DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><SMALL>(978) 
  251-4242</SMALL></FONT></FONT> </DIV><BR>
  <DIV><B><FONT face=Tahoma><SMALL>From:</SMALL></FONT></B><FONT 
  face=Tahoma><SMALL> UMN MapServer Users List 
  [mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <B>On Behalf Of </B>Nick 
  Dabner</SMALL></FONT> </DIV>
  <DIV><B><FONT face=Tahoma><SMALL>Sent:</SMALL></FONT></B><FONT 
  face=Tahoma><SMALL> Monday, April 25, 2005 1:58 AM</SMALL></FONT> </DIV>
  <DIV><B><FONT face=Tahoma><SMALL>To:</SMALL></FONT></B><FONT 
  face=Tahoma><SMALL> MAPSERVER-USERS@LISTS.UMN.EDU</SMALL></FONT> </DIV>
  <DIV><B><FONT face=Tahoma><SMALL>Subject:</SMALL></FONT></B><FONT 
  face=Tahoma><SMALL> Re: [UMN_MAPSERVER-USERS] Zooming to match a raster 
  scale</SMALL></FONT> </DIV><BR>
  <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><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><FONT face=Arial><FONT color=#000ff0><SMALL>The MINSCALE and MAXSCALE 
    values are the denominators of scale ratios, like 1:10,000 scale.&nbsp; 
    MINSCALE 10000 means "a minimum scale of 1:10,000", where one meter on the 
    map equals 10,000 meters on the ground.&nbsp; The problem becomes, "what's 
    one meter on the map"?</SMALL></FONT></FONT> </DIV>
    <DIV><FONT face=Arial><FONT color=#000ff0><SMALL>The RESOLUTION statement 
    answers that question.&nbsp; The default value is 72, meaning that 72 pixels 
    in a MapServer output image are presumed to occupy one inch on the 
    screen.&nbsp; This is actually unlikely to be an accurate value unless 
    you're running a 20-year-old Macintosh, but it often doesn't matter&nbsp;- 
    it's mostly used for internal calculations.</SMALL></FONT></FONT> </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.&nbsp; 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><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.&nbsp; If you use a different RESOLUTION statement, you need to 
    adjust accordingly.</SMALL></FONT></FONT> </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.&nbsp; 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.&nbsp; 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>&nbsp;&nbsp;&nbsp; <FONT face=Arial><FONT color=#000ff0><SMALL>- 
    Ed</SMALL></FONT></FONT> </DIV><BR>
    <DIV><SMALL>Ed McNierney</SMALL> </DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>