[OSM-dev] different rendering with mapnik based on area?

11 views
Skip to first unread message

Sven Geggus

unread,
Mar 31, 2012, 12:06:41 PM3/31/12
to d...@openstreetmap.org
Hi there,

is it possible to have different rendering rules based on the area
where rendring takes place using an ordinary mapnik rendering stack
(osm2pgsql+mod_tile+tirex)?

What I would like to do (for now) is implementing a name rendering
logic for the german mapnik style:

name outside europe: coalesce("name:de",int_name,name)
name inside europe: coalesce("name:de",name,int_name)

A rough bounding box around europe would be good enough for this
purpose.

Sven

--
Das allgemeine Persönlichkeitsrecht (Art. 2 Abs.1 i.V.m. Art.1 Abs. 1GG)
umfasst das Grundrecht auf Gewährleistung der Vertraulichkeit und Integrität
informationstechnischer Systeme. (BVerfG, 1BvR 370/07)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

_______________________________________________
dev mailing list
d...@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev

Peter Körner

unread,
Apr 2, 2012, 9:23:44 AM4/2/12
to d...@openstreetmap.org
Am 31.03.2012 21:12, schrieb Phil! Gold:
> * Sven Geggus<li...@fuchsschwanzdomain.de> [2012-03-31 16:06 +0000]:

>> is it possible to have different rendering rules based on the area
>> where rendring takes place using an ordinary mapnik rendering stack
>> (osm2pgsql+mod_tile+tirex)?
>
> Supposedly yes. MapQuest uses has three different stylesheets that they
> use for their tiles and the appropriate one is selected based on where the
> rendered data is.

It won't work without adapting the source. You can choose which source
you want to adapt:
- The Style: use different layers for the areas whith 'SELECT WHERE
ST_Inside(way, ...)'-style queries - simple but slow
- mapnik: somehow..
- mod_tile: switch between different maps depending on the requested
z/x/y-tile
- The Client (OpenLayers/Leaflet): enable/disable base-layers
depending on the visible area

Choose whichever way fits your needs best - and tell us about.
Peter

Reply all
Reply to author
Forward
0 new messages