[OSM-talk] mapnik rendering or tagging issue?

Andy Allan gravitystorm at gmail.com
Mon Oct 6 17:54:04 BST 2008


On Mon, Oct 6, 2008 at 5:28 PM, Ed Loach <ed at loach.me.uk> wrote:
> Stefan asked:
>
>> Is this a problem in mapnik or is it a problem with the OSM
>> data?
>> If the latter, how can I fix it?
>
> It looks like the data is OK. All three are cities, and each is
> tagged as such. I suspect that the lowzoom Mapnik tiles just happen
> to decide that rendering the outer two cities names would overlap
> the name of the middle one, which is Montreal, so drops it.

Yep, it's a common problem. If someone can extend the mapnik
stylesheet and osm2pgsql to do something more clever with place names,
that would be cool.

Zoom levels 4+5 come from VMAP0, hence the ascii-ness. Beyond that,
increasing zoom levels increases the number of types of place names
rendered (cities, towns etc) but there's no priority in placename
rendering. See http://trac.openstreetmap.org/browser/applications/rendering/mapnik/osm-template-fontset.xml#L5329
- it would be nice if there was a z-order for points (and an ORDER BY
clause, of course) that reflected that we'd rather draw city names
first, then towns if there were space etc. Even better, we'd probably
want to order cities by population so that a big city next to a
smaller one still gets its name rendered. Such z-order calculations
are probably best done in osm2pgsql, which is where the z-ordering of
road occurs (see
http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/output-pgsql.c#L88
).

Students will achieve extra credit for moving z-ordering into a
run-time configuration file ala default.style :-)

Cheers,
Andy




More information about the talk mailing list