I'm learning to use Tilemill to map Toronto OSM street data. I've added osm2psql data from http://metro.teczno.com/#toronto. When turning on road labels for the line file, I find that I'm getting results much too frequently. Is there a way to control the frequency or distance between labels?
-
text-character-spacing:4; github.com/mapbox/tilemill/blob/master/examples/open-streets-dc/…– Mapperz ♦Commented May 21, 2014 at 20:48
-
this seems to control the spacing between individual characters in a label - i'm looking to control the frequency of the labels themselves– NallyRollCommented May 23, 2014 at 1:16
Add a comment
|
1 Answer
Use text-spacing
and text-min-distance
(when one doesn't work, another would).
Also you may find labels are drawn too ferquently not because those settings are too low, but because labels are drawn for every segment of the road. I doubt there is a solution for Shape files, but in PostGIS (see this tutorial) you can preprocess your label layer with select ST_LineMerge(ST_Union(way)) as way, name from ... where ... group by name
.
-
Hey @IIja - this seems like it may be the answer, I'll try it this evening. I've tried text-min-distance with minimal success...thanks. Commented May 23, 2014 at 16:49
-
You're right - the frequent names are due to each segment and 'lane' on a highway (for example) having a label. The text-min-distance helps this, as well as replacing labels like 'highway NW' and 'highway SW' by just 'highway'. Thanks. Commented May 30, 2014 at 20:37