distance measure
Piero Cavalieri
piero.cavalieri at GMAIL.COM
Fri May 4 08:06:55 PDT 2007
Hi,
I use jBox to calcolate distance measure.
In jBox documentation I found this function:
function measure_handler(name, s, t, n, a) {
// c = 1 / 72dpi / 12inches_per_foot * 1.0003state_plane_scale_factor
var c = 0.0011577546296296; // constant
var f = [scale] * c; // scale factor
if ((s>0) || (t>0)) {
defaultStatus = "This segment = " + s*f + ", Total = " + t*f + ",
Number of vertices = " + n ;
}
Since I'm not able to have user dpi (and 72 is a mean value, I suppose),
isn't more correct (and simpler) to use this way: ?
Distance = (x2 – x1)/ mapWidh * t
Where x2 and x1 are mapextents in real world coordinates, as returned in
imgext, mapWidth is the width in pixel, as specified in .map file (and
returned in template file), and t is the jBox meaure, in pixel.
Thanks
Piero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070504/db65dbe6/attachment.htm>
More information about the MapServer-users
mailing list