At last, I come up with something that seems ok: A simple way for users to make a complete legend out of a mapnik xml map file.
It's here:
    https://github.com/yvecai/RenderLegend
And the result can be seen here:
    http://dev-yves.dyndns.org/legend/page.html
I tested the script on several map files found here and there, feel free to test it with yours.

Deeper work can be done in parsing the database queries in the postgis datasource, but everything works on the slippy map except turning circles and spur-siding-yards (select ... as statements).

Concerning mapnik, I stumbled on the PolygonSymbolizer issue with osm datasource (http://trac.mapnik.org/ticket/673). As a workaround I don't allow polygons to be rendered with rules that do not contain a polygonSymbolizer by adding a filter. If you want a node in the middle of the polygon, say so.

The next issue I have is for managing external entities in the xml: this would be really easy to serialize the style sheet with mapnik.load_map(), but this does not work if the database parameter or shapefiles in the original stylesheet are not correctly set (http://trac.mapnik.org/ticket/153). And setting them is not as user friendly as I wanted. Maybe mapnik.load_map() could use an extra parameter that would avoid datasource validation ?

Comments welcome!
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to