[Mapserver-users] MapServer Tutorial 4.0 Example 1.4 no image

Carol L Heydon carol_heydon at usgs.gov
Mon Feb 2 13:59:09 EST 2004


This is a multipart message in MIME format.
--=_alternative 006849E887256E2E_=
Content-Type: text/plain; charset="us-ascii"

I'm trying to work through Tutorial4.0 with MapServer 4.0 on Windows 2000. 
 I made the needed changes to the path information in the html and map 
files.  Everything works fine for Examples 1.1, 1.2, and 1.3, but from 1.4 
on the image does not display.  What's different beginning with example 
1.4?

data directory:  C:\Program Files\Apache 
Group\Apache2\htdocs\tutorial\data
mapserv40 located in:  C:\Program Files\Apache 
Group\Apache2\htdocs\cgi-bin

Mapfile:
MAP
  IMAGETYPE      PNG
  EXTENT         201621.496941 -294488.285333 1425518.020722 498254.511514
  SIZE           400 300
  SHAPEPATH      "data"
  IMAGECOLOR     255 255 255

  PROJECTION
    "proj=laea"
    "ellps=clrk66"
    "lat_0=45"
    "lon_0=-100"
  #
  # Alternatively, you can specify an EPSG code.
  # "init=epsg:2163"
  #
  END

  # Start of LAYER DEFINITIONS 
---------------------------------------------
  LAYER # States polygon layer begins here
    NAME         states_poly
    DATA         states_ugl
    STATUS       DEFAULT
    TYPE         POLYGON

    PROJECTION
      "init=epsg:4326"
    END

    CLASSITEM    "CLASS"
    CLASS
      EXPRESSION 'land'
       COLOR      232 232 232
    END
    CLASS
      EXPRESSION 'water'
       COLOR      198 198 255
    END
  END # States polygon layer ends here

  LAYER # States line layer begins here
    NAME         states_line
    DATA         states_ugl
    STATUS       DEFAULT
    TYPE         LINE

    PROJECTION
      "init=epsg:4326"
    END

    CLASSITEM    "CLASS"
    CLASS
      EXPRESSION 'land'
      COLOR      32 32 32
    END
  END # States line layer ends here
  # End of LAYER DEFINITIONS -------------------------------
END # end of map file

html:
<html>
<head>
<title>MapServer 4.0 Tutorial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="ms35.css" />
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table align="center" width="600" border="0">
<tr>
<td>
<h3 align="center">Example 1.4: Labeling the Map</h3>
      <div align="center"><img border="1" 
src="/cgi-bin/mapserv40?map=C:/Program Files/Apache 
Group/Apache2/htdocs/tutorial/example1-4.map&mode=map" />
      </div>
      <p align="left">We can also add labels to our map.</p>
      <hr>
      <p align="left">This is what the mapfile looks like:</p>
      <pre align="left">MAP
  IMAGETYPE PNG
  EXTENT 201621.496941 -294488.285333 1425518.020722 498254.511514
  SIZE 400 300
  SHAPEPATH &quot;data&quot;
  IMAGECOLOR 255 255 255
  FONTSET &quot;fonts/fonts.list&quot;

  PROJECTION
    &quot;proj=laea&quot;
    &quot;ellps=clrk66&quot;
    &quot;lat_0=45&quot;
    &quot;lon_0=-100&quot;
  #
  # Alternatively, you can specify an EPSG code.
  # &quot;init=epsg:2163&quot;
  #
  END

  # Start of LAYER DEFINITIONS 
---------------------------------------------
  LAYER # States polygon layer begins here
    NAME states_poly
    DATA states_ugl
    STATUS DEFAULT
    TYPE POLYGON

    PROJECTION
      &quot;init=epsg:4326&quot;
    END

    CLASSITEM &quot;CLASS&quot;
    LABELITEM &quot;STATE&quot;
    CLASS
      EXPRESSION 'land'
      COLOR 232 232 232
      LABEL
        COLOR 132 31 31
        SHADOWCOLOR 218 218 218
        SHADOWSIZE 2 2
        TYPE TRUETYPE
        FONT arial-bold
        SIZE 12
        ANTIALIAS TRUE
        POSITION CL
        PARTIALS FALSE
        MINDISTANCE 300
        BUFFER 4
      END # end of label
    END
  END # States polygon layer ends here

  LAYER # States line layer begins here
    NAME states_line
    DATA states_ugl
    STATUS DEFAULT
    TYPE LINE

    PROJECTION
      &quot;init=epsg:4326&quot;
    END

    CLASSITEM &quot;CLASS&quot;
    CLASS
      EXPRESSION 'land'
      COLOR 64 64 64
    END
  END # States line layer ends here
  # End of LAYER DEFINITIONS -------------------------------
END # end of map file</pre>
      <hr align="center" width="300">
      <p>Here we introduce a few more parameters along with the LABEL 
object:</p>
      <p>FONTSET<br>
        Here we specify the full path to our truetype fonts list (or font 
set)
        file. This file lists each of the available fonts. See the file 
itself
        and the <a 
href="http://mapserver.gis.umn.edu/doc40/fontset.html">MapServer
        fonset documentation</a> for more info. FONTSET is a parameter of 
the
        MAP object.</p>
      <p>LABELITEM<br>
        This specifies which data attribute to use for labeling, in this 
case
        &quot;STATE&quot;. LABELITEM is a parameter of the LAYER 
object.</p>
      <p>LABEL<br>
        Marks the beginning of the LABEL object. The label object can be 
used
        under other objects (i.e. the SCALEBAR object).</p>
      <p> COLOR<br>
        Within the LABEL object, COLOR specifies the color of the label 
text.</p>
      <p>SHADOWCOLOR<br>
        This specifies the shadow color of the label text.</p>
      <p>SHADOWSIZE<br>
        Specifies the shadow size. The value corresponds to the X and the 
Y shifts
        in pixels. So, &quot;2 2&quot; means two pixels wide by two pixels 
high.</p>
      <p>TYPE<br>
        Within the LABEL object, TYPE specifies what type of font to use. 
We have
        the choice of TRUETYPE or BITMAP (the built-in fonts). We choose 
TRUETYPE.</p>
      <p>FONT<br>
        If you specify TYPE as TRUETYPE, you need to specify what font to 
use.
        The value here is the &quot;alias&quot; in the font list file.</p>
      <p>SIZE<br>
        If using truetype fonts, the value is size in pixels. If bitmap, 
you can
        say something like &quot;small&quot; or &quot;large&quot;.</p>
      <p>ANTIALIAS<br>
        This turns truetype antialiasing on or off. Remember the value 
isn't on
        or off but TRUE or FALSE.</p>
      <p>POSITION<br>
        Where to position the label text in relation to the label points. 
The
        value is a combination of vertical and horizontal positions. You 
have
        the following choices for vertical alignment: C for center, U for 
upper,
        and L for lower. For horizontal alignment you have the following 
choices:
        C for center, L for left, and R for right. So, to align the label 
text
        to the center of label ID you'd use the value &quot;CC&quot; 
(center-center).
        Or if you'd like it to be on the lower left of the ID, you'd use 
LL. Another
        way is to let MapServer decide the best position for your labels. 
For
        this you would use the value &quot;AUTO&quot;.</p>
      <p>PARTIALS<br>
        Tells MapServer whether to generate incomplete label texts or not. 
The
        default here is not to generate fragments of a label text. The 
value is
        either TRUE or FALSE.</p>
      <p>MINDISTANCE<br>
        This is the minimum distance in pixels between duplicate labels. 
See what
        happens if you increase or decrease this value.</p>
      <p>BUFFER<br>
        The padding (in pixels) for each label. This is used to enhance 
readability.
        A BUFFER of 4 pixels mean that no label will be drawn within four 
pixels
        of each other. Again, change to see how it works.<br>
      </p>
      <hr align="center" width="300">
      <p>You can also create labels separate from a POLYGON layer. You do 
this
        with the ANNOTATION data type. Have a look at the file 
&quot;example1-4a.map&quot;
        to see how you'd implement this kind of labeling. You will notice 
that
        the CLASS object within the &quot;label&quot; layer has a COLOR 
parameter
        value of &quot;-1 -1 -1&quot;. The negative number tells MapServer 
to
        give this CLASS a transparent color (the label IDs don't show up). 
Once
        again, play with the values to understand how it affects the 
map.</p>
      <hr>
      <p class="Small" align="center"><a href="example1-3.html">Back to 
Example
        1.3</a> | <a href="section1.html">Back to the Section 1</a> | <a 
href="sections.html">Back to the Sections Page</a>
                | <a href="example1-5.html">Proceed to Example 1.5</a></p>
      </td>
</tr>
</table>
</body>
</html>

image tag as obtained from 'view source':
<img border="1" src="/cgi-bin/mapserv40?map=C:/Program Files/Apache 
Group/Apache2/htdocs/tutorial/example1-4.map&mode=map" />
--=_alternative 006849E887256E2E_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">I'm trying to work through Tutorial4.0 with MapServer 4.0 on Windows 2000. &nbsp;I made the needed changes to the path information in the html and map files. &nbsp;Everything works fine for Examples 1.1, 1.2, and 1.3, but from 1.4 on the image does not display. &nbsp;What's different beginning with example 1.4?</font>
<br>
<br><font size=2 face="sans-serif">data directory: &nbsp;C:\Program Files\Apache Group\Apache2\htdocs\tutorial\data</font>
<br><font size=2 face="sans-serif">mapserv40 located in: &nbsp;C:\Program Files\Apache Group\Apache2\htdocs\cgi-bin</font>
<br>
<br><font size=2 face="sans-serif">Mapfile:</font>
<br><font size=2 face="sans-serif">MAP</font>
<br><font size=2 face="sans-serif">&nbsp; IMAGETYPE &nbsp; &nbsp; &nbsp;PNG</font>
<br><font size=2 face="sans-serif">&nbsp; EXTENT &nbsp; &nbsp; &nbsp; &nbsp; 201621.496941 -294488.285333 1425518.020722 498254.511514</font>
<br><font size=2 face="sans-serif">&nbsp; SIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 400 300</font>
<br><font size=2 face="sans-serif">&nbsp; SHAPEPATH &nbsp; &nbsp; &nbsp;&quot;data&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; IMAGECOLOR &nbsp; &nbsp; 255 255 255</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; PROJECTION</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot;proj=laea&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot;ellps=clrk66&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot;lat_0=45&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot;lon_0=-100&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; #</font>
<br><font size=2 face="sans-serif">&nbsp; # Alternatively, you can specify an EPSG code.</font>
<br><font size=2 face="sans-serif">&nbsp; # &quot;init=epsg:2163&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; #</font>
<br><font size=2 face="sans-serif">&nbsp; END</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; # Start of LAYER DEFINITIONS ---------------------------------------------</font>
<br><font size=2 face="sans-serif">&nbsp; LAYER # States polygon layer begins here</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; NAME &nbsp; &nbsp; &nbsp; &nbsp; states_poly</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; DATA &nbsp; &nbsp; &nbsp; &nbsp; states_ugl</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; STATUS &nbsp; &nbsp; &nbsp; DEFAULT</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; TYPE &nbsp; &nbsp; &nbsp; &nbsp; POLYGON</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; PROJECTION</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &quot;init=epsg:4326&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASSITEM &nbsp; &nbsp;&quot;CLASS&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASS</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; EXPRESSION 'land'</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;COLOR &nbsp; &nbsp; &nbsp;232 232 232</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASS</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; EXPRESSION 'water'</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;COLOR &nbsp; &nbsp; &nbsp;198 198 255</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br><font size=2 face="sans-serif">&nbsp; END # States polygon layer ends here</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; LAYER # States line layer begins here</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; NAME &nbsp; &nbsp; &nbsp; &nbsp; states_line</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; DATA &nbsp; &nbsp; &nbsp; &nbsp; states_ugl</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; STATUS &nbsp; &nbsp; &nbsp; DEFAULT</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; TYPE &nbsp; &nbsp; &nbsp; &nbsp; LINE</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; PROJECTION</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &quot;init=epsg:4326&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASSITEM &nbsp; &nbsp;&quot;CLASS&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASS</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; EXPRESSION 'land'</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; COLOR &nbsp; &nbsp; &nbsp;32 32 32</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br><font size=2 face="sans-serif">&nbsp; END # States line layer ends here</font>
<br><font size=2 face="sans-serif">&nbsp; # End of LAYER DEFINITIONS -------------------------------</font>
<br><font size=2 face="sans-serif">END # end of map file</font>
<br>
<br><font size=2 face="sans-serif">html:</font>
<br><font size=2 face="sans-serif">&lt;html&gt;</font>
<br><font size=2 face="sans-serif">&lt;head&gt;</font>
<br><font size=2 face="sans-serif">&lt;title&gt;MapServer 4.0 Tutorial&lt;/title&gt;</font>
<br><font size=2 face="sans-serif">&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;</font>
<br><font size=2 face="sans-serif">&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;ms35.css&quot; /&gt;</font>
<br><font size=2 face="sans-serif">&lt;/head&gt;</font>
<br>
<br><font size=2 face="sans-serif">&lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;&gt;</font>
<br><font size=2 face="sans-serif">&lt;table align=&quot;center&quot; width=&quot;600&quot; border=&quot;0&quot;&gt;</font>
<br><font size=2 face="sans-serif">&lt;tr&gt;</font>
<br><font size=2 face="sans-serif">&lt;td&gt;</font>
<br><font size=2 face="sans-serif">&lt;h3 align=&quot;center&quot;&gt;Example 1.4: Labeling the Map&lt;/h3&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;div align=&quot;center&quot;&gt;&lt;img border=&quot;1&quot; src=&quot;/cgi-bin/mapserv40?map=C:/Program Files/Apache Group/Apache2/htdocs/tutorial/example1-4.map&amp;mode=map&quot; /&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;/div&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p align=&quot;left&quot;&gt;We can also add labels to our map.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;hr&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p align=&quot;left&quot;&gt;This is what the mapfile looks like:&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;pre align=&quot;left&quot;&gt;MAP</font>
<br><font size=2 face="sans-serif">&nbsp; IMAGETYPE PNG</font>
<br><font size=2 face="sans-serif">&nbsp; EXTENT 201621.496941 -294488.285333 1425518.020722 498254.511514</font>
<br><font size=2 face="sans-serif">&nbsp; SIZE 400 300</font>
<br><font size=2 face="sans-serif">&nbsp; SHAPEPATH &amp;quot;data&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; IMAGECOLOR 255 255 255</font>
<br><font size=2 face="sans-serif">&nbsp; FONTSET &amp;quot;fonts/fonts.list&amp;quot;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; PROJECTION</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &amp;quot;proj=laea&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &amp;quot;ellps=clrk66&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &amp;quot;lat_0=45&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &amp;quot;lon_0=-100&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; #</font>
<br><font size=2 face="sans-serif">&nbsp; # Alternatively, you can specify an EPSG code.</font>
<br><font size=2 face="sans-serif">&nbsp; # &amp;quot;init=epsg:2163&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; #</font>
<br><font size=2 face="sans-serif">&nbsp; END</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; # Start of LAYER DEFINITIONS ---------------------------------------------</font>
<br><font size=2 face="sans-serif">&nbsp; LAYER # States polygon layer begins here</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; NAME states_poly</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; DATA states_ugl</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; STATUS DEFAULT</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; TYPE POLYGON</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; PROJECTION</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &amp;quot;init=epsg:4326&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASSITEM &amp;quot;CLASS&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; LABELITEM &amp;quot;STATE&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASS</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; EXPRESSION 'land'</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; COLOR 232 232 232</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; LABEL</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; COLOR 132 31 31</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; SHADOWCOLOR 218 218 218</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; SHADOWSIZE 2 2</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; TYPE TRUETYPE</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; FONT arial-bold</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; SIZE 12</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; ANTIALIAS TRUE</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; POSITION CL</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; PARTIALS FALSE</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; MINDISTANCE 300</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; BUFFER 4</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; END # end of label</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br><font size=2 face="sans-serif">&nbsp; END # States polygon layer ends here</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; LAYER # States line layer begins here</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; NAME states_line</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; DATA states_ugl</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; STATUS DEFAULT</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; TYPE LINE</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; PROJECTION</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &amp;quot;init=epsg:4326&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASSITEM &amp;quot;CLASS&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; CLASS</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; EXPRESSION 'land'</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; COLOR 64 64 64</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; END</font>
<br><font size=2 face="sans-serif">&nbsp; END # States line layer ends here</font>
<br><font size=2 face="sans-serif">&nbsp; # End of LAYER DEFINITIONS -------------------------------</font>
<br><font size=2 face="sans-serif">END # end of map file&lt;/pre&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;hr align=&quot;center&quot; width=&quot;300&quot;&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;Here we introduce a few more parameters along with the LABEL object:&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;FONTSET&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Here we specify the full path to our truetype fonts list (or font set)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; file. This file lists each of the available fonts. See the file itself</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; and the &lt;a href=&quot;http://mapserver.gis.umn.edu/doc40/fontset.html&quot;&gt;MapServer</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; fonset documentation&lt;/a&gt; for more info. FONTSET is a parameter of the</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; MAP object.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;LABELITEM&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; This specifies which data attribute to use for labeling, in this case</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &amp;quot;STATE&amp;quot;. LABELITEM is a parameter of the LAYER object.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;LABEL&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Marks the beginning of the LABEL object. The label object can be used</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; under other objects (i.e. the SCALEBAR object).&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt; COLOR&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Within the LABEL object, COLOR specifies the color of the label text.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;SHADOWCOLOR&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; This specifies the shadow color of the label text.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;SHADOWSIZE&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Specifies the shadow size. The value corresponds to the X and the Y shifts</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; in pixels. So, &amp;quot;2 2&amp;quot; means two pixels wide by two pixels high.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;TYPE&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Within the LABEL object, TYPE specifies what type of font to use. We have</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; the choice of TRUETYPE or BITMAP (the built-in fonts). We choose TRUETYPE.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;FONT&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; If you specify TYPE as TRUETYPE, you need to specify what font to use.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; The value here is the &amp;quot;alias&amp;quot; in the font list file.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;SIZE&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; If using truetype fonts, the value is size in pixels. If bitmap, you can</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; say something like &amp;quot;small&amp;quot; or &amp;quot;large&amp;quot;.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;ANTIALIAS&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; This turns truetype antialiasing on or off. Remember the value isn't on</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; or off but TRUE or FALSE.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;POSITION&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Where to position the label text in relation to the label points. The</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; value is a combination of vertical and horizontal positions. You have</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; the following choices for vertical alignment: C for center, U for upper,</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; and L for lower. For horizontal alignment you have the following choices:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; C for center, L for left, and R for right. So, to align the label text</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; to the center of label ID you'd use the value &amp;quot;CC&amp;quot; (center-center).</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Or if you'd like it to be on the lower left of the ID, you'd use LL. Another</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; way is to let MapServer decide the best position for your labels. For</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; this you would use the value &amp;quot;AUTO&amp;quot;.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;PARTIALS&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Tells MapServer whether to generate incomplete label texts or not. The</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; default here is not to generate fragments of a label text. The value is</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; either TRUE or FALSE.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;MINDISTANCE&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; This is the minimum distance in pixels between duplicate labels. See what</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; happens if you increase or decrease this value.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;BUFFER&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; The padding (in pixels) for each label. This is used to enhance readability.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; A BUFFER of 4 pixels mean that no label will be drawn within four pixels</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; of each other. Again, change to see how it works.&lt;br&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;hr align=&quot;center&quot; width=&quot;300&quot;&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p&gt;You can also create labels separate from a POLYGON layer. You do this</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; with the ANNOTATION data type. Have a look at the file &amp;quot;example1-4a.map&amp;quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; to see how you'd implement this kind of labeling. You will notice that</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; the CLASS object within the &amp;quot;label&amp;quot; layer has a COLOR parameter</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; value of &amp;quot;-1 -1 -1&amp;quot;. The negative number tells MapServer to</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; give this CLASS a transparent color (the label IDs don't show up). Once</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; again, play with the values to understand how it affects the map.&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;hr&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;p class=&quot;Small&quot; align=&quot;center&quot;&gt;&lt;a href=&quot;example1-3.html&quot;&gt;Back to Example</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; 1.3&lt;/a&gt; | &lt;a href=&quot;section1.html&quot;&gt;Back to the Section 1&lt;/a&gt; | &lt;a href=&quot;sections.html&quot;&gt;Back to the Sections Page&lt;/a&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &lt;a href=&quot;example1-5.html&quot;&gt;Proceed to Example 1.5&lt;/a&gt;&lt;/p&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &lt;/td&gt;</font>
<br><font size=2 face="sans-serif">&lt;/tr&gt;</font>
<br><font size=2 face="sans-serif">&lt;/table&gt;</font>
<br><font size=2 face="sans-serif">&lt;/body&gt;</font>
<br><font size=2 face="sans-serif">&lt;/html&gt;</font>
<br>
<br><font size=2 face="sans-serif">image tag as obtained from 'view source':</font>
<br><font size=2 face="sans-serif">&lt;img border=&quot;1&quot; src=&quot;/cgi-bin/mapserv40?map=C:/Program Files/Apache Group/Apache2/htdocs/tutorial/example1-4.map&amp;mode=map&quot; /&gt;</font>
--=_alternative 006849E887256E2E_=--



More information about the mapserver-users mailing list