[mapserver-users] Scale Bar Size Issue

PatB pbarnhart at gis-services.com
Mon Sep 28 12:12:19 PDT 2009


The image size will vary because of the length of the last callout under the
bar, right?  100000 km will stick out past the bar farther than 5000 m.  I
guess I could eyeball how much based on the font size, number of characters
and ouput dpi but, well, bleach.  Is there a better way?  Plan B is to make
my own scalebar but I'm not wild about that idea either.

Engineers all over the world just cringed when I wrote 'eyeball'.

Thanks.


Steve Lime wrote:
> 
> When you set a size for a scalebar the width you provide is what you get
> back. The height is for
> the bar only. This was done so that scalebar images could retain the same
> image size and you 
> could just swap img.src in a web app (assuming you're not mucking with
> font sizes). You'll likely
> have to experiment a bit with the width then to get it roughly the right
> size (e.g ask for 750).
> 
> Steve
> 
>>>> On 9/24/2009 at 11:04 PM, in message
> <1253851467382-3710334.post at n2.nabble.com>, PatB
> <pbarnhart at gis-services.com>
> wrote:
> 
>> Hi,
>> 
>> I'm using the code below to request a scalebar from mapserver.  My
>> understanding of the documentation is that the size parameter sets the
>> size
>> of the scalebar itself not including the text, border, etc but that's not
>> what I'm getting back.  The url below returns an image that is 600 x 153
>> (I'm requesting 600 x 75) when it should be more like 750 x 153 to
>> account
>> for the surrounding stuff.  The height works as expected and the
>> units/distances look right, the width of the scalebar itself is the
>> issue.
>> 
>> This is for a print app, the output res is 300dpi so by setting the width
>> to
>> 600 I was hoping to print a 2 inch wide scale bar with four 1/2"
>> intervals. 
>> This seems like it would be a common task but I've been digging though
>> the
>> forum for hours without success.  A little help?  I'm using MS version
>> 5.4.2
>> 
>> mapserv.exe?MAP=C:/ms4w/tmp/maps/mp.map&mode=scalebar&mapext=-8798233+4184184+-8
>> 793280+4188502&mapsize=11700+10200&map.scalebar=units+feet+size+600+75+interval
>> s+4+label+size+40+end
>> 
>> and my map file goes something like:
>> 
>> MAP
>> ...
>> UNITS meters
>> ...
>> SCALEBAR
>>   STYLE 0
>>   IMAGECOLOR 255 255 255
>>   LABEL
>>     TYPE TRUETYPE
>>     FONT "tahoma"
>>     SIZE 40
>>     COLOR 0 114 255
>>   END
>>   SIZE 600 75
>>   COLOR 235 235 235
>>   BACKGROUNDCOLOR 0 114 255
>>   OUTLINECOLOR 0 0 0
>>   UNITS meters
>>   INTERVALS 4
>>   STATUS on
>>   TRANSPARENT on
>> END
>> ...
>> 
>> Thanks - and yes, the map size is friggin huge.
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Scale-Bar-Size-Issue-tp3710334p3731312.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list