There is nice rendering library of shapes called Map Machine:
[ https://wiki.openstreetmap.org/wiki/Map_Machine ]