Hello Luca, try using butt as line cap (probably fill.line_cap = line_cap.BUTT_CAP, but didn't check that) and increase the dash space for trial i.e. fill.add_dash(20,20) I used to have simmilar problem when cap is round and dash is short the dash effect can be hardly noticable. The reason is that round cap is ending half of the thicknes of the line after the last point in line (check http://www.w3.org/TR/SVG/images/painting/linecap.svg). So if you want to use the round cap your dash spacing must by grater then two times thicknes of the line or the line would be coninous. I hope this will be helpful.
Best Regards Cezary Tarnowski 2011/1/23 Luca Delucchi <[email protected]>: > 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 > _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

