Scalebar Intervals - Defining Numeric Values

Paul Spencer pspencer at DMSOLUTIONS.CA
Wed May 4 03:57:28 PDT 2005


Matthew,

your assessment is correct, you cannot affect the values that mapserver
decides to use for a scale bar.  There is a good reason for this.  At
your particular scale, it may not be possible to use an integral number
of pixels to represent 100km (or some sub-division of that).  Also,
MapServer does make the scale bar fit the requested size (including the
labels) so you could try reducing the width in small increments to see
if you can get a different result.

Cheers

Paul

Matthew Smith wrote:
> Hi
>
> I am creating a map of fixed extent and scale (layers can be turned on and
> off).  How can I create a scalebar of a fixed length - in km rather than
> pixels?  I want to draw a scalebar 100km long; the one created automatically
> is 128km long and divided 32,64,96,128km.  This will probably look weird to
> those who are either expecing 10s or at least 25,50,75...
>
>>From the documentation
> (http://mapserver.gis.umn.edu/doc44/mapfile-reference.html#scalebar) I can't
> see any way to do this.
>
> Current config below.
>
> Cheers
>
> M
>
> SCALEBAR
>   IMAGECOLOR 255 255 255
>   LABEL
>     COLOR 0 0 0
>     SIZE large
>   END
>   outlinecolor 0 0 0
>   STYLE 1
>   SIZE 450 05
>   COLOR 255 255 255
>   UNITS kilometers
>   INTERVALS 4
>   STATUS on
> END
>

--
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+



More information about the MapServer-users mailing list