<DIV>
<DIV>
<DIV>Thanks Ed</DIV>
<DIV>&nbsp;</DIV>
<DIV>I had had the Formula correct&nbsp;my gradeschool math teacher would be proud.</DIV>
<DIV>I had a bad extent and image size.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks again for the List help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Todd</DIV>
<DIV><BR><BR><B><I>Ed McNierney &lt;ed@topozone.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Todd -<BR><BR>The first thing you should do is to ensure your geographic and image<BR>extents are proportional; otherwise MapServer will be forced to adjust<BR>your geographic extents and then you'll have to deduce what MapServer<BR>did to change them.<BR><BR>You want to be sure that (MAXX - MINX) / WIDTH = (MAXY - MINY) / HEIGHT<BR>so the width and height of the ground area (in degrees) are proportional<BR>to the width and height of the image (in pixels). In the example you<BR>give, you want (-67 - (-125.3556)) / 449 = (49.5 - 10) / 349 (I'm<BR>guessing on the order of the width and height). That's not an equality,<BR>since it computes to:<BR><BR>0.129968 = 0.138968<BR><BR>You want to change either the extents or the image size.<BR><BR>Once you've done that, you simply divide the width in degrees by the<BR>width in pixels to get "degrees per pixel" or DPP: that is, DPP = (MAXX<BR>-
 MINX) / WIDTH. Then the pixel at horizontal coordinate X will have an<BR>X-coordinate (longitude) of MINX + (X * DPP), and you do the same thing<BR>for Y.<BR><BR>- Ed<BR><BR>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 <BR><BR><BR><BR>________________________________<BR><BR>From: UMN MapServer Users List [mailto:MAPSERVER-USERS@LISTS.UMN.EDU] On<BR>Behalf Of Todd Birkenholtz<BR>Sent: Monday, December 06, 2004 3:22 PM<BR>To: MAPSERVER-USERS@LISTS.UMN.EDU<BR>Subject: [UMN_MAPSERVER-USERS] Formula for converting pixels to long lat<BR>points<BR><BR><BR><BR>Formula for converting pixels to long lat points<BR><BR><BR><BR>After I create a static image using the EXTENT -125.3556 10 -67 49.5<BR>Mapserver creates a image that is 449x349 pixels <BR><BR><BR><BR>I would like to use a ismap to reference the x,y points on my image and<BR>then pass that
 information to a second web app that will convert the<BR>pixel X,Y to long, Lat points.<BR><BR><BR><BR>I tried a couple of formulas I found in the list but I can not seam to<BR>get it to work.<BR><BR><BR><BR><BR><BR><BR><BR>Thanks for your help.<BR><BR><BR><BR>Todd Birkenholtz <BR><BR>________________________________<BR><BR>Do you Yahoo!?<BR>The all-new My Yahoo! <HTTP: my.yahoo.com>- Get yours free! <BR></BLOCKQUOTE></DIV></DIV><p>
                <hr size=1>Do you Yahoo!?<br>
The <a href="http://my.yahoo.com">all-new My Yahoo!</a> – What will yours do?