[OSM-dev] Mapnik rendering of mountain_pass = 'yes'
Stefan Wenk
stefan.wenk at gmx.at
Sun Oct 5 15:38:56 BST 2008
Hi,
I'm trying to render mountain passes with mapnik. In the attachment you can
find an example of the current status.
As everyone can see the result needs improvement, as the pass symbol does not
follow the direction of the corresponding way (look at
the "Scharnitzsattel").
What I did is that I just simply followed the general mapnik pattern for
rendering of nodes.
*) I took the mountain_pass.svg icon from
http://svn.openstreetmap.org/applications/share/map-icons/svg/misc/landmark/
and generated *.png icons with svg-twotone
*) added the following two lines to the default.style of osm2pgsql:
node,way mountain_pass text
node,way ele text
*) Enhanced the mapnik osm-template.xml - the patch is attached.
The problem is that according to the defintion the "mountain_pass" tag applies
to nodes, not to ways. Therefore the rendering uses an icon. The icon would
need to be rotated according to the direction of the way at the specific
node, which is tagged with mountain_pass='yes'. There was some discussion if
the mountain_pass tag should be a property of the highest node of the pass,
or of the way. I believe that the method for tagging a mountain pass as a
property of the highest node of the way is fine, but that the rendering way
needs to be enhanced for it. By the way, the same applies to the bridge='yes'
tag, if the bridge tag is assigned to a node and not to a way.
I think that one possiblity is to generate a short artificial overlapping
dummy way in osm2pgsql. osm2pgsql could somehow create this dummy way, which
consists of the very mountain_pass= 'yes' node plus one node, which lies on
the way in a short distance, let's say in 25 meters. The "highway" tag of the
dummy node could be set to the highway tag of the original way.
There are special cases if the node is an end-node of a way, and not somewhere
in between.
Another possiblity would be to generate a tag for the node, which contains
the direction of the way and select rotated mountain_pass icons in the
osm.xml accordingly. I don't like this one.
Are there other possilities and what is the best method of addressing this
issue?
thanks
Exosorange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mountain_pass_example.JPG
Type: image/jpeg
Size: 13485 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20081005/2c123f34/attachment.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osm-template-mountain_pass-patch.xml
Type: text/xml
Size: 2384 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20081005/2c123f34/attachment.xml>
More information about the dev
mailing list