[Mapserver-users] annotating polygons

Peter.Bruton at CCRS.NRCan.gc.ca Peter.Bruton at CCRS.NRCan.gc.ca
Mon Oct 20 10:25:01 PDT 2003


Hello;

Thanks for the reply.

FORCE
=====
The Force setting does not affect whether the US and Russia are annotated at
the initial view.  In the initial view, neither country is annotated.  I
expected both to be annotated when Force is set to true.  Why they are not
escapes me.  The fact that both are annotated when different extents are
specified escapes me also.

World view
http://atlas.gc.ca/cgi-bin/mapserv?map=/home/mapdata/aoc_v3/english/pb_world
.map&version=1.1.0&layers=ocean,land,boundaries,country_names&styles=&format
=GIF&request=getmap&bbox=-180,-90,180,90&srs=epsg:4269

North America view
http://atlas.gc.ca/cgi-bin/mapserv?map=/home/mapdata/aoc_v3/english/pb_world
.map&version=1.1.0&layers=ocean,land,boundaries,country_names&styles=&format
=GIF&request=getmap&bbox=-180,0,0,90&srs=epsg:4269

Asia View
http://atlas.gc.ca/cgi-bin/mapserv?map=/home/mapdata/aoc_v3/english/pb_world
.map&version=1.1.0&layers=ocean,land,boundaries,country_names&styles=&format
=GIF&request=getmap&bbox=0,-90,180,90&srs=epsg:4269



PARTIALS
========
Partials are already set to true in this layer

Other layers
============
The map file has one other layer that annotates features (populated places).
However, the STATUS of all layers in the map is set to OFF.  That being the
case, I do not think that the populated places names layer will affect the
countries annotated in the returned map.

Any comments are welcome.

Peter Bruton

-----Original Message-----
From: Fawcett, David [mailto:David.Fawcett at state.mn.us]
Sent: Monday, October 20, 2003 10:52 AM
To: mapserver-users at lists.gis.umn.edu; 'Peter.Bruton at ccrs.nrcan.gc.ca'
Subject: RE: [Mapserver-users] annotating polygons


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