Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm developing map with Mapserver to be rendered in tiles and testing output with Ka-map. Most of the time labels split on two tiles are matching, but sometimes they're not.
I configured Ka-Map like

$tileWidth = 256;
$tileHeight =256;
$metaWidth = 4;
$metaHeight = 4;
/* $metaBuffer = Buffer size in pixels to add around metatiles to avoid
 * rendering issues along the edge of the map image
 */
$metaBuffer = 256;

but even large buffer of 256 pixels doesn't protect label from occasional splitting.
What good practices do exist to make sure labels are placed deterministically?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can try the PARTIALS options for MapServer labels. This makes sure that labels are only drawn if they can fit completely on the generated image. It's set to TRUE by default, so try FALSE.

PARTIALS [true|false]

Can text run off the edge of the map? Default is true.

For example:

LABEL
  COLOR  150 150 150
  SIZE 6
  POSITION AUTO
  PARTIALS FALSE
END

There are several other placement options available to experiment with such as REPEATDISTANCE, MAXOVERLAPANGLE, MAXLENGTH and:

POSITION [ul|uc|ur|cl|cc|cr|ll|lc|lr|auto]

Position of the label relative to the labeling point (layers only). “Auto” placement is only available with cached labels.

The auto option for placement is only available for cached labels. To enable this option you the LABELCACHE option must be set to ON for the LAYER object - it is ON by default so you shouldn't have to add this unless yo uwant to be more explicit.

LABELCACHE [on|off]

Specifies whether labels should be drawn as the features for this layer are drawn, or whether they should be cached and drawn after all layers have been drawn. Default is on. Label overlap removal, auto placement etc... are only available when the label cache is active.

share|improve this answer
    
Thanks! Now tile borders are somewhat visible as labels avoiding them, but map looks much better and I can revert to minimal meta buffer. –  alxx Jun 1 '11 at 12:28
    
But if deterministic placement possible, I still would be glad to hear about it, as it would distribute labels more evenly. –  alxx Jun 1 '11 at 12:29
    
@alxx - check out the auto POSITION option - see updated answer –  geographika Jun 1 '11 at 12:52
    
+1 I didn't know about this feature of MapServer. Thus, when caching, with TileCache, WMS layers I avoided annotation layers because the effect described in the question. Please, could you tell us since what MapServer version is this feature available? –  dariapra Jun 1 '11 at 14:26
    
@dariapra The PARTIALS option has been around for at least 5 years. So v4.6? Maybe earlier. –  geographika Jun 1 '11 at 14:40
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.