[Mapserver-users] annotating polygons

Fawcett, David David.Fawcett at state.mn.us
Mon Oct 20 10:52:12 EDT 2003


Peter, 

A couple of thoughts.  

Try setting the FORCE property of the LAYER object to TRUE.  It could be that your label isn't showing up because of a collision with the label from another polygon.  

You may also try to set PARTIALS to TRUE.  This will show the label even if there isn't room to display the full text of the label.  (the default is true).  

Are you displaying other layers along with the country polygons?  Are labels from those layers colliding with your country labels?  Temporarily turn off the other layers to see if that affects labeling.  If that is the case, you may want to change the draw order.  

David. 

> ----------
> From: 	Peter.Bruton at ccrs.nrcan.gc.ca[SMTP:Peter.Bruton at ccrs.nrcan.gc.ca]
> Sent: 	Monday, October 20, 2003 7:27 AM
> To: 	mapserver-users at lists.gis.umn.edu
> Subject: 	[Mapserver-users] annotating polygons
> 
> 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
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 



More information about the mapserver-users mailing list