Re: [OSM-dev] Standard for Map Key
Hi, I am creating map key automatically on my MTB maps - http://mtbmap.cz (tab Legend). It is still full of cartographic and rendering mistakes, but it is just a matter of time to fix it. It is created automatically from mapnik xml style file for each zoom level. There is only extra name attribute created once by hand in each Rule element. I can provide any other details if anyone is interested. Source codes are here (app styles): https://github.com/mattesCZ/mtbmap Cheers, Martin 2013/9/17 Peter K peat...@yahoo.de Thanks Yves for the pointer! Also the cloudmade support brought another project to my attention: http://humangeo.github.io/leaflet-dvf/ See below where it reads: *Legends - Useful for visually informing users about the dynamic styles associated with your L.DataLayer instances* and *L.Control.Legend - Add this control to your map to automatically display a dynamic legend for any L.DataLayer based instance that you add to your map * Regards, Peter. I spent some time 3 years ago on the subject, and came out with that: https://github.com/yvecai/RenderLegend Unfortunately, the demo website that was showing mapkeys for various styles, in various languages, and changing when zooming the map is not anymore. It's not usefull to try to create the legend automatically from a style. It was in xml at the time, but I doubt today's css change a lot in this matter: you'll need a full fledged sql parser. I ended up with this as the entry point: https://github.com/yvecai/RenderLegend/blob/master/legend_compact.xml This kind of file should probably come in 2 version: a short one and a to-be-complete one. Hope this helps, Yves On 09/16/2013 11:55 AM, Peter K wrote: Hi, is there a kind of a standard or suggestion on how to retrieve the map key? Like an http API or a leaflet plugin? On osm.org there is only the 'map key' data available for the default layer in the right box. And not all details are given like here: http://wiki.openstreetmap.org/wiki/DE:Map_Features Someone knows some open source effort for more details and for support of the various providers like mapquest, osm.de, cloudmade, ...? Kind Regards, Peter. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev . ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Standard for Map Key
Thanks Yves for the pointer! Also the cloudmade support brought another project to my attention: http://humangeo.github.io/leaflet-dvf/ See below where it reads: /Legends - Useful for visually informing users about the dynamic styles associated with your L.DataLayer instances/ and /L.Control.Legend - Add this control to your map to automatically display a dynamic legend for any L.DataLayer based instance that you add to your map/ Regards, Peter. I spent some time 3 years ago on the subject, and came out with that: https://github.com/yvecai/RenderLegend Unfortunately, the demo website that was showing mapkeys for various styles, in various languages, and changing when zooming the map is not anymore. It's not usefull to try to create the legend automatically from a style. It was in xml at the time, but I doubt today's css change a lot in this matter: you'll need a full fledged sql parser. I ended up with this as the entry point: https://github.com/yvecai/RenderLegend/blob/master/legend_compact.xml This kind of file should probably come in 2 version: a short one and a to-be-complete one. Hope this helps, Yves On 09/16/2013 11:55 AM, Peter K wrote: Hi, is there a kind of a standard or suggestion on how to retrieve the map key? Like an http API or a leaflet plugin? On osm.org there is only the 'map key' data available for the default layer in the right box. And not all details are given like here: http://wiki.openstreetmap.org/wiki/DE:Map_Features Someone knows some open source effort for more details and for support of the various providers like mapquest, osm.de, cloudmade, ...? Kind Regards, Peter. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev . ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Standard for Map Key
On 16/09/13 10:55, Peter K wrote: is there a kind of a standard or suggestion on how to retrieve the map key? Like an http API or a leaflet plugin? On osm.org there is only the 'map key' data available for the default layer in the right box. And not all details are given like here: http://wiki.openstreetmap.org/wiki/DE:Map_Features Someone knows some open source effort for more details and for support of the various providers like mapquest, osm.de, cloudmade, ...? It's all controlled by a YAML file in the source: https://github.com/openstreetmap/openstreetmap-website/blob/master/config/key.yml So you would need to provide a patch that updated that, with appropriate images and messages in the english locale file for any new names: https://github.com/openstreetmap/openstreetmap-website/blob/master/config/locales/en.yml#L1387 Note that I would like to move to using a single sprite image (or maybe one per layer) at some point, rather than lots of little images, so if anybody wanted to tackle that it would be good. I would just caution that any thought of trying to add everything which is rendered to the key is probably something you should immediately forget about - the result would be insanely long. I would recommend just concentrating on major things and adding the missing layers. Tom -- Tom Hughes (t...@compton.nu) http://compton.nu/ ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Standard for Map Key
From: Tom Hughes [mailto:t...@compton.nu] Sent: Monday, September 16, 2013 3:16 AM Subject: Re: [OSM-dev] Standard for Map Key I would just caution that any thought of trying to add everything which is rendered to the key is probably something you should immediately forget about - the result would be insanely long. I would recommend just concentrating on major things and adding the missing layers. Taking this up, I wonder about something like the HOT style legend http://hotosm.github.io/HDM-CartoCSS/ I'm not sure what's powering it or if it's just manually generated, but it's a lot more usable than the current osm.org standard legend. It very good for finding what a feature looks like on the map - not so sure for finding out what a feature you see on the map is. E.g. are these dashed blue lines a marina, cycleway, or any of the other things dashed blue lines are used for. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Standard for Map Key
Hi, as far as I know all map keys are created by hand. I'm not sure what you refer to exactly, but basically I see two things which would be great to have: 1) some kind of standard to retrieve a map key for a given tile set; e.g. tile-URL is tile.openstreetmap.org/{z}/{x}/{y}.png, then search for map key information (in a structured format, not html) at tile.openstreetmap.org/mapkey.xml As far as I know there is nothing like that yet. 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. 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. regards Peter Am 16.09.2013 11:55, schrieb Peter K: Hi, is there a kind of a standard or suggestion on how to retrieve the map key? Like an http API or a leaflet plugin? On osm.org there is only the 'map key' data available for the default layer in the right box. And not all details are given like here: http://wiki.openstreetmap.org/wiki/DE:Map_Features Someone knows some open source effort for more details and for support of the various providers like mapquest, osm.de, cloudmade, ...? Kind Regards, Peter. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Standard for Map Key
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
Re: [OSM-dev] Standard for Map Key
Hi! Peter Wendorff: Hi, as far as I know all map keys are created by hand. I'm not sure what you refer to exactly, but basically I see two things which would be great to have: 1) some kind of standard to retrieve a map key for a given tile set; e.g. tile-URL is tile.openstreetmap.org/{z}/{x}/{y}.png, then search for map key information (in a structured format, not html) at tile.openstreetmap.org/mapkey.xml As far as I know there is nothing like that yet. Yes, that was what I meant and I think Tom already mentioned similar stuff 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. 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. Probably it is easier to generate a list with all things and select/order it manually. Andy Allan: ... I've been developing something that does this. 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 Nice! How does the output look like at the moment? Identical to what Tom mentioned? At the end it would make no difference if this file is manually created or by a script. But you should define (with Tom?) a 'standard map key' format!? IMO a file like the key.yml is all we need and supporting an image sprite is easy possible via a lookup by the name/id (plus ignoring the provided png). Kind Regards, Peter. Am 16.09.2013 11:55, schrieb Peter K: Hi, is there a kind of a standard or suggestion on how to retrieve the map key? Like an http API or a leaflet plugin? On osm.org there is only the 'map key' data available for the default layer in the right box. And not all details are given like here: http://wiki.openstreetmap.org/wiki/DE:Map_Features Someone knows some open source effort for more details and for support of the various providers like mapquest, osm.de, cloudmade, ...? Kind Regards, Peter. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Standard for Map Key
Hi Andy, I know that it's not easy - and I'm sure it's not possible to do completely without manual work, but I think, it would be great to have something like that. Let's see, what a feature in a map key usually is. 1) a label in the users language describing the features meaning (e.g. city, capital, ...) 2) a small graphical image showing how that feature looks like. The Problem Andy pointed out is, that there is nothing like a feature in the Map Style languages we have so far. Mapnik simply uses the painters algorithm to draw parts of the map on top of each other, building a feature out of several individual parts (like: highway casing, highway fill, highway marker (e.g. oneway), highway label halo, highway label). MapCSS and CartoCSS tackle this slightly introducing special features to connect these parts together. Style developers don't have to use these, but it's possible. Here we now have something like a highway with this casing, that fill and a label like that. Nevertheless this must not be connected completely. E.g. a tunnel might inherit the highways attributes, as in the background it's still mapniks painter algorithm processing the map data. But what's necessary to build a map key item? - we have to know what should be in this map key - we have to know if that map key should be displayed. For Mapnik we could use an additional attribute to any symbolizer. Let's call it mapkey, and let it work semantically like the class attribute in html, containing a list of class names. From that we could generate a map key: - for each mapkey value (where one mapkey attribute is a list of values) get all items sharing the same map key. - generate a data item for that: - from the symbolizer types decide if you use a rectangle, line or point as a basis - add the features to match filters and label-attributes - render as usual with the mapnik style This could be tweaked, e.g. rendering on different background colors or whatever, but it's essentially what I would expect in the map key. Now only the label texts (describing the individual features) are missing, but you could use the class names for this as a key in any localization engine like on osm.org. Your https://github.com/gravitystorm/mapnik-legendary approach IMHO is exactly the right direction, it's just one additional step to add it to the stylesheets instead of adding an additional file. For your example file [1], as far as I understand it: - width height and background are general settings for the map key. - features is a set of features to add to the map key - with my sketched idea above these would be the individual mapkey classes from cartocss. - type: as described: depends on the symbolizers used on the current class - tags: as described: pulled from filters and labelling-commands - layers: might not be necessary - zoom: should be a zoom range and could be pulled from the zoom selectors of the layers. I'm sure it's possible to bundle that together, and even bundling that to cartocss should be possible - and might be interesting for tilemill as well. regards Peter [1] https://github.com/gravitystorm/mapnik-legendary/blob/master/examples/openstreetmap-carto-legend.json Am 16.09.2013 14:53, schrieb Andy Allan: 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
Re: [OSM-dev] Standard for Map Key
I spent some time 3 years ago on the subject, and came out with that: https://github.com/yvecai/RenderLegend Unfortunately, the demo website that was showing mapkeys for various styles, in various languages, and changing when zooming the map is not anymore. It's not usefull to try to create the legend automatically from a style. It was in xml at the time, but I doubt today's css change a lot in this matter: you'll need a full fledged sql parser. I ended up with this as the entry point: https://github.com/yvecai/RenderLegend/blob/master/legend_compact.xml This kind of file should probably come in 2 version: a short one and a to-be-complete one. Hope this helps, Yves On 09/16/2013 11:55 AM, Peter K wrote: Hi, is there a kind of a standard or suggestion on how to retrieve the map key? Like an http API or a leaflet plugin? On osm.org there is only the 'map key' data available for the default layer in the right box. And not all details are given like here: http://wiki.openstreetmap.org/wiki/DE:Map_Features Someone knows some open source effort for more details and for support of the various providers like mapquest, osm.de, cloudmade, ...? Kind Regards, Peter. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev . ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev