[patch] change bus_stop to Transit Service category and add name / operator

Hi, Here's a patch to change the highway=bus_stop POI to the Transit Service category and add the name and/or operator. As usual, comments are welcome. Cheers, Ben

Hi Ben, On Fri, Jul 17, 2009 at 02:14:36AM -0400, Ben Konrath wrote:
Here's a patch to change the highway=bus_stop POI to the Transit Service category and add the name and/or operator. As usual, comments are welcome.
Good idea! This will nicely separate bus stops and train stops. Maybe use the same symbol code also for tram stops?
-highway=bus_stop [0x2f08 resolution 21] +highway=bus_stop { name '${name} - ${operator}' | '${name}' | '${operator}' } [0x2f17 resolution 20]
Can we have a variant with ${name} ${ref} to the mix? Or perhaps something like this: underground or train stations: ${ref|highway-symbol:hbox} $name tram stops: ${ref|highway-symbol:box} $name bus stops: ${ref|highway-symbol:oval} $name Nope, unfortunately the Edge 705 would display the highway-symbol:oval as a substitution character (solid diamond, similar to U+FFFD). Around here, there usually are at least two stops with the same name, on each side of the road. (Four if there are tram stops as well.) I would map all stops, especially if some of them are only reachable by bridges or tunnels. There will be a combinatorial explosion if there is no way to write this kind of rules: name += ref name += operator I tested this patch on my Edge 705. Bus stations are still listed with train stops and train stations in the Ground Transport menu. Index: mkgmap/resources/styles/default/points =================================================================== --- mkgmap/resources/styles/default/points (revision 1087) +++ mkgmap/resources/styles/default/points (working copy) @@ -85,7 +85,8 @@ amenity=university [0x2c05 resolution 21] amenity=zoo [0x2c07 resolution 21] -highway=bus_stop [0x2f08 resolution 21] +highway=bus_stop | railway=tram_stop | railway=halt | railway=station { name '${name} ${ref} - ${operator}' | '${name} ${ref}' | '${name} - ${operator}' | '${ref} ${operator}' | '${name}' | '${ref}' | '${operator}' } +highway=bus_stop [0x2f17 resolution 20] highway=motorway_junction { name '${ref} ${name}' | '${ref}' | '${name}' } highway=motorway_junction [0x2000 resolution 16] @@ -133,7 +134,7 @@ railway=halt [0x2f08 resolution 21] railway=station [0x2f08 resolution 20] -railway=tram_stop [0x2f08 resolution 21] +railway=tram_stop [0x2f17 resolution 21] shop=bakers [0x2e02 resolution 20] shop=bakery [0x2e02 resolution 20] Best regards, Marko

used this in my highway=bus_stop [0x2f17 resolution 21] But it didn't appear in mapsource On Fri, Jul 17, 2009 at 4:30 PM, Marko Mäkelä<marko.makela@iki.fi> wrote:
Hi Ben,
On Fri, Jul 17, 2009 at 02:14:36AM -0400, Ben Konrath wrote:
Here's a patch to change the highway=bus_stop POI to the Transit Service category and add the name and/or operator. As usual, comments are welcome.
Good idea! This will nicely separate bus stops and train stops. Maybe use the same symbol code also for tram stops?
-highway=bus_stop [0x2f08 resolution 21] +highway=bus_stop { name '${name} - ${operator}' | '${name}' | '${operator}' } [0x2f17 resolution 20]
Can we have a variant with ${name} ${ref} to the mix? Or perhaps something like this:
underground or train stations: ${ref|highway-symbol:hbox} $name tram stops: ${ref|highway-symbol:box} $name bus stops: ${ref|highway-symbol:oval} $name
Nope, unfortunately the Edge 705 would display the highway-symbol:oval as a substitution character (solid diamond, similar to U+FFFD).
Around here, there usually are at least two stops with the same name, on each side of the road. (Four if there are tram stops as well.) I would map all stops, especially if some of them are only reachable by bridges or tunnels.
There will be a combinatorial explosion if there is no way to write this kind of rules:
name += ref name += operator
I tested this patch on my Edge 705. Bus stations are still listed with train stops and train stations in the Ground Transport menu.
Index: mkgmap/resources/styles/default/points =================================================================== --- mkgmap/resources/styles/default/points (revision 1087) +++ mkgmap/resources/styles/default/points (working copy) @@ -85,7 +85,8 @@ amenity=university [0x2c05 resolution 21] amenity=zoo [0x2c07 resolution 21]
-highway=bus_stop [0x2f08 resolution 21] +highway=bus_stop | railway=tram_stop | railway=halt | railway=station { name '${name} ${ref} - ${operator}' | '${name} ${ref}' | '${name} - ${operator}' | '${ref} ${operator}' | '${name}' | '${ref}' | '${operator}' } +highway=bus_stop [0x2f17 resolution 20]
highway=motorway_junction { name '${ref} ${name}' | '${ref}' | '${name}' } highway=motorway_junction [0x2000 resolution 16] @@ -133,7 +134,7 @@
railway=halt [0x2f08 resolution 21] railway=station [0x2f08 resolution 20] -railway=tram_stop [0x2f08 resolution 21] +railway=tram_stop [0x2f17 resolution 21]
shop=bakers [0x2e02 resolution 20] shop=bakery [0x2e02 resolution 20]
Best regards,
Marko _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- cheers, maning ------------------------------------------------------ "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ ------------------------------------------------------

Hi Maning, On Sat, Jul 18, 2009 at 12:49:17PM +0800, maning sambale wrote:
used this in my highway=bus_stop [0x2f17 resolution 21]
But it didn't appear in mapsource
On today's ride, I noticed that the Edge 705 renders 0x2f17 as a white tiny square, similar to amenity=recycling (0x2f15, public service). Before the patch, it was translated into 0x2f08, rendered as a bus symbol. This is something that could/should be addressed with a TYP file. My understanding is that the "Find Places" menu structure is fixed, but the symbol names and icons can be overridden with a TYP file. Because of this, I would try to avoid overloading Garmin symbol codes. For example, when your vehicle breaks, you want a menu with just the bicycle shops or car services, so that you can search for the nearest ones. I wouldn't care that much how the icons are rendered on the map by default. I would prefer to have only the major things (bus stations and train stops) in one menu and all the others (bus stops, tram stops) in the other menu. In this way, it should be easier to plan long journeys when travelling by train or long-haul bus. And for getting around inside a city, you'd look for the nearest bus or tram stop. I assume that this was Ben's reasoning too. Best regards, Marko
On Fri, Jul 17, 2009 at 4:30 PM, Marko Mäkelä<marko.makela@iki.fi> wrote:
Hi Ben,
On Fri, Jul 17, 2009 at 02:14:36AM -0400, Ben Konrath wrote:
Here's a patch to change the highway=bus_stop POI to the Transit Service category and add the name and/or operator. As usual, comments are welcome.
Good idea! This will nicely separate bus stops and train stops. Maybe use the same symbol code also for tram stops?
-highway=bus_stop [0x2f08 resolution 21] +highway=bus_stop { name '${name} - ${operator}' | '${name}' | '${operator}' } [0x2f17 resolution 20]
Can we have a variant with ${name} ${ref} to the mix? Or perhaps something like this:
underground or train stations: ${ref|highway-symbol:hbox} $name tram stops: ${ref|highway-symbol:box} $name bus stops: ${ref|highway-symbol:oval} $name
Nope, unfortunately the Edge 705 would display the highway-symbol:oval as a substitution character (solid diamond, similar to U+FFFD).
Around here, there usually are at least two stops with the same name, on each side of the road. (Four if there are tram stops as well.) I would map all stops, especially if some of them are only reachable by bridges or tunnels.
There will be a combinatorial explosion if there is no way to write this kind of rules:
name += ref name += operator
I tested this patch on my Edge 705. Bus stations are still listed with train stops and train stations in the Ground Transport menu.
Index: mkgmap/resources/styles/default/points =================================================================== --- mkgmap/resources/styles/default/points (revision 1087) +++ mkgmap/resources/styles/default/points (working copy) @@ -85,7 +85,8 @@ amenity=university [0x2c05 resolution 21] amenity=zoo [0x2c07 resolution 21]
-highway=bus_stop [0x2f08 resolution 21] +highway=bus_stop | railway=tram_stop | railway=halt | railway=station { name '${name} ${ref} - ${operator}' | '${name} ${ref}' | '${name} - ${operator}' | '${ref} ${operator}' | '${name}' | '${ref}' | '${operator}' } +highway=bus_stop [0x2f17 resolution 20]
highway=motorway_junction { name '${ref} ${name}' | '${ref}' | '${name}' } highway=motorway_junction [0x2000 resolution 16] @@ -133,7 +134,7 @@
railway=halt [0x2f08 resolution 21] railway=station [0x2f08 resolution 20] -railway=tram_stop [0x2f08 resolution 21] +railway=tram_stop [0x2f17 resolution 21]
shop=bakers [0x2e02 resolution 20] shop=bakery [0x2e02 resolution 20]
Best regards,
Marko _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- cheers, maning ------------------------------------------------------ "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ ------------------------------------------------------ _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Marko, On Sat, Jul 18, 2009 at 2:49 PM, Marko Mäkelä<marko.makela@iki.fi> wrote: <snip>
I would prefer to have only the major things (bus stations and train stops) in one menu and all the others (bus stops, tram stops) in the other menu. In this way, it should be easier to plan long journeys when travelling by train or long-haul bus. And for getting around inside a city, you'd look for the nearest bus or tram stop. I assume that this was Ben's reasoning too.
Yes, that's exactly what I was thinking. I like your updated rules, thanks for making them. It would be nice to see them committed. About the TYP file, are there any plans to have one included for use with the default style? I don't actually know much about these files yet so my question might be a bit naive. Thanks, Ben

Hi Ben,
About the TYP file, are there any plans to have one included for use with the default style? I don't actually know much about these files yet so my question might be a bit naive.
Same here. Maybe in the dark and rainy winter months when the conditions are worse for biking and mapping, I will get around to studying the TYP file format and tools and coming up with a textual representation that plays more nicely with version control systems (viewing diffs) than the binary format. Marko

Marko Mäkelä <marko.makela@iki.fi> writes:
About the TYP file, are there any plans to have one included for use with the default style? I don't actually know much about these files yet so my question might be a bit naive.
Same here. Maybe in the dark and rainy winter months when the conditions are worse for biking and mapping, I will get around to studying the TYP file format and tools and coming up with a textual representation that plays more nicely with version control systems (viewing diffs) than the binary format.
I don't really understand TYP files, but it seems that having TYP<>xml transcoder (both ways) would be a huge step forward.

Greg Troxel schrieb:
I don't really understand TYP files, but it seems that having TYP<>xml transcoder (both ways) would be a huge step forward.
On Windows you can use the program MapTK for building typ-files based on ASCII files. And also the other direction is possible: you can analyse a typ-file and get an ASCII-description of it. MapTK provides also a simple graphic editor for the map elements. Gruss Torste

I've made good progress using gentyp. Here's an example of custom icons same with potlatch POIs: http://farm4.static.flickr.com/3483/3734397559_b936404cca_o.jpg But I would prefer a typ file compiler within the included in the OSM-Garmin toolset splitter mkgmap typ file editor maybe similar to mkgmap's stylesheet On Sun, Jul 19, 2009 at 9:16 PM, Greg Troxel<gdt@ir.bbn.com> wrote:
Marko Mäkelä <marko.makela@iki.fi> writes:
About the TYP file, are there any plans to have one included for use with the default style? I don't actually know much about these files yet so my question might be a bit naive.
Same here. Maybe in the dark and rainy winter months when the conditions are worse for biking and mapping, I will get around to studying the TYP file format and tools and coming up with a textual representation that plays more nicely with version control systems (viewing diffs) than the binary format.
I don't really understand TYP files, but it seems that having TYP<>xml transcoder (both ways) would be a huge step forward.
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- cheers, maning ------------------------------------------------------ "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ ------------------------------------------------------

Hi Ben, Steve, all, On Sun, Jul 19, 2009 at 01:36:17AM -0400, Ben Konrath wrote:
Hi Marko,
On Sat, Jul 18, 2009 at 2:49 PM, Marko Mäkelä<marko.makela@iki.fi> wrote: <snip>
I would prefer to have only the major things (bus stations and train stops) in one menu and all the others (bus stops, tram stops) in the other menu. In this way, it should be easier to plan long journeys when travelling by train or long-haul bus. And for getting around inside a city, you'd look for the nearest bus or tram stop. I assume that this was Ben's reasoning too.
Yes, that's exactly what I was thinking. I like your updated rules, thanks for making them. It would be nice to see them committed.
I updated the patch today. Stops with none of these attributes will be left unnamed: name, ref, operator, shelter, covered. Stops with just (shelter|covered)=(yes|no) will be called " -" or " +". It would be nice to get rid of the leading spaces when no name is given, but I would not like to duplicate the rules. It could be done by replacing lines like { name '${name|def:} ${ref|def:}-${operator|def:}' } with { name '${name} ${ref|def:}-${operator|def:}'|'${ref|def:}-${operator|def:}' } Best regards, Marko

On Fri, Jul 17, 2009 at 11:30:12AM +0300, Marko Mäkelä wrote:
There will be a combinatorial explosion if there is no way to write this kind of rules:
name += ref name += operator
I thought that it would be nice to translate shelter=yes and shelter=no as well, by appending a '+' or '-' to the name. This could be useful when you are bicycling or walking, and you are looking for the nearest shelter to have a break or to escape from a rain shower. To avoid messy rules, I tried to introduce two auxiliary variables, name_ref and name_ref_op: name=* & ref=* { set name_ref='${name} (${ref})' } name=* & ref!=* { set name_ref='${name}' } ref=* & name!=* { set name_ref='${ref}' } name_ref=* & operator=* { set name_ref_op='${name_ref} - ${operator}' } name_ref=* & operator!=* { set name_ref_op='${name_ref}' } operator=* & name_ref!=* { set name_ref_op='${operator}' } No matter if I use 'set' or 'add', the action { name '${name_ref_op}' } will be ignored. Any ideas? While working on this, I mistyped =!* instead of !=*, and the style parser threw an exception. The ugly patch (which does not use any auxiliary variables) is attached. Marko
participants (5)
-
Ben Konrath
-
Greg Troxel
-
maning sambale
-
Marko Mäkelä
-
Torsten Leistikow