<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Ed,<BR> <BR>Thanks for the tip. I think it
would be best if I generate a custom sized scalebar. I'm doing that anyway for
creating a printable layout of a larger size. I'll just have to adjust the
scaling a bit more. I know it's not enirely precise, but it will only be for
indicative purposes
then.<BR> <BR>Jacob<BR> <BR> <BR>-----Original
Message-----<BR>From: Ed McNierney [mailto:ed@topozone.com] <BR>Sent: 19 August
2004 09:30<BR>To: Delfos, Jacob; <A
href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A><BR>Subject:
RE: [UMN_MAPSERVER-USERS] compensate scale for longitude</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>Jacob -<BR> <BR>There's nothing wrong with insisting that the
Earth is flat - but don't measure that flat Earth with longitude and
latitude!<BR> <BR>I'm not trying to be a nag, but I'm not saying you
"shouldn't" do it - I'm saying you can't. Your scale bar will be incorrect
if it uses units other than degrees (which are rather meaningless anyway, since
a degree of latitude isn't the same as a degree of longitude). So don't
expect MapServer to generate what is essentially a non-cartographic scale bar,
but rather just a pretty picture <g>.<BR> <BR>Your scale, except at
the Equator, will be incorrect in all directions except one. So you can
choose which one is going to be correct If you want to force MapServer to
produce a scalebar for a different map, use the "mode=scalebar" command, and
adjust the width and height of the (non-existent) map image. MapServer
will generate an appropriate scalebar image for this map image which is not the
map image you're displaying on the screen but rather one that is distorted by
the cosine of the latitude. Does that make sense?<BR> <BR>It's also
easy enough to tell MapServer to project the output image in, say, a UTM
projection, and actually produce an accurate scalebar, too! It might even
be less work than fudging it.<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>Phone: +1 978 251-4242 Fax: +1 978 251-1396 </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>--------------------------------------------------------------------------------<BR>From:
Delfos, Jacob [mailto:jacob.delfos@maunsell.com] <BR>Sent: Wednesday, August 18,
2004 9:14 PM<BR>To: Ed McNierney<BR>Subject: RE: [UMN_MAPSERVER-USERS]
compensate scale for longitude</DIV>
<DIV> </DIV>
<DIV><BR>Ed,<BR> <BR>Sorry, I meant latitude. I always get those mixed up.
I know I shouldn't be performing 'to scale' sort of things in a geographic
projection. It's just that I have those tools on the website, but I want to
allow the user to change the projection without those tools having to be
removed. I guess I will just have to put up a little warning.<BR> <BR>No
wonder it took so long for people to accept the world is round. It's not that
they didn't believe it possible, but for convenience sake they just refused to
accept
it.<BR> <BR>regards,<BR> <BR>Jacob<BR> <BR> <BR> <BR>-----Original
Message-----<BR>From: Ed McNierney [mailto:ed@topozone.com] <BR>Sent: 18 August
2004 22:00<BR>To: Jacob Delfos; <A
href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A><BR>Subject:
RE: [UMN_MAPSERVER-USERS] compensate scale for longitude</DIV>
<DIV> </DIV>
<DIV><BR>Jacob -<BR> <BR>I don't think this is something MapServer should
be expected to do. I am assuming that you're using a "geographic"
projection for your output data - is that correct? If so, the width of one
degree on longitude depends on the *latitude* (not the longitude) and the
width of one degree of latitude is approximately constant. But on any
given map the scale (in meters) north/south is different from the scale
east/west - there isn't a single "correction" you can make to fix that.
The scale is constant in "degrees" but varies with the position AND ANGLE in
meters.<BR> <BR>If you need a map in which units can be measured in a scale
of meter, you should use a projected map. Otherwise you're just not going
to be able to do it accurately - with or without MapServer's
help.<BR> <BR> - Ed<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>Phone: +1 978
251-4242 Fax: +1 978 251-1396 </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR>--------------------------------------------------------------------------------<BR>From:
UMN MapServer Users List [mailto:MAPSERVER-USERS@LISTS.UMN.EDU] On Behalf Of
Jacob Delfos<BR>Sent: Wednesday, August 18, 2004 2:31 AM<BR>To: <A
href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A><BR>Subject:
[UMN_MAPSERVER-USERS] compensate scale for longitude</DIV>
<DIV> </DIV>
<DIV><BR>Hi List,<BR> <BR>I've been working on getting my "print to scale"
code to work properly when working in latitude/longitude. I had a consistent
error, and now realize it's because mapserver seems to ignore the longitude when
converting from degrees to metres. I was wondering if that is something that
could be changed. My code actually did compensate for it, which is why my scale
(which is wrapped around the mapserver scale) did not match my scalebarsize
after printing. It's quite a simple compensation; it's just a matter of taking
the number which is currently calculated for the size of a pixel, and
multiplying it with the cosine of the longitude (I use the longitude of the
centre of the map). Of course the scale would not be the same throughout the map
if your extent is large, but it will be a lot closer. In Perth the difference is
around 15%. Where in the code should this be
changed?<BR> <BR>regards,<BR> <BR>Jacob<BR> <BR> <BR> <BR>JACOB
DELFOS<BR>SPATIAL INFORMATION ANALYST<BR>Maunsell Australia Pty Ltd<BR>629
Newcastle Street<BR>PO Box 81<BR>Leederville 6902<BR>Western Australia<BR>ABN 20
093 846 925<BR> <BR>Tel + 61 8 9281
6185<BR>Fax + 61 8 9281 6297<BR><A
href="mailto:jacob.delfos@maunsell.com">jacob.delfos@maunsell.com</A></FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="mailto:jacob.delfos@maunsell.com"></A></FONT> </DIV></BODY></HTML>