one wish for creating a style

Hi! According to [1] you have to add to following line
{name '${name} (${ref})' | '${ref}' | '${name}'}
if you want to name a street with 'ref' or 'name' or both. When you have 3 or more tags which could exist, the rule will be very complicated. My wish is that i can give a list of tags and mkgmap adds these, if they exist, to the name tag, but don't bother if one or more tags are missing. This is for mapping purposes. I would like to create a mapping layer in which are mostly all information, all tags in the text string of an POI. Christian [1] http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules P.S. I hope you understand what I mean. My English ist not so good today.

On 08/15/2010 10:06 PM, Christian H. Bruhn wrote:
{name '${name} (${ref})' | '${ref}' | '${name}'} When you have 3 or more tags which could exist, the rule will be very complicated.
I use something like this: set name '${name} ${ref}' set name '${name} ${anothertag}' name ${name} Not the shortest syntax you can find, but it works. I use it actually to add very short like one letter to identify some features. -- Harri

On 08/17/2010 04:08 PM, Christian H. Bruhn wrote:
set name '${name} ${rboxef}' set name '${name} ${anothertag}' name ${name}
OK, but can you use it in one line just for one rule like 'amenity=postbox'?
Here's an example from my style how I use adding info multiple times: # append to name highway=cycleway & surface=paved {set name='${name}+P'} highway=cycleway & surface=unpaved {set name='${name}-P'} # keep appending more highway=cycleway & lit=yes { set name='${name}+L' } highway=cycleway & lit=no { set name='${name}-L' } # set name finally highway=cycleway {name '${name} highway=cycleway {add motorcar = no} [0x27 road_class=0 road_speed=0 resolution 22] Unfortunately that is not one line syntax but on the other hand it needs the comperations anyway. As suggested earlier on the list by Marko the empty def: is better for single line evaluations if you need to add the tag (not something else based on it like I do to keep the name lenght reasonable) -- Harri

On Wed, Aug 18, 2010 at 07:41:55AM +0300, Harri wrote:
Here's an example from my style how I use adding info multiple times:
# append to name highway=cycleway & surface=paved {set name='${name}+P'} highway=cycleway & surface=unpaved {set name='${name}-P'} # keep appending more highway=cycleway & lit=yes { set name='${name}+L' } highway=cycleway & lit=no { set name='${name}-L' } # set name finally highway=cycleway {name '${name} highway=cycleway {add motorcar = no} [0x27 road_class=0 road_speed=0 resolution 22]
(How) do you watch these names when riding your bike? Have you considered using different line styles for all 4 combinations of {paved,unpaved}×{lit,unlit}? Something like this would be useful when mapping. Also segregated=yes/no, moped=yes/no, but that would blow up to 16 combinations already. This may be getting off-topic, but I have found municipal aerial imagery and Google Street View imagery useful. When I find something interesting (pedestrian crossing, bus stop, change in pavement, driveway crossing, whatever) I push the Lap button on my Edge. At home, I load the *.tcx file in JOSM and check the LAP001... points, using the aerial imagery and Google Street View (where available) to boost my memory. This "memory extension" is a good thing, because I don't have to hurry to process all 400km of rides I have pending, with over 1,000 marked points. I can do it in the dark, snowy winter months.
Unfortunately that is not one line syntax but on the other hand it needs the comperations anyway.
Fortunately the style file directives are now processed in sequence. A year ago it was not the case: matching rules could be executed in any order. Marko

On 08/18/2010 08:53 AM, Marko Mäkelä wrote:
On Wed, Aug 18, 2010 at 07:41:55AM +0300, Harri wrote:
Here's an example from my style how I use adding info multiple times:
# append to name highway=cycleway& surface=paved {set name='${name}+P'} highway=cycleway& surface=unpaved {set name='${name}-P'} ... (How) do you watch these names when riding your bike? Have you considered using different line styles for all 4 combinations of {paved,unpaved}×{lit,unlit}? Something like this would be useful when mapping. Also segregated=yes/no, moped=yes/no, but that would blow up to 16 combinations already.
Some navigators like my car navigator show the name of the street I'm riding on. On my Oregon (which I use for bicycle) the current road is not shown (unless navigating). However, it displays names for other streets on the map (perticulary the crossing streets). Actually I have a fixme-layer which includes my watched tags. It overlays the info using different lines. I agree that is is a lot more usefull. It makes mapping a lot more efficient, because if I see something missing on a nearby road (the one I'm riding on), I usually get a photo and add it later on. It also helps a lot in getting to the road near by even if my current location has no missing features. This has helped me a lot in getting more info. I use both, because if I were to watch for too many features, the different line types would easily get too complex to remember. My watch list includes currently surface, lit, maxspeed, name, name:sv and snowplowing on winter. That would give me 36 combinations already while it fits in a few easy-to-remember characters. -- Harri

Hi!
set name '${name} ${ref}' set name '${name} ${anothertag}' name ${name}
OK, but can you use it in one line just for one rule like 'amenity=postbox'?
Just saw something in the All-In-One-Style: highway=emergency_access_point {add ref=''; add name=''; add operator=''; add emergency_telephone_code=''; name '${ref} ${name} ${operator} ${emergency_telephone_code}'} [0x7016 resolution 22] This ist just what I want and it works. :-) Christian

On Wed, Aug 25, 2010 at 01:17:12PM +0200, Christian H. Bruhn wrote:
Just saw something in the All-In-One-Style:
highway=emergency_access_point {add ref=''; add name=''; add operator=''; add emergency_telephone_code=''; name '${ref} ${name} ${operator} ${emergency_telephone_code}'} [0x7016 resolution 22]
This ist just what I want and it works. :-)
${name|ref:} etc. would be slightly shorter. Either way, you will get empty spaces, and I do not know a nice way of avoiding them. The non-nice way would be enumerating all subsets of the set of all desired attributes. Side note: I found 3 highway=emergency_access_point in Finland. All should have been healthcare=polyclinic. Where is this tag used legitimately? Only in some natural areas, or also on highways for motor vehicles (especially long tunnels)? Is the 0x7016 a custom icon in the all-in-one TYP file? Does it show up in any menu? It is not documented in resources/garmin_feature_list.csv. The default style currently maps healthcare=* and related items to 0x3002. Best regards, Marko

On 08/25/2010 10:10 PM, Marko Mäkelä wrote:
Side note: I found 3 highway=emergency_access_point in Finland. All should have been healthcare=polyclinic. Where is this tag used legitimately? Only in some natural areas, or also on highways for motor vehicles (especially long tunnels)?
In Germany these emergency access points are used by police or ambulance vehicles to enter a motorway between official exits in case of an accident.

Ralf Kleineisel wrote:
On 08/25/2010 10:10 PM, Marko Mäkelä wrote:
Side note: I found 3 highway=emergency_access_point in Finland. All should have been healthcare=polyclinic. Where is this tag used legitimately? Only in some natural areas, or also on highways for motor vehicles (especially long tunnels)?
In Germany these emergency access points are used by police or ambulance vehicles to enter a motorway between official exits in case of an accident.
That is not the right definition. The emergency_access_pints are places with signs like this [1]. These signs stand e.g. on tracks in the forest. If you have an emergency you can tell the police or ambulance the number of the sign and they will know your exact position in the forest. [2] Christian [1] http://wiki.openstreetmap.org/wiki/File:Anfahrpunkt_HP_108.jpg [2] http://wiki.openstreetmap.org/wiki/Tag:highway%3Demergency_access_point

On Sun, Aug 15, 2010 at 09:06:31PM +0200, Christian H. Bruhn wrote:
According to [1] you have to add to following line [1] http://wiki.openstreetmap.org/wiki/Mkgmap/help/style_rules
{name '${name} (${ref})' | '${ref}' | '${name}'}
if you want to name a street with 'ref' or 'name' or both.
When you have 3 or more tags which could exist, the rule will be very complicated.
My wish is that i can give a list of tags and mkgmap adds these, if they exist, to the name tag, but don't bother if one or more tags are missing.
How would the tags be delimited then? Have you considered adding |def: to each tag to make them empty when missing, e.g., name '${name|def:},${ref|def:},${operator|def:}'
This is for mapping purposes. I would like to create a mapping layer in which are mostly all information, all tags in the text string of an POI.
The maximum string length can be exceeded quite easily. Recently, I added all routes to my 'routes' style, and ways with multiple '${route} ${network} ${ref}' can grow very long names, e.g., 'bus hsl 731,bus hsl 742,road E 75' etc. instead of '731,742'. It might be better to split the information into several layers (maps), one per ${route} type. But unfortunately mkgmap cannot currently generate several maps in one run. Best regards, Marko
participants (5)
-
Christian H. Bruhn
-
Harri
-
Harri Suomalainen
-
Marko Mäkelä
-
Ralf Kleineisel