pythonmapnik

Mapnik stroke error


I'm getting the following error when I run the program: AttributeError: 'module' object has no attribute 'stroke_linecap'

sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Stroke(mapnik.Color(171,158,137), 0.5)
sym.stroke_width = 2
sym.stroke_linecap = mapnik.stroke_linecap.ROUND #Error is here 

Solution

  • I found a similar problem and ended up figuring it out. stroke_linecap isn't used properly. It should be line_cap.

    sym.line_cap = mapnik.line_cap.ROUND