Relations and Multiple Tag Parsing Style Rules

1. Is there any possibility to give a different tag to relations? The problem is that many cycleroutes are tagged as relation id=12345.... which then lists the way sections that belong to the relation. So the ways itself are not tagged differently. Here is one example (I shortened the ways which belong to it) which I would like to highlight. Is there a possibilty to highlight all relations of route=bicycle or route=mtb etc....? <relation id='17206' timestamp='2008-11-03T14:41:59+00:00' user='Loschi' visible='true'> <member type='node' ref='15733829' role='' /> <member type='way' ref='3220516' role='' /> <member type='way' ref='4682210' role='' /> <member type='way' ref='4776002' role='' /> <tag k='created_by' v='Potlatch 0.10f' /> <tag k='ref' v='6' /> <tag k='rcn' v='yes' /> <tag k='route' v='bicycle' /> <tag k='name' v='Donauradweg (NÖ)' /> <tag k='type' v='route' /> <tag k='network' v='rcn' /> 2. Could Multiple Tag parsing be implemented into the style rules somehow? I know that I could use combinations like highway=path & mtb:scale=0 --> 0x01 and highwway=path & mtb:scale=1 --> 0x02 But that poses several problems: a) Running out of definitions --> Mapsource only displays 0x00 to 0x2a (excluding 0x17 and 0x20 to 0x25 that are reserved for contourlines). b) There are other mtb related tags such as mtb:scale:uphill= and interesting tags like smoothness and tracktype. Writing combinations for all of them to display seperately will become very complicated. Solution: If a way has two tags that are listed in the style file, both should be included seperately into the image. By using a .typ file one can then decide how to map them. Using transparency it's easy to see at the same time 4-5 different tags. I.e. you have the way in the middle. And on either side of the way you put dots or symbols to show further attributes. As a way can be drawn up to 32 pixels wide. One has 15 pixels open for putting in additional information to each side of a way that is 2 pixels wide (this assumes that the ways are identical copies of each other, just with a different 0x?? definition). For the moment I have to generate a seperate map for each tag that I assume to appear in combination with other tags (Well I can through togehter some tags with Regex rules) and then make all maps except one transparent before I upload them to the Garmin GPS. On the GPS it will display without problems, but I can't use Mapsource for planning a trip now, having 5-6 maps to show me all attributes that I consider important for mountainbiking. Felix Diese Nachricht erhalten Sie von einem Studierenden der IMC Fachhochschule Krems. Für Übermittlungsfehler oder sonstige Irrtümer bei Übermittlung besteht keine Haftung seitens der IMC Fachhochschule Krems. This message is being transmitted by an IMC student. The sender does not accept liability for any errors or omissions as a result of the transmission.

On Tue, Dec 02, 2008 at 01:25:00PM +0100, f.hartmann wrote:
1. Is there any possibility to give a different tag to relations?
Tell me if this works. My plan for relations, is that there is a rule file for relations that is run before any of the others. The rules match the tags on the relation, and you can set up actions to run when the rule matches. This action will be able to add tags to each of the ways making up the relation. You can then match those tags in the normal lines rule file. Eg something like this: type = route & route=bicycle { all add route=bicylcle } This will add the tag route=bicycle on each way in the relation. You can add more than one tag and also you can use the values of tags on the relation. Something like this: type = route & rcn=* { all add cycle_ref="${ref}" } (sorry probably not a very good example).
2. Could Multiple Tag parsing be implemented into the style rules somehow?
Solution: If a way has two tags that are listed in the style file, both should be included seperately into the image. By using a .typ file one
Let me see if I understand what you are suggesting. You want a rule match to cause a copy of the line to be created with a given type and then allow the line to be subject to further matches in the rules? The final result would be a map that contains the same line several times with a different type? If so, that may be possible. ..Steve

2. Yes exactly as you understood it. That would be really practical. Here you can see some screenshots how such maps could look like: http://wiki.openstreetmap.org/index.php/OSM_Map_On_Garmin/mtb_map This was done using osm_composer (OSM_Composer did exactly that, upon matching rules create a copy of a polyline (of course there needs to be a NEW unique way id (easiest just add a number like 1000, 1001, 1002, 1003, etc based on rule to the old way id.), but delete all other tags except the one searched for of the polyline, leaving the original polyline without change. Now mkgmap would effectively read the same line two times, but due to different tags one could now render much better looking maps. The problem is that OSM_Composer is a bit buggy and doesn't work for larger areas. User Nop hasn't updated OSM_Composer for some time, and in current state it is not really usable (it simply forgets some rules). Nop said that he wanted to completely rewrite the program to get rid of several bugs and increase performance (and lower the enormous memory demands) but since 3 weeks he has not shown any sign of life. If mkgmap could implement that instead it would be a lot easier. 1: Following my example lines stye-file (mkgmap compiled from SVN this midday): type = route & route=bicycle {all add route=bicylcle } route=bicycle [0x0e resolution 8] relation:route=bicycle [0x01 resolution 10] network=ncn [0x02 resolution 10] network=rcn [0x03 resolution 10] network=lcn [0x04 resolution 10] D:\Garmin\mkgmap_680>java -jar -Xmx1256M mkgmap.jar --description=Osm_Mtb_Austria --family-id=4011 --style-file=standard --product-id=1 --gmapsupp --levels=0:24,1:22,2:20,3:18,4:16,5:14,6:12,7:10 --area-name=austria austria.osm Exception in thread "main" uk.me.parabola.mkgmap.osmstyle.eval.SyntaxException: Error: (lines:2): Unrecognised command 'all' at uk.me.parabola.mkgmap.osmstyle.actions.ActionReader.readActions(ActionReader.java:69) at uk.me.parabola.mkgmap.osmstyle.RuleFileReader.load(RuleFileReader.java:89) at uk.me.parabola.mkgmap.osmstyle.RuleFileReader.load(RuleFileReader.java:73) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:180) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:122) at uk.me.parabola.mkgmap.reader.osm.xml.Osm5MapDataSource.createStyler(Osm5MapDataSource.java:110) at uk.me.parabola.mkgmap.reader.osm.xml.Osm5MapDataSource.load(Osm5MapDataSource.java:70) at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:125) at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:44) at uk.me.parabola.mkgmap.main.Main.processFilename(Main.java:145) at uk.me.parabola.mkgmap.CommandArgs$Filename.processArg(CommandArgs.java:355) at uk.me.parabola.mkgmap.CommandArgs.readArgs(CommandArgs.java:114) at uk.me.parabola.mkgmap.main.Main.main(Main.java:90) After Deleting all - new code in lines is the following: type = route & route=bicycle {add route=bicylcle } route=bicycle [0x0e resolution 8] relation:route=bicycle [0x01 resolution 10] network=ncn [0x02 resolution 10] network=rcn [0x03 resolution 10] network=lcn [0x04 resolution 10] I get the following error: D:\Garmin\mkgmap_680>java -jar -Xmx1256M mkgmap.jar --description=Osm_Mtb_Austria --family-id=4011 --style-file=standard --product-id=1 --gmapsupp --levels=0:24,1:22,2:20,3:18,4:16,5:14,6:12,7:10 --area-name=austria austria.osm Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.osmstyle.StyledConverter.convertWay(StyledConverter.java:91) at uk.me.parabola.mkgmap.reader.osm.xml.Osm5XmlHandler.endDocument(Osm5XmlHandler.java:263) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at uk.me.parabola.mkgmap.reader.osm.xml.Osm5MapDataSource.load(Osm5MapDataSource.java:71) at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:125) at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:44) at uk.me.parabola.mkgmap.main.Main.processFilename(Main.java:145) at uk.me.parabola.mkgmap.CommandArgs$Filename.processArg(CommandArgs.java:355) at uk.me.parabola.mkgmap.CommandArgs.readArgs(CommandArgs.java:114) at uk.me.parabola.mkgmap.main.Main.main(Main.java:90) Yours, Felix Steve Ratcliffe wrote: On Tue, Dec 02, 2008 at 01:25:00PM +0100, f.hartmann wrote:
1. Is there any possibility to give a different tag to relations?
Tell me if this works. My plan for relations, is that there is a rule file for relations that is run before any of the others. The rules match the tags on the relation, and you can set up actions to run when the rule matches. This action will be able to add tags to each of the ways making up the relation. You can then match those tags in the normal lines rule file. Eg something like this: type = route & route=bicycle { all add route=bicylcle } This will add the tag route=bicycle on each way in the relation. You can add more than one tag and also you can use the values of tags on the relation. Something like this: type = route & rcn=* { all add cycle_ref="${ref}" } (sorry probably not a very good example).
2. Could Multiple Tag parsing be implemented into the style rules somehow?
Solution: If a way has two tags that are listed in the style file, both should be included seperately into the image. By using a .typ file one
Let me see if I understand what you are suggesting. You want a rule match to cause a copy of the line to be created with a given type and then allow the line to be subject to further matches in the rules? The final result would be a map that contains the same line several times with a different type? If so, that may be possible. ..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk<mailto:mkgmap-dev@lists.mkgmap.org.uk> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev ________________________________ Diese Nachricht erhalten Sie von einem Studierenden der IMC Fachhochschule Krems. Für Übermittlungsfehler oder sonstige Irrtümer bei Übermittlung besteht keine Haftung seitens der IMC Fachhochschule Krems. This message is being transmitted by an IMC student. The sender does not accept liability for any errors or omissions as a result of the transmission.

1: Following my example lines stye-file (mkgmap compiled from SVN this midday):
type = route & route=bicycle {all add route=bicylcle }
Yes, this isn't implemented yet...
Exception in thread "main" java.lang.NullPointerException
Thats a bug - I've just fixed it in the style branch - thanks. ..Steve

Hi Felix
2. Could Multiple Tag parsing be implemented into the style rules somehow?
I know that I could use combinations like highway=path & mtb:scale=0 --> 0x01 and highwway=path & mtb:scale=1 --> 0x02
Solution: If a way has two tags that are listed in the style file, both should be included seperately into the image. By using a .typ file one can then decide how to map them. Using transparency it's easy to see at the same time 4-5 different tags. I.e. you have the way in the middle.
I have implemented something that I hope will do what you want to do here. It is in the trunk version 801. It uses the new 'overlays' file in the style. Example: <<<version>>> 0 <<<lines>>> highway=path & mtb:scale=0 [ 0x140 ] highway=path & mtb:scale=1 [ 0x141 ] <<<overlays>>> 0x140: 0x7, 0x18 0x141: 0x7, 0x19 So for a path of scale 0, you would get two lines drawn on top of each other with types 7 and 18. For scale 1, 7 and 19. You can have more than two. The good thing is that if mkgmap ever supports large type numbers, you can just remove the overlays file and use 0x140 and 0x141 etc directly. ..Steve

I have tried to use it, but it doesn't seem to work (mkgmap trunk svn version 823). I assume I'm using somehow wrong syntax and need more explanation. a) concerning relations I simply wrote this line to relations file to line 7: type=route route=bus { apply { set route=bus; add rn='${route_no}' ; }} this is what I got: D:\Garmin\mkgmap_680>java -jar -Xmx1256M d:\garmin\mkgmap_svn\dist\mkgmap.jar --description=Osm_Mtb_Austria3 --family-id=4013 --style-file=mtbx --product-id=1 --levels=0:24,1:22,2:20,3:18,4:16,5:14,6:12,7:10 --area-name=austria3 --mapname=63240030 austria.osm Error in style: Error: (relations:7): Invalid rule file (expr =) Could not open style null b) Also multiple Tag parsing does not seem to work for me. I added the following two lines to the beginning of the "lines" file in the style-file highway=path & mtb=yes [0x140 resolution 16] highway=footway & mtb=yes [0x141 resolution 16] And created a new file called "overlays" with the following two lines: 0x140: 0x11, 0x0e 0x141: 0x2a, 0x0e Error in style: Error: (overlays:2): List of numbers expected Could not open style null D:\Garmin\mkgmap_680>move 63240030.img d:\garmin\osm_austria The system cannot find the file specified. If in overlays there are the following lines Line1:0x140: 0x11, 0x0e Line2:0x141: 0x2a, 0x0e Line3: with Line 3 being empty, then the following error is produced: Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.general.MapDetails.addLine(MapDetails.java:70) at uk.me.parabola.mkgmap.osmstyle.StyledConverter$1.add(StyledConverter.java:61) at uk.me.parabola.mkgmap.osmstyle.OverlayReader.addLine(OverlayReader.java:106) at uk.me.parabola.mkgmap.osmstyle.StyleImpl$1.add(StyleImpl.java:203) at uk.me.parabola.mkgmap.general.NullClipper.clipLine(NullClipper.java:28) at uk.me.parabola.mkgmap.osmstyle.StyledConverter.addLine(StyledConverter.java:194) at uk.me.parabola.mkgmap.osmstyle.StyledConverter.convertWay(StyledConverter.java:100) at uk.me.parabola.mkgmap.reader.osm.xml.Osm5XmlHandler.endDocument(Osm5XmlHandler.java:258) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:737) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:515) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at javax.xml.parsers.SAXParser.parse(SAXParser.java:198) at uk.me.parabola.mkgmap.reader.osm.xml.Osm5MapDataSource.load(Osm5MapDataSource.java:72) at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:125) at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:44) at uk.me.parabola.mkgmap.main.Main.processFilename(Main.java:146) at uk.me.parabola.mkgmap.CommandArgs$Filename.processArg(CommandArgs.java:360) at uk.me.parabola.mkgmap.CommandArgs.readArgs(CommandArgs.java:119) at uk.me.parabola.mkgmap.main.Main.main(Main.java:91) Steve Ratcliffe wrote:
Hi Felix
2. Could Multiple Tag parsing be implemented into the style rules somehow?
I know that I could use combinations like highway=path & mtb:scale=0 --> 0x01 and highwway=path & mtb:scale=1 --> 0x02
Solution: If a way has two tags that are listed in the style file, both should be included seperately into the image. By using a .typ file one can then decide how to map them. Using transparency it's easy to see at the same time 4-5 different tags. I.e. you have the way in the middle.
I have implemented something that I hope will do what you want to do here. It is in the trunk version 801.
It uses the new 'overlays' file in the style.
Example:
<<<version>>> 0
<<<lines>>> highway=path & mtb:scale=0 [ 0x140 ] highway=path & mtb:scale=1 [ 0x141 ]
<<<overlays>>> 0x140: 0x7, 0x18 0x141: 0x7, 0x19
So for a path of scale 0, you would get two lines drawn on top of each other with types 7 and 18. For scale 1, 7 and 19.
You can have more than two.
The good thing is that if mkgmap ever supports large type numbers, you can just remove the overlays file and use 0x140 and 0x141 etc directly.
.Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Felix
concerning relations I simply wrote this line to relations file to line 7: type=route route=bus { apply { set route=bus; add rn='${route_no}' ; }}
You need a '&' between type=route and route=bus, did you have one or is just a typo in the example?
with Line 3 being empty, then the following error is produced: Exception in thread "main" java.lang.NullPointerException at
Yes looks like a bug, should be fixed now. Thanks ..Steve

Steve Ratcliffe wrote:
Hi Felix
concerning relations I simply wrote this line to relations file to line 7: type=route route=bus { apply { set route=bus; add rn='${route_no}' ; }}
You need a '&' between type=route and route=bus, did you have one or is just a typo in the example?
O.k. I've added the & and now it parses without complaining, but I think it does nothing. I tried to highlight the Donauradwanderweg which is tagged as route=bicycle but it did not work. The best solution for relations would actually be to do them via an overlay so one doesn't loose the properties of the underlying way!
with Line 3 being empty, then the following error is produced: Exception in thread "main" java.lang.NullPointerException at
Yes looks like a bug, should be fixed now. Thanks
.Steve
Not completely, but it's working under the condition: Lines 1-4 1: 0x140: 0x11, 0x0e 2: 0x141: 0x2a, 0x0e 3: 0x142: 0x10, 0x0e 4: (empty but existing) Is working. 1: 0x140: 0x11, 0x0e 2: 0x141: 0x2a, 0x0e 3: 0x142: 0x10, 0x0e and line 4 not existing brings up the following error: /Error in style: Error: (overlays:3): List of numbers expected Could not open style null/ So for the moment one has to create an empty line 4 by exiting line 3 with enter (and thereby creating an empty line 4). Nevertheless I would prefer to have the overlay function independent of the underlying way, would this be possible (whereas 0x0e stands for bicycle=yes)? *Status Quo:* <<<Lines>>> highway=path & bicycle=yes [0x140 resolution 16] highway=footway & bicycle=yes [0x141 resolution 16] highway=track & bicycle=yes [0x142 resolution 16] <<<Overlay>>> 1: 0x140: 0x11, 0x0e 2: 0x141: 0x2a, 0x0e 3: 0x142: 0x10, 0x0e 4: (empty but existing) *I wish overlays would work as simple as in this example:* <<<Lines>>> bicycle=yes [0x140 resolution 16] <<<Overlay>>> 1: 0x140: 0x0e The advantage of this scheme is, that one does not need to know what other tags are applied to the object. This is especially important if you search for several different tags that all could be used on one way. i.e. highway=track oneway=yes, bicycle=yes, tracktype=grade2 and one does not need to specify all possible combinations!
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

1: 0x140: 0x11, 0x0e 2: 0x141: 0x2a, 0x0e 3: 0x142: 0x10, 0x0e
and line 4 not existing brings up the following error: Error in style: Error: (overlays:3): List of numbers expected Could not open style null
OK this happens when there is no newline at the end of the file. I forgot that some editors don't put a new line at the end of each line. I'll fix it some time. Work around is to just add one yourself as you discovered. ..Steve

1. After spending much time trying to get type=route route=bicycle to work I give up. I think the actions set in the relations file are simply not used, or at least not the apply command on routes. In relations I have the following: type=route & route=bicycle { apply {set route=xy; set route_ref='${route_ref}';} } and in lines I put as only line: route=xy [0x0e resolution 20] I also tried the syntax as written in the relations file from mkgmap folder: type=route route=bicycle { apply { set route=xy; add rn='${route_no}' ; }} However I only get empty maps after parsing austria.osm. No better if I only parse a small region which includes relations that are like this: <relation id='17206' timestamp='2008-12-29T09:09:47+00:00' user='_al' visible='true'> <member type='node' ref='15733829' role='' /> <member type='way' ref='3220516' role='' /> ....... (cut here includes many many ways) <tag k='created_by' v='Potlatch 0.10f' /> <tag k='ref' v='6' /> <tag k='rcn' v='yes' /> <tag k='route' v='bicycle' /> <tag k='name' v='Donauradweg (NÖ)' /> <tag k='type' v='route' /> <tag k='network' v='rcn' /> </relation> I used "set route=xy" because there is no direct route=xy entry in austria.osm from geofabrik while some roads are tagged directly as route=bicycle in order to only pick up those routes set as relations. However also using "set route=bicycle" yields no result on relations. This is using mkgmap 628 from SVN. However also with older versions relations never worked. Am I doing something wrong in syntax, or is there a bug in the parsing of relations? Running the above on austria.osm I only get an empty map consisting of the bounding polygon 0x4b. 2. How can I create a map with mkgmap without parsing the name= key? (i need this because I wan't to create a map that I can use as transparent overlay showing only oneway streets, without actually including the name key, in order to keep a smaller. Would I need to do this within relations file or in lines file? Yours, Felix

Hi On Sun, Jan 04, 2009 at 09:27:42PM +0100, Felix Hartmann wrote:
1. After spending much time trying to get type=route route=bicycle to work I give up. I think the actions set in the relations file are simply not used, or at least not the apply command on routes.
I am puzzled, I have just tried copying and pasting the rules that you gave and using them on a small test map and it worked fine. I am downloading austria.osm from geofabrik and will try it out and post my results if I can't work out what you are seeing.
2. How can I create a map with mkgmap without parsing the name= key? (i need this because I wan't to create a map that I can use as transparent overlay showing only oneway streets, without actually including the name key, in order to keep a smaller. Would I need to do this within relations file or in lines file?
If you use the action: name '' this will result in no name being added to the file. More concrete example in the lines file, putting the following at the top: highway=* { name ''} Would result in all highway's not having a name. There is not a ruleset that is applied to everything unfortunately, but you can add the name rule everywhere as needed. ..Steve

Yes I just tried on a very small file and it seemed to work. Did it work for you for the whole of Austria? when parsing the whole of Austria I indeed get 6 polylines with route=xy consisting of 380 nodes according to analysis with maptk. However there should be many many more (including the whole Donauradwanderweg). For me it also didn't work with a small test.osm extracted by Josm (covering a small section of the Donauradwanderweg). Felix Steve Ratcliffe wrote:
Hi
On Sun, Jan 04, 2009 at 09:27:42PM +0100, Felix Hartmann wrote:
1. After spending much time trying to get type=route route=bicycle to work I give up. I think the actions set in the relations file are simply not used, or at least not the apply command on routes.
I am puzzled, I have just tried copying and pasting the rules that you gave and using them on a small test map and it worked fine.
I am downloading austria.osm from geofabrik and will try it out and post my results if I can't work out what you are seeing.
2. How can I create a map with mkgmap without parsing the name= key? (i need this because I wan't to create a map that I can use as transparent overlay showing only oneway streets, without actually including the name key, in order to keep a smaller. Would I need to do this within relations file or in lines file?
If you use the action:
name ''
this will result in no name being added to the file.
More concrete example in the lines file, putting the following at the top:
highway=* { name ''}
Would result in all highway's not having a name. There is not a ruleset that is applied to everything unfortunately, but you can add the name rule everywhere as needed.
.Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

First, thanks for the fix with relations only reading the first one, now it works perfectly. But..... How can I set the name of a relation to the individual pieces/streets belonging to it? i.e. a mtbroute has no further attributes but the relation itself is called "Anninger-Strecke". I would like to either set this as name for all individual routepieces, or add this to the name of the individual streets. Is this somehow possible or not?

On Mon, Jan 26, 2009 at 01:47:59PM +0100, Felix Hartmann wrote:
First, thanks for the fix with relations only reading the first one, now it works perfectly. But..... How can I set the name of a relation to the individual pieces/streets belonging to it?
i.e. a mtbroute has no further attributes but the relation itself is called "Anninger-Strecke". I would like to either set this as name for all individual routepieces, or add this to the name of the individual streets. Is this somehow possible or not?
The following style file worked for me. All the roads had the names from the route: <<<version>>> 0 <<<relations>>> type=route & route=bicycle { apply { set xroute=xy; set route_ref='${route_ref}'; set name='${name}'; } } <<<lines>>> xroute=xy [0x1 resolution 16] There are problems if a piece of road is part of two routes then you only get to see one name, and of course it clobbers the name of the road. I can see it would be useful, but unwieldy, to have a way of combining lots of different partial names together, but thats not possible at the moment. Regards, ..Steve

Following up again on Multiple tag parsing style rules and the overlays file. Would it be possible to use the copying command for lines without the need to specify the exact way copy in overlays file? Example: oneway=yes is given to many different types of highways. I would like to copy each way that includes oneway=yes without needing to give any more specifications. Currently to do this I have to create two maptiles and join them via tdb to display an overlay of oneway in mapsource, or load it onto the gps with one map being transparent. Felix Steve Ratcliffe wrote:
It uses the new 'overlays' file in the style.
Example:
<<<version>>> 0
<<<lines>>> highway=path & mtb:scale=0 [ 0x140 ] highway=path & mtb:scale=1 [ 0x141 ]
<<<overlays>>> 0x140: 0x7, 0x18 0x141: 0x7, 0x19
So for a path of scale 0, you would get two lines drawn on top of each other with types 7 and 18. For scale 1, 7 and 19.
You can have more than two.
The good thing is that if mkgmap ever supports large type numbers, you can just remove the overlays file and use 0x140 and 0x141 etc directly.
.Steve <http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev>
participants (3)
-
f.hartmann
-
Felix Hartmann
-
Steve Ratcliffe