
On 18.01.2010 14:48, Marko Mäkelä wrote:
Hi Felix,
On Mon, Jan 18, 2010 at 02:19:45PM +0100, Felix Hartmann wrote:
Actually I found two ways how to make it work. Sometimes the mkgmap style-file code allows so many nice workarounds. :-)
*a)* the odd way rcn_ref=*& rcn_ref=10 { name '${rcn_ref}' } [0x01701 resolution 22 continue] rcn_ref=10 { name '${rcn_ref}' } [0x01800 resolution 22]
*b)* the logic way (which can be used for even more than 2 symbols) -
Why couldn't the odd way be used for several symbols?
Well, it will only once be considered as different. example: rcn_ref=* & rcn_ref=10 [0x01 resolution 24 continue] rcn_ref=10 [0x02 resolution 24 continue] rcn_ref=10 [0x03 resolution 24] --- is identical to the line above and will not work.
Would having multiple rcn_ref=*& at the start of the rule help?
That could well be possible. I have not tried it.
Why do you need the rcn_ref=*& anyway? Shouldn't the continue do the trick already?
No, the trick is not working, as the you cannot run "continue" for asking the same value twice. The idea of continue was more that if you have a single node tagged amenity=restaurant & amenity=hotel that neither is dropped (so you find both via the search function), or that if a line is tagged higwhay=residential & railway=rail both will be rendered/included in the map.
Ultimately, I would like to see something like this:
(rcn_ref % 100 / 100) = 1 [symbol for '1__' continue] (rcn_ref % 10 / 10) = 1 [ symbol for '_1_' continue] (rcn_ref % 10) = 1 [ symbol for '__1' ]
You might need to prefix these rules with rcn_ref=*.
Well that would be nicer. If you integrate these regex operators, maybe you could come up with a conversion for units (mph --> kph) too. It would be enough if: distance=125miles could be seperated into distance=125 distance:unit=miles for further processing.
Removing leading zeros would take some further conditions, something like this:
rcn_ref> 9& (rcn_ref % 10 / 10) = 0 [ symbol for '_0_' continue]
and (if we are to support rcn_ref> 999)
rcn_ref> 99& (rcn_ref % 100 / 100) = 0 [ symbol for '0__' continue]
Currently, the parser does not support arithmetic operators such as /, %, *, +, -. Integer arithmetics should be easy implement.
Currently I have the following in my style-file for this (I will change it around a bit, for better searchability, and effectively create 3 POI out of each node (by set mkgmap:rcn_ref=...; set mkgmap:1rcn_ref=....; name...} I just have to search for matching IDs). I will experiment a bit with deleting the name key too. rcn_ref=* & rcn_ref > 89 & rcn_ref < 100 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}'} [0x01709 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 79 & rcn_ref < 90 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01708 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 69 & rcn_ref < 80 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01707 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 59 & rcn_ref < 70 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01706 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 49 & rcn_ref < 60 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01705 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 39 & rcn_ref < 50 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01704 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 29 & rcn_ref < 40 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01703 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 19 & rcn_ref < 30 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01702 resolution 21 continue with_actions] rcn_ref=* & rcn_ref > 9 & rcn_ref < 20 { set mkgmap:rcn_ref='${rcn_ref}'; name '${rcn_ref}' } [0x01701 resolution 21 continue with_actions] mkgmap:rcn_ref=10 | mkgmap:rcn_ref=20 | mkgmap:rcn_ref=30 | mkgmap:rcn_ref=40 | mkgmap:rcn_ref=50 | mkgmap:rcn_ref=60 | mkgmap:rcn_ref=70 | mkgmap:rcn_ref=80 | mkgmap:rcn_ref=90 { name '${rcn_ref}' } [0x01800 resolution 21] mkgmap:rcn_ref=11 | mkgmap:rcn_ref=21 | mkgmap:rcn_ref=31 | mkgmap:rcn_ref=41 | mkgmap:rcn_ref=51 | mkgmap:rcn_ref=61 | mkgmap:rcn_ref=71 | mkgmap:rcn_ref=81 | mkgmap:rcn_ref=91 { name '${rcn_ref}' } [0x01801 resolution 21] mkgmap:rcn_ref=12 | mkgmap:rcn_ref=22 | mkgmap:rcn_ref=32 | mkgmap:rcn_ref=42 | mkgmap:rcn_ref=52 | mkgmap:rcn_ref=62 | mkgmap:rcn_ref=72 | mkgmap:rcn_ref=82 | mkgmap:rcn_ref=92 { name '${rcn_ref}' } [0x01802 resolution 21] mkgmap:rcn_ref=13 | mkgmap:rcn_ref=23 | mkgmap:rcn_ref=33 | mkgmap:rcn_ref=43 | mkgmap:rcn_ref=53 | mkgmap:rcn_ref=63 | mkgmap:rcn_ref=73 | mkgmap:rcn_ref=83 | mkgmap:rcn_ref=93 { name '${rcn_ref}' } [0x01803 resolution 21] mkgmap:rcn_ref=14 | mkgmap:rcn_ref=24 | mkgmap:rcn_ref=34 | mkgmap:rcn_ref=44 | mkgmap:rcn_ref=54 | mkgmap:rcn_ref=64 | mkgmap:rcn_ref=74 | mkgmap:rcn_ref=84 | mkgmap:rcn_ref=94 { name '${rcn_ref}' } [0x01804 resolution 21] mkgmap:rcn_ref=15 | mkgmap:rcn_ref=25 | mkgmap:rcn_ref=35 | mkgmap:rcn_ref=45 | mkgmap:rcn_ref=55 | mkgmap:rcn_ref=65 | mkgmap:rcn_ref=75 | mkgmap:rcn_ref=85 | mkgmap:rcn_ref=95 { name '${rcn_ref}' } [0x01805 resolution 21] mkgmap:rcn_ref=16 | mkgmap:rcn_ref=26 | mkgmap:rcn_ref=36 | mkgmap:rcn_ref=46 | mkgmap:rcn_ref=56 | mkgmap:rcn_ref=66 | mkgmap:rcn_ref=76 | mkgmap:rcn_ref=86 | mkgmap:rcn_ref=96 { name '${rcn_ref}' } [0x01806 resolution 21] mkgmap:rcn_ref=17 | mkgmap:rcn_ref=27 | mkgmap:rcn_ref=37 | mkgmap:rcn_ref=47 | mkgmap:rcn_ref=57 | mkgmap:rcn_ref=67 | mkgmap:rcn_ref=77 | mkgmap:rcn_ref=87 | mkgmap:rcn_ref=97 { name '${rcn_ref}' } [0x01807 resolution 21] mkgmap:rcn_ref=18 | mkgmap:rcn_ref=28 | mkgmap:rcn_ref=38 | mkgmap:rcn_ref=48 | mkgmap:rcn_ref=58 | mkgmap:rcn_ref=68 | mkgmap:rcn_ref=78 | mkgmap:rcn_ref=88 | mkgmap:rcn_ref=98 { name '${rcn_ref}' } [0x01808 resolution 21] mkgmap:rcn_ref=19 | mkgmap:rcn_ref=29 | mkgmap:rcn_ref=39 | mkgmap:rcn_ref=49 | mkgmap:rcn_ref=59 | mkgmap:rcn_ref=69 | mkgmap:rcn_ref=79 | mkgmap:rcn_ref=89 | mkgmap:rcn_ref=99 { name '${rcn_ref}' } [0x01809 resolution 21]
Marko _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev