[OSM-talk] Rendering of Place Names in Mapnik

Karl Newman siliconfiend at gmail.com
Thu Dec 18 00:20:45 GMT 2008

On Wed, Dec 17, 2008 at 3:21 PM, Scott Atwood <scott.roy.atwood at gmail.com>wrote:

> How does Mapnik select which place names to render when the cities are
> close enough that there would be label collisions in the rendering?  And is
> there any good way of tagging the place name to give better hints about
> which place names should have priority in case of collisions?
> In particular, when I look at renderings of the California Bay Area at
> various zoom levels, I see lots of poor choices for name collision
> resolution.
> Virtually everyone would agree that San Francisco is the most prominent
> city in the region, and should win any name rendering collision amongst
> cities in the region.  Yet, at zoom level 6 and 7, Daly City gets rendered
> instead of San Francisco.  Similarly, Oakland and San Jose are the next most
> prominent cities in the region, yet at many zoom levels, smaller and less
> prominent adjacent places get rendered instead.
> Another related quirk is that some of these smaller place names are have
> discontinuities in when then show in the zoom sequence, e.g. Mountain View
> shows up at zoom level 6 and 8, but not 7, and Santa Clara shows up at zoom
> level 7, 9, and 11, but not 8 or 10.
> I'm sure this problem is not unique to the Bay Area, but it is merely an
> example drawn from an area that I'm very familiar with.
> Is there a good solution to this problem?
> -Scott

I looked a bit at the osm.xml file for Mapnik. It currently orders them by
the place tag hierarchy (city, town, suburb, village, hamlet/locality), but
there doesn't seem to be any sorting within equal hierarchies (which is
probably why you see Daly City instead of San Francisco at certain zooms).
Ideally it could do this by population, with a bonus for capitals. The
documentation for Mapnik indicates that it supports value comparisons, but
it looks like the population would have to be stored in a column. Anyway,
that seems like it would be the way to go.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20081217/c88db291/attachment.html>

More information about the talk mailing list