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
<<attachment: Mountain_pass_example.JPG>>
Index: osm-template.xml
===================================================================
--- osm-template.xml (revision 11012)
+++ osm-template.xml (working copy)
@@ -152,6 +152,23 @@
<Filter>[aeroway]='aerodrome'</Filter>
<TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="8" fill="#636" halo_radius="1" wrap_width="0"/>
</Rule>
+
+ <Rule>
+ <MaxScaleDenominator>750000</MaxScaleDenominator>
+ <MinScaleDenominator>100000</MinScaleDenominator>
+ <Filter>[mountain_pass]='yes'</Filter>
+ <PointSymbolizer file = "%SYMBOLS_DIR%/mountain_pass.p.12.png" type="png" width="12" height="12" />
+ <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="8" fill="#000000" dy="10" halo_radius="1" wrap_width="20"/>
+ <TextSymbolizer name="ele" face_name="DejaVu Sans Book" size="6" fill="#000000" dy="-10" halo_radius="1" wrap_width="20"/>
+ </Rule>
+
+ <Rule>
+ <MaxScaleDenominator>75000</MaxScaleDenominator>
+ <Filter>[mountain_pass]='yes'</Filter>
+ <PointSymbolizer file = "%SYMBOLS_DIR%/mountain_pass.p.20.png" type="png" width="20" height="20" />
+ <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="10" fill="#000000" dy="16" halo_radius="1" wrap_width="20"/>
+ <TextSymbolizer name="ele" face_name="DejaVu Sans Book" size="8" fill="#000000" dy="-16" halo_radius="1" wrap_width="20"/>
+ </Rule>
<Rule>
<MaxScaleDenominator>5000</MaxScaleDenominator>
@@ -5223,7 +5240,7 @@
<Parameter name="user">%DBUSER%</Parameter>
<Parameter name="password">%DBPASS%</Parameter>
<Parameter name="dbname">%DBNAME%</Parameter>
- <Parameter name="table">(select * from %PREFIX%_point where amenity IS NOT NULL or railway is NOT NULL or "natural" is NOT NULL or man_made is NOT NULL or highway is NOT NULL or aeroway is NOT NULL or power_source is NOT NULL) as amenity</Parameter>
+ <Parameter name="table">(select * from %PREFIX%_point where amenity IS NOT NULL or railway is NOT NULL or "natural" is NOT NULL or man_made is NOT NULL or highway is NOT NULL or aeroway is NOT NULL or power_source is NOT NULL or mountain_pass is NOT NULL ) as amenity</Parameter>
<Parameter name="estimate_extent">false</Parameter>
<Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
</Datasource>
_______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/dev

