[Mapserver-users] annotating logic

Peter.Bruton at CCRS.NRCan.gc.ca Peter.Bruton at CCRS.NRCan.gc.ca
Thu Oct 16 09:49:44 EDT 2003


Hello;

I have setup a WMS using Mapserver 3.6.6.  The WMS serves up layers (data
source are ESRI shapefiles) that depict oceans, land, boundaries, country
names, etc.  For the most part the WMS works correctly.  However, I am
having trouble understanding how Mapserver annotates features.

One of the layers in the WMS renders country names.  In order to make the
layer legible, the number of country names that appear on the map at any one
time must be controlled in some way.  To achieve this goal ArcView was used
to summarize the DBF table using the country name attribute.  The result of
this operation was to create a DBF that has only one entry for each country.
An attribute was then added to the shapefile that ranked each country by
area.   The shapefile was then sorted using the "sortshp" utility.  This was
done so that the countries with the largest land areas would be annotated
first.

  LAYER
    NAME "country_names"
    STATUS OFF
    DATA "w_rnk1_p"
    TYPE POLYGON
    LABELITEM "ENG_NAME"
    MAXFEATURES 20
    METADATA
      "wms_title"    "Country Names"
      "wms_abstract"    "World country names."
    END
    PROJECTION
     "init=epsg:4326"
    END
    CLASS
#      EXPRESSION ([RANK] = 1)
      LABEL
        FONT "verdanab"
        TYPE TRUETYPE
        POSITION CC
        SIZE 8
        COLOR 0 0 0
        OUTLINECOLOR 226 226 226
        MINFEATURESIZE 10
        ANTIALIAS TRUE
        PARTIALS TRUE
#        FORCE TRUE
      END
    END

To further increase the legibility of country names, the MAXFEATURES
property was set to 20 for the layer that renders country names.  I expected
to a have a map with the 20 largest countries names appearing.  However,
this is not the case. When a GETMAP request was sent to the WMS, two of the
largest four countries (US and Russia) are not annotated.  Furthermore, why
are only 11 countries annotated?  Since MAXFEATURES was set to 20, I
expected the 20 largest countries to be annotated.

If the extents of the GETMAP request are changed to return an image of North
America, the US is annotated.  If the extents of the GETMAP request are
changed to return an image of Asia and Africa, Russia is annotated.  

Why are the US and Russia not annotated in the world views and annotated in
the continental views?  Why are the 20 largest countries by area not labeled
in each view?

My Mapserver configuration is:

MapServer version 3.6.6 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Thanks in advance for any explanation of Mapserver annotation logic.

Peter Bruton




More information about the mapserver-users mailing list