Hi everybody, I'm working on a simple renderer for OSM with Mapnik
library, the idea is to render elements with a color map created by
continuous colors. It works quit well, I have only a problem with
stroke.add_dash(), that I use for some elements (rails, path and
steps). This is the code for linesymbolizer (the full is here [0]):
# create the stroke for line
fill = Stroke()
# set color and width for symbology
fill.color = self.mapColors[element.keys()[0]]
fill.width = self.rendDim[element.keys()[0]]
# set the line cap and line join
fill.line_cap = line_cap.ROUND_CAP
fill.line_join = line_join.ROUND_JOIN
# if element is Rail set the dashes IT DOESN'T WORK but it pass here
if element.keys()[0] == 'Rail':
fill.add_dash(.3,.3)
# if element is Steps set the dashes IT DOESN'T WORK but it pass here
if element.keys()[0] == 'Steps':
fill.add_dash(1,1)
# create symbology with stroke
sym = LineSymbolizer(fill)
# create filter
fil = Filter(element[element.keys()[0]])
I tried to print a word inside the if and return it when I render
steps, rail and path. You can see an example here [1] and compare the
Rails (in the rigth part) with OSM [2].
Advices?
[0] https://github.com/lucadelu/OsmSimpleRendering/blob/master/libs/rendmap.py
[1] https://github.com/lucadelu/OsmSimpleRendering/blob/master/output_test.png
[2] http://osm.org/go/xX0mtdI7P-
Best regards
Luca
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users