I used <br><br>Distance = (x2 – x1)/ mapWidh * t<br><br>where (x2 – x1)/ mapWidh should be resolution in [m]/[pixel] (x2 and x1 are taken from "imgext" hidden value, as setted by jbox/dbox.<br><br>My raster has 1m resolution, so I can't test with precision.
<br>I tested both ways with an open 50m swimming pool  (as  I hadn't  other references...) and  both gave me closer results (but I  didn't test the  [scale] formula with other monitor resolutions). At the end, I used the formula above.
<br><br>Thanks<br> Piero <br><br><br><div><span class="gmail_quote">2007/5/4, Steve Lime <<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I wouldn't use scale since that's an artificial number and should only<br>be used for relative comparisons (like turning layers on/off). Instead<br>you'd want to use cellsize (pixel width or height). How you get that
<br>value depends on your application. Are you using mapserv.js? If so it's<br>probably there for you. There may be a template substitution as well.<br><br>Steve<br><br>>>> On 5/4/2007 at 10:06 AM, in message
<br><<a href="mailto:fd606ea20705040806m3e2215dbx4e73c7662d41b863@mail.gmail.com">fd606ea20705040806m3e2215dbx4e73c7662d41b863@mail.gmail.com</a>>, Piero<br>Cavalieri<br><<a href="mailto:piero.cavalieri@GMAIL.COM">
piero.cavalieri@GMAIL.COM</a>> wrote:<br>> Hi,<br>><br>> I use jBox to calcolate distance measure.<br>> In jBox documentation I found this function:<br>><br>> function measure_handler(name, s, t, n, a) {
<br>> // c = 1 / 72dpi / 12inches_per_foot *<br>1.0003state_plane_scale_factor<br>> var c = 0.0011577546296296;    // constant<br>> var f = [scale] * c;           // scale factor<br>> if ((s>0) || (t>0)) {
<br>> defaultStatus = "This segment = " + s*f + ", Total = " + t*f + ",<br>> Number of vertices = " + n ;<br>> }<br>><br>> Since I'm not able to have user dpi (and 72 is a mean value, I
<br>suppose),<br>> isn't more correct (and simpler) to use this way: ?<br>><br>> Distance = (x2 – x1)/ mapWidh * t<br>><br>>  Where x2 and x1 are mapextents in real world coordinates, as<br>returned in<br>
> imgext, mapWidth is the width in pixel, as specified in .map file<br>(and<br>> returned in template file), and t is the jBox meaure, in pixel.<br>><br>> Thanks<br>><br>>  Piero<br></blockquote></div><br>