[Fwd: [Mapserver-users] <PARAM NAME="PIXEL_SIZE" VALUE="???">]

Daniel Morissette morissette at dmsolutions.ca
Sun Jan 12 11:48:30 PST 2003


This is a multi-part message in MIME format.
--------------CA8E78463AE5B2CD3CBAA4A3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

 
--------------CA8E78463AE5B2CD3CBAA4A3
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Received: from xcalibur.dmsolutions.ca (www2.dmsolutions.on.ca [209.217.116.146])
	by in2.magma.ca (Magma's Mail Server) with ESMTP id h0BFv6I1023235
	for <morisset at magma.ca>; Sat, 11 Jan 2003 10:57:06 -0500 (EST)
Received: from smtp4.jaring.my (smtp4.jaring.my [61.6.32.54])
	by xcalibur.dmsolutions.ca (8.11.2/8.11.2) with ESMTP id h0BFv4t31574
	for <morissette at dmsolutions.ca>; Sat, 11 Jan 2003 10:57:04 -0500
Received: from clickntrac (j39.crc23.jaring.my [61.6.96.53])
	by smtp4.jaring.my (8.12.6/8.12.6) with SMTP id h0BFuwKg064731
	for <morissette at dmsolutions.ca>; Sat, 11 Jan 2003 23:57:01 +0800 (MYT)
	(envelope-from mccrone at pc.jaring.my)
Message-ID: <000e01c2b98a$68883ea0$3560063d at clickntrac>
From: "Steve McCrone" <mccrone at pc.jaring.my>
To: "Daniel Morissette" <morissette at dmsolutions.ca>
References: <005a01c2b511$e2391b20$470a18d3 at clickntrac> <3E1E2C0B.3A8AB2F5 at dmsolutions.ca> <001d01c2b8a6$9db0d950$840918d3 at clickntrac> <3E1F27AA.EB411AAB at dmsolutions.ca>
Subject: Re: [Mapserver-users] <PARAM NAME="PIXEL_SIZE" VALUE="???">
Date: Sat, 11 Jan 2003 23:59:15 +0800
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
X-Mozilla-Status2: 00000000

Hey, thanks for your insight - the estimated value for my distance is
adequate. I made the calculation and used
the SetPixelSize() function - its working fine and changes the value
correctly when I zoom in/out.

I may be pushing my luck here but how do I access the distance measured once
the user finishes
with the tool (i.e. esc or double clicks). The text in the status bar is
cleared once this happens -
I wanted to use this measured distance in a java script function., and I
don't see a way of capturing
the status bar text as the mouse moves.

Steve
----- Original Message -----
From: "Daniel Morissette" <morissette at dmsolutions.ca>
To: "Steve McCrone" <mccrone at pc.jaring.my>
Cc: "mapserver-users" <mapserver-users at lists.gis.umn.edu>
Sent: Saturday, January 11, 2003 4:06 AM
Subject: Re: [Mapserver-users] <PARAM NAME="PIXEL_SIZE" VALUE="???">


> > Steve McCrone wrote:
> >
> > The pixel_size = ([maxx] - [minx])/[width] will give me how many
> > degrees (decimal degrees) is each pixel, But some further math has to
> > be done to somehow equate this to a distance. Now, I could "inverse"
> > between the two extents to get a metres value but I would essentiall
> > ybe bypassing the "built-in" measurement
> > <PARAM NAME="DIST_MSG" VALUE="Dist: %s m">.
> >
> > Still puzzled. I may have to resort to PHP mapscript to get further
> > control over my app.
> >
>
> Ah, your need to convert the pixel size from degrees to meters, and
> doing this accurately requires that you use the PROJ library because one
> degree of longitude is not the same lenght depending on how far you are
> from the equator.  So to get an accurate pixel size value you would have
> to use MapScript (Perl, PHP, etc.) or the php_proj module that comes in
> the php_mapscript directory to calculate the size of one pixel at the
> center of your map image.
>
> Now, if you can live with a very rough approximation you can go with the
> assumption that 1 degree is approx. 69 miles, or 110 km at the equator.
> So the formula becomes:
>
> pixel_size_in_meters = 110000*([maxx] - [minx])/[width]
>
> Daniel
> --
> ------------------------------------------------------------
>  Daniel Morissette               morissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------
>



--------------CA8E78463AE5B2CD3CBAA4A3--




More information about the MapServer-users mailing list