On 16 September 2013 12:14, Peter Wendorff <wendo...@uni-paderborn.de> wrote:
> as far as I know all map keys are created by hand. I think that's true, and therefore somewhat tedious! > 2) it would be really great to have some automatic map key generation > out of the style files. For Mapnik that's incredible ugly as mapnik does > not have any semantic connection between e.g. highway casing, fill and > label. For CartoCSS (which is used since a while for the default style) > this might be possible in parts. I don't think it's particularly feasible - the definitions for all the symbolizers that make up a zoom level 17 trunk bridge are spread around a fair amount, and so you'd need a "CartoCSS-complete" parser to figure out what symbolizers apply to a feature, and then a "mapnik-complete" rendering engine to ensure that the symbolizer attributes are accurately reflected in the legend images. Which is why... > In any case it would require additional information like which label to > use for a particular feature in the map key, which items should NOT be > displayed (as Tom mentioned) or in which order items should be displayed. ... I've been developing something that does this. It takes a legend.json file which describes what features should be drawn (and in what order, what description to use, which geometries etc) and spits out a series of mapnik renderings for each feature. It's still very, very alpha quality but it's available at https://github.com/gravitystorm/mapnik-legendary I aim to make it configurable enough to recreate what we have at the moment, and to make it easy/feasible for me to create legends for my other styles, and to add more functionality like sprite images. The ultimate goal is to be able to create legends like the Ordnance survey have - for those not familiar with them, have a look at https://github.com/gravitystorm/mapnik-legendary and check out the way that the railway crossings in the 1:25,000 or water features in the 1:50,000 maps are shown for some inspiration. Overall, I have no intention of manually updating the legend that we have at the moment. If anyone wants to take it on then feel free, but my efforts are going into mapnik-legendary Cheers, Andy _______________________________________________ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev