PGMapCSS is a library for PostgreSQL/PostGIS which works between an osm2pgsql based database and Mapnik (and maybe other renderers). It processes database (usually OpenStreetMap) objects according to MapCSS rules and calculates resulting colors, widths and other properties for Symbolizers, even geometric modifications.
Currently only 900913 is supported (functions for osmosis-pgsnapshop #15 always transforms to/from 4326). Specify at compile time.