Generated scale

Ed McNierney ed at TOPOZONE.COM
Wed Jan 18 06:18:22 PST 2006


James -

No, it actually didn't work.

You cannot put a scalebar in kilometers on a map using a geographic
coordinate system (i.e. where the units on the map are "degrees").  Or,
rather, you cannot put an ACCURATE scalebar in kilometers on such a map.
Unfortunately, MapServer will fudge this for you and make you think it
worked, but it didn't.

On your map, an area that is one degree of longitude wide and one degree
of latitude high will appear as a square.  If the center of your map
(from your EXTENT) is at -37 degrees latitude and 145 degrees latitude,
then that "square" will be 110.978 kilometers high and 89.012 kilometers
wide.  The top horizontal side of that "square", at -36.5 degrees
latitude, will be 89.591 kilometers long, while the bottom horizontal
side at -37.5 degrees will be 88.425 kilometers.

So you've got a square with four sides on the map, each of which is
exactly the same length (since it's a square).  The two vertical sides
are 110.978 kilometers, the top is 89.591 kilometers, and the bottom is
88.425 kilometers.  You can't put a scalebar on that.

You cannot measure scales in kilometers on a "geographic" projection,
because distances are not constant, and vary with the latitude and with
the orientation of the line being measured.  If you want accurate
measurements on such a map you need to either create a measurement tool
that takes the latitude and longitude of two endpoints and calculates
the geodetic distance between them, or you need to use a projected
coordinate system that has a constant scale across the map.

	- Ed

(resident curmudgeon objecting to Web mappers completely forgetting that
the Earth is not flat)

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242  

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of James Net
Sent: Tuesday, January 17, 2006 8:56 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Generated scale

Thanks, it worked.


>From: Paul Spencer <pspencer at dmsolutions.ca>
>To: James Net <james_marsnett at HOTMAIL.COM>
>CC: MAPSERVER-USERS at LISTS.UMN.EDU
>Subject: Re: [UMN_MAPSERVER-USERS] Generated scale
>Date: Tue, 17 Jan 2006 20:31:11 -0500
>
>try adding UNITS DD to the MAP object
>
>Paul
>
>On 17-Jan-06, at 8:17 PM, James Net wrote:
>
>>I'm viewing a satellite map of a large area and my mapserver  
>>generated scale seems a little wrong. Viewing a whole state (of  
>>Australia) mapserver generates a scale ranging from 0 --->  0.001km
(see attached).
>>And when I zoom-in the scale bar goes to 0 ---> 0.  Any ideas? I 
>>thought my scale should be like 1 ---> 1000km. Am I  not reading it 
>>right? Am I missing or have I stuffed up a map file  config option /
setting?
>>
>>My Map file:
>>
>>MAP
>>   NAME        WEX
>>   IMAGETYPE   jpeg
>>   EXTENT      140 -41 150 -33
>>   SIZE        600 600
>>   DEBUG       ON
>>   TRANSPARENT ON
>>   IMAGECOLOR  239 242 248 # The background Color.
>>
>>   WEB
>>      LOG         "mylog.log" # The Debug Log.
>>      TEMPLATE    "template.html"
>>      IMAGEPATH   "/var/web/tmp/"
>>      IMAGEURL    "/tmp/"
>>      METADATA
>>         wms_title   "WEX"
>>         wms_srs     "EPSG:4283"
>>         wms_onlineresource   "http://myserver/cgi-bin/mapserv? 
>>map=wex.map"
>>      END
>>      MAXSCALE 50.0
>>      MINSCALE 0.1
>>   END
>>
>>   PROJECTION
>>      "init=epsg:4283"
>>   END
>>
>>...
>>
>>   SCALEBAR
>>      IMAGECOLOR 0 0 0
>>      LABEL
>>         COLOR 255 255 255
>>         SIZE  TINY
>>      END
>>      STYLE 1
>>      SIZE  100 2
>>      COLOR 255 255 255
>>      UNITS kilometers
>>      INTERVALS   1
>>      TRANSPARENT TRUE
>>      STATUS      ON
>>   END
>>
>>...
>>LAYER stuff
>>...
>>END # EOF
>>
>>
>>Thanks in advance!
>>
>>_________________________________________________________________
>>Start something musical - 15 free ninemsn Music downloads! http:// 
>>ninemsn.com.au/share/redir/adTrack.asp?
>>mode=click&clientID=667&referral=HotmailTaglineNov&URL=http://
>>www.ninemsn.com.au/startsomething
>><sb11375463746959.jpg>
>
>+-----------------------------------------------------------------+
>|Paul Spencer                           pspencer at dmsolutions.ca   |
>+-----------------------------------------------------------------+
>|Applications & Software Development                              |
>|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
>+-----------------------------------------------------------------+
>
>
>
>

_________________________________________________________________
ASUS M5 Ultra-slim lightweight is Now $1999 (was $2,999)
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fwww%2Easus%2Ecom%2Eau%2F
&_t=752129232&_r=Hotmail_tagline_23Nov05&_m=EXT



More information about the MapServer-users mailing list