[mapserver-users] Scalebar label

Andrew ahaigh@ic24.net
Tue, 5 Feb 2002 12:57:26 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_0083_01C1AE44.A9261920
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I'm relatively new to Mapserver and I'm attempting to implement =
Mapserver as on OGC WMS. I have two problems, so any help would be =
greatly appreciated. I've attached my mapfile definition at the bottom =
of the e-mail.

    1. I have defined a scalebar, which I'd like to embed in the map. =
This works fine however, I want to place some text (a copyright notice) =
next to the scalebar (i.e. along the bottom of the map). To do this I =
think I need to include a label entry in my scalebar definition, but I =
can't work out how to set the text I want to display.

    2. I have a vector layer which contains 136 polygons (name: =
'boarders'). I'd like to make these semi-transparent, so you can still =
see the raster data in the layer below. Can you do this with Mapserver?

I'm using Mapserver 3.5 on Windows 2000.


Thanks in advance,

Andrew

Map file follows:

NAME EMS
STATUS ON
SIZE 500 350
EXTENT 380000 400000 450000 450000
UNITS METERS
IMAGETYPE gif

PROJECTION
 "init=3Depsg:27700"
END

WEB
 METADATA
  "wms_title"  "Enviroport Map Server"
  "wms_onlineresource" =
"http://plasma/cgi-bin/mapserv.exe?map=3Dc:\demo.map"
  "wms_srs"  "epsg:27700"
 END
END

# Definitions for map symbols
SYMBOL
  NAME 'circle'
  TYPE ELLIPSE
  POINTS 1 1 END
  FILLED TRUE
END
# End of map symbol definitions

# Start of Map Layers, The first layer in this list is displayed at the =
bottom, etc.
# Raster Data - Using shapefile index
LAYER
   NAME "rst50k"
   TYPE raster
   STATUS ON
   TRANSFORM true
   TILEINDEX "H:\data\50k\tiff\poly"

   PROJECTION
 "init=3Depsg:27700"
   END

   METADATA
    WMS_TITLE "1:50,000 Colour Raster"
    WMS_ABSTRACT "Add info here"
    WMS_SRS "EPSG:27700"
   END # End of Metadata tag
END # End of 50k raster



# Ward Data - shapefile
LAYER
   NAME "boarders"
   TYPE polygon
   DATA "H:\data\UKBoarders\947"
   STATUS OFF
   TRANSFORM true

   PROJECTION
 "init=3Depsg:27700"
   END

   CLASSITEM "Name"
   CLASS
    EXPRESSION 'Bolton'
    TEMPLATE "somepage.html"
    OUTLINECOLOR 0 0 0
    COLOR 0 255 0
   END # End of class Bolton
   CLASS
    EXPRESSION 'Birkby'
    TEMPLATE "somepage.html"
    OUTLINECOLOR 0 0 0
    COLOR 255 0 0
   END # End of class Bolton
   CLASS
    EXPRESSION /./
    TEMPLATE "somepage.html"
    OUTLINECOLOR 0 0 0
    COLOR 190 253 190
   END

  TOLERANCE 3



   METADATA
    WMS_TITLE "Wards"
    WMS_ABSTRACT "Ward boundary information."
    WMS_SRS "EPSG:27700"
   END # End of Metadata tag
END # End of layer

# Test POI Layer
LAYER
   NAME "poi"
   TYPE point
   DATA "H:\data\testInfo\poi"
   STATUS ON
   TRANSFORM true

   PROJECTION
 "init=3Depsg:27700"
   END
  =20
   CLASS
    SYMBOL 'circle'
    SIZE 2
    NAME 'Townships'
    OUTLINECOLOR 100 40 40
   END
=20
   METADATA
    WMS_TITLE "Point of Interest Data"
    WMS_ABSTRACT "Test Point of Interest Data for Muckenbrough County =
Council"
    WMS_SRS "EPSG:27700"
   END # End of Metadata tag
END # End of layer

# Test for scalebar
MAP
 SCALEBAR
  BACKGROUNDCOLOR 0 0 0
  COLOR 255 255 255
  INTERVALS 3
  OUTLINECOLOR 255 0 0
  POSITION lr
  POSTLABELCACHE true
  SIZE 500 15
  STATUS embed
  TRANSPARENT off
  STYLE 0
  UNITS meters
  LABEL
     COLOR 0 0 0
     SIZE tiny
  END # END of label
 END # END of scalebar
END # End of map object

END # End of file


------=_NextPart_000_0083_01C1AE44.A9261920
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I'm relatively new to Mapserver and I'm =
attempting=20
to implement Mapserver as on OGC WMS. I have two problems, so any help =
would be=20
greatly appreciated. I've attached my mapfile definition at the bottom =
of the=20
e-mail.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; 1. I have defined a =
scalebar,=20
which I'd like to embed in the map. This works fine however, I want to =
place=20
some text (a copyright notice) next to the scalebar (i.e. along the =
bottom of=20
the map). To do this I think I need to include a label entry in my =
scalebar=20
definition, but I can't work out how to set the text I want to=20
display.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; 2. I have a vector =
layer which=20
contains 136 polygons&nbsp;(name: 'boarders'). I'd like to make these=20
semi-transparent, so you can still see the raster data in the layer =
below. Can=20
you do this with Mapserver?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm using Mapserver 3.5 on Windows=20
2000.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Andrew</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Map file follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>NAME EMS<BR>STATUS ON<BR>SIZE 500 =
350<BR>EXTENT=20
380000 400000 450000 450000<BR>UNITS METERS<BR>IMAGETYPE =
gif</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>PROJECTION<BR>&nbsp;"init=3Depsg:27700"<BR>END</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>WEB<BR>&nbsp;METADATA<BR>&nbsp;&nbsp;"wms_title"&nbsp;&nbsp;"Env=
iroport=20
Map Server"<BR>&nbsp;&nbsp;"wms_onlineresource"&nbsp;"<A=20
href=3D"http://plasma/cgi-bin/mapserv.exe?map=3Dc:\demo.map">http://plasm=
a/cgi-bin/mapserv.exe?map=3Dc:\demo.map</A>"<BR>&nbsp;&nbsp;"wms_srs"&nbs=
p;&nbsp;"epsg:27700"<BR>&nbsp;END<BR>END</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># Definitions for map =
symbols</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>SYMBOL<BR>&nbsp; NAME =
'circle'<BR>&nbsp; TYPE=20
ELLIPSE<BR>&nbsp; POINTS 1 1 END<BR>&nbsp; FILLED =
TRUE<BR>END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># End of map symbol =
definitions</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># Start of Map Layers, The first layer =
in this list=20
is displayed at the bottom, etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># Raster Data - Using shapefile=20
index<BR>LAYER<BR>&nbsp;&nbsp; NAME "rst50k"<BR>&nbsp;&nbsp; TYPE=20
raster<BR>&nbsp;&nbsp; STATUS ON<BR>&nbsp;&nbsp; TRANSFORM =
true<BR>&nbsp;&nbsp;=20
TILEINDEX "H:\data\50k\tiff\poly"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;=20
PROJECTION<BR>&nbsp;"init=3Depsg:27700"<BR>&nbsp;&nbsp; END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; =
METADATA<BR>&nbsp;&nbsp;&nbsp;=20
WMS_TITLE "1:50,000 Colour Raster"<BR>&nbsp;&nbsp;&nbsp; WMS_ABSTRACT =
"Add info=20
here"<BR>&nbsp;&nbsp;&nbsp; WMS_SRS "EPSG:27700"<BR>&nbsp;&nbsp; END # =
End of=20
Metadata tag<BR>END # End of 50k raster</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># Ward Data - =
shapefile<BR>LAYER<BR>&nbsp;&nbsp;=20
NAME "boarders"<BR>&nbsp;&nbsp; TYPE polygon<BR>&nbsp;&nbsp; DATA=20
"H:\data\UKBoarders\947"<BR>&nbsp;&nbsp; STATUS OFF<BR>&nbsp;&nbsp; =
TRANSFORM=20
true</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;=20
PROJECTION<BR>&nbsp;"init=3Depsg:27700"<BR>&nbsp;&nbsp; END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; CLASSITEM =
"Name"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; =
CLASS<BR>&nbsp;&nbsp;&nbsp; EXPRESSION=20
'Bolton'<BR>&nbsp;&nbsp;&nbsp; TEMPLATE =
"somepage.html"<BR>&nbsp;&nbsp;&nbsp;=20
OUTLINECOLOR 0 0 0<BR>&nbsp;&nbsp;&nbsp; COLOR 0 255 0<BR>&nbsp;&nbsp; =
END # End=20
of class Bolton<BR>&nbsp;&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp; EXPRESSION=20
'Birkby'<BR>&nbsp;&nbsp;&nbsp; TEMPLATE =
"somepage.html"<BR>&nbsp;&nbsp;&nbsp;=20
OUTLINECOLOR 0 0 0<BR>&nbsp;&nbsp;&nbsp; COLOR 255 0 0<BR>&nbsp;&nbsp; =
END # End=20
of class Bolton<BR>&nbsp;&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp; EXPRESSION=20
/./<BR>&nbsp;&nbsp;&nbsp; TEMPLATE "somepage.html"<BR>&nbsp;&nbsp;&nbsp; =

OUTLINECOLOR 0 0 0<BR>&nbsp;&nbsp;&nbsp; COLOR 190 253 =
190<BR>&nbsp;&nbsp;=20
END</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; TOLERANCE 3</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; =
METADATA<BR>&nbsp;&nbsp;&nbsp;=20
WMS_TITLE "Wards"<BR>&nbsp;&nbsp;&nbsp; WMS_ABSTRACT "Ward boundary=20
information."<BR>&nbsp;&nbsp;&nbsp; WMS_SRS "EPSG:27700"<BR>&nbsp;&nbsp; =
END #=20
End of Metadata tag<BR>END # End of layer</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># Test POI =
Layer<BR>LAYER<BR>&nbsp;&nbsp; NAME=20
"poi"<BR>&nbsp;&nbsp; TYPE point<BR>&nbsp;&nbsp; DATA=20
"H:\data\testInfo\poi"<BR>&nbsp;&nbsp; STATUS ON<BR>&nbsp;&nbsp; =
TRANSFORM=20
true</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;=20
PROJECTION<BR>&nbsp;"init=3Depsg:27700"<BR>&nbsp;&nbsp; =
END<BR>&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp; SYMBOL=20
'circle'<BR>&nbsp;&nbsp;&nbsp; SIZE 2<BR>&nbsp;&nbsp;&nbsp; NAME=20
'Townships'<BR>&nbsp;&nbsp;&nbsp; OUTLINECOLOR 100 40 40<BR>&nbsp;&nbsp; =

END<BR>&nbsp;<BR>&nbsp;&nbsp; METADATA<BR>&nbsp;&nbsp;&nbsp; WMS_TITLE =
"Point of=20
Interest Data"<BR>&nbsp;&nbsp;&nbsp; WMS_ABSTRACT "Test Point of =
Interest Data=20
for Muckenbrough County Council"<BR>&nbsp;&nbsp;&nbsp; WMS_SRS=20
"EPSG:27700"<BR>&nbsp;&nbsp; END # End of Metadata tag<BR>END # End of=20
layer</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># Test for=20
scalebar<BR>MAP<BR>&nbsp;SCALEBAR<BR>&nbsp;&nbsp;BACKGROUNDCOLOR 0 0=20
0<BR>&nbsp;&nbsp;COLOR 255 255 255<BR>&nbsp;&nbsp;INTERVALS=20
3<BR>&nbsp;&nbsp;OUTLINECOLOR 255 0 0<BR>&nbsp;&nbsp;POSITION=20
lr<BR>&nbsp;&nbsp;POSTLABELCACHE true<BR>&nbsp;&nbsp;SIZE 500=20
15<BR>&nbsp;&nbsp;STATUS embed<BR>&nbsp;&nbsp;TRANSPARENT=20
off<BR>&nbsp;&nbsp;STYLE 0<BR>&nbsp;&nbsp;UNITS=20
meters<BR>&nbsp;&nbsp;LABEL<BR>&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0=20
0<BR>&nbsp;&nbsp;&nbsp;&nbsp; SIZE tiny<BR>&nbsp;&nbsp;END # END of=20
label<BR>&nbsp;END # END of scalebar<BR>END # End of map =
object</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>END # End of =
file<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_0083_01C1AE44.A9261920--