Re: [mkgmap-dev] [PATCH] Allow ~ and friends at top level
On Sun, Jan 17, 2010 at 04:11:51PM +0100, Felix Hartmann wrote: > Something fundamentally fucks up in with your patch or there is again > some typo that I made? Something fundamental seems to be wrong. I did not look how the matching is actually done. Marko ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] [PATCH] Allow ~ and friends at top level
On 17.01.2010 11:20, Marko Mäkelä wrote: Hi Felix, Thank you for testing my patch. In any case, I will try to figure out what caused the size difference for me. Even if the patch does not seem to bring much CPU-wise, the compact notation could be useful in some cases. But as your example shows, the downside of the compactness would be extra care needed when editing rules: On Sun, Jan 17, 2010 at 12:18:07AM +0100, Felix Hartmann wrote: I lost all of the following new: place ~ 'town\|suburb\village' [0x03 resolution 21] old: place=suburb | place=town | place=village [0x03 resolution 21] It should be suburb\|village, not suburb\village. You should have got points for place=town, but there probably were no place="suburb\village" in the input. :-) (I don't even know what the \v would translate into in this case. Probably just 'v', but it could be 0x0b (vertical tab) too. Well however even without typo I'm still missing them! Using: /landuse ~ 'residential\|residental' [0x03 resolution 21] place ~ 'town\|suburb\|village\|hamlet' [0x03 resolution 21]/ There is absolutely no 0x03 in my map If I use instead /landuse=residential | landuse=residental [0x03 resolution 21] place=suburb | place=village | place=town [0x03 resolution 21]/ it renders fine. Something fundamentally fucks up in with your patch or there is again some typo that I made? ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] [PATCH] Allow ~ and friends at top level
Hi Felix, Thank you for testing my patch. In any case, I will try to figure out what caused the size difference for me. Even if the patch does not seem to bring much CPU-wise, the compact notation could be useful in some cases. But as your example shows, the downside of the compactness would be extra care needed when editing rules: On Sun, Jan 17, 2010 at 12:18:07AM +0100, Felix Hartmann wrote: > I lost all of the following > new: > place ~ 'town\|suburb\village' [0x03 resolution 21] > old: > place=suburb | place=town | place=village [0x03 resolution 21] It should be suburb\|village, not suburb\village. You should have got points for place=town, but there probably were no place="suburb\village" in the input. :-) (I don't even know what the \v would translate into in this case. Probably just 'v', but it could be 0x0b (vertical tab) too. > Your testing could well be different because you were putting two lines > into one like > key1=123 > key1=456 > > whereas I changed from > key1=123 | key1=456 I don't know if this really makes a difference. A comment in the method that I changed suggested that the top-level | would be split earlier. It could very well be equivalent to writing separate rules for each top-level | operand. Best regards, Marko ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] [PATCH] Allow ~ and friends at top level
On 16.01.2010 21:25, Marko Mäkelä wrote: Hi Felix, On Sat, Jan 16, 2010 at 09:02:05PM +0100, Felix Hartmann wrote: On 16.01.2010 20:59, Marko Mäkelä wrote: +natural ~ 'wetland\|marsh\|mud' [0x51 resolution 20] Is there a performance increase (or maybe memory usage decrease) vs: natural=wetland | natural=marsh | natural=mud [0x51 resolution 20] You're right, I should have timed it. Sorry, I do not know how to measure memory usage, but I would not expect any significant difference there. I tried the attached optimizations to the default style. Without the optimizations, it took this long to compile my three tiles of Finland: real3m53.333s user4m23.332s sys 0m7.752s With the style optimized with top-level regexp matches, the compilation is very slightly faster: real3m50.705s user4m21.924s sys 0m7.744s Note that I had the Ondemand CPU frequency scaling governor enabled. For some reason, the generated maps are of different size: -rw-r--r-- 1 marko marko 45475840 16.1. 22:17 gmapsupp.img -rw-r--r-- 1 marko marko 45423616 16.1. 22:12 gmapsupp-relop.img I did not investigate this difference yet? Can you give it a spin on your system? okay, I changed my whole polygons file to using your notation wherever possible, and ended up 6 minutes 10 seconds instead of 6 minutes 11 seconds for a compilation of the Netherlands, so I cannot see any speed difference. Retried on Italy and saved about 3% of time. However I also lost some polygons, so something definitely does not work with your patch I lost all of the following new: place ~ 'town\|suburb\village' [0x03 resolution 21] old: place=suburb | place=town | place=village [0x03 resolution 21] I am already using the "final" patch by wanmil on trunk branch. ... Your testing could well be different because you were putting two lines into one like key1=123 key1=456 whereas I changed from key1=123 | key1=456 I did not however also that the maps rendered became smaller. I'm still trying to find out the differences. Best regards, Marko ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] [PATCH] Allow ~ and friends at top level
Hi Felix, On Sat, Jan 16, 2010 at 09:02:05PM +0100, Felix Hartmann wrote: > > > On 16.01.2010 20:59, Marko Mäkelä wrote: > > +natural ~ 'wetland\|marsh\|mud' [0x51 resolution 20] > > > Is there a performance increase (or maybe memory usage decrease) vs: > natural=wetland | natural=marsh | natural=mud [0x51 resolution 20] > > You're right, I should have timed it. Sorry, I do not know how to measure memory usage, but I would not expect any significant difference there. I tried the attached optimizations to the default style. Without the optimizations, it took this long to compile my three tiles of Finland: real3m53.333s user4m23.332s sys 0m7.752s With the style optimized with top-level regexp matches, the compilation is very slightly faster: real3m50.705s user4m21.924s sys 0m7.744s Note that I had the Ondemand CPU frequency scaling governor enabled. For some reason, the generated maps are of different size: -rw-r--r-- 1 marko marko 45475840 16.1. 22:17 gmapsupp.img -rw-r--r-- 1 marko marko 45423616 16.1. 22:12 gmapsupp-relop.img I did not investigate this difference yet? Can you give it a spin on your system? Best regards, Marko Index: resources/styles/default/lines === --- resources/styles/default/lines (revision 1479) +++ resources/styles/default/lines (working copy) @@ -33,17 +33,14 @@ highway=* {name '${ref} ${name}' | '${re # Flag unpaved roads. highway=* -& (surface=cobblestone | surface=compacted | surface=dirt | - surface=earth | surface=grass | surface=grass_paver | - surface=gravel | surface=grit | surface=ground | surface=mud | - surface=pebblestone | surface=sand | surface=unpaved | +& (surface ~ 'cobblestone\|compacted\|dirt\|earth\|grass\(_paver\)?\|gravel\|grit\|ground\|mud\|pebblestone\|sand\|unpaved' | mtb:scale=* | tracktype ~ 'grade[2-6]' | smoothness ~ '.*\(bad\|horrible\|impassable\)' | sac_scale ~ '.*\(mountain\|alpine\)_hiking' | sport=via_ferrata) { add mkgmap:unpaved=1 } -(highway=bridleway | highway=path | highway=track | highway=unsurfaced) +highway ~ 'bridleway\|path\|track\|unsurfaced' & surface!=* & tracktype!=* & smoothness!=* & sac_scale!=* { add mkgmap:unpaved=1 } Index: resources/styles/default/polygons === --- resources/styles/default/polygons (revision 1481) +++ resources/styles/default/polygons (working copy) @@ -61,9 +61,7 @@ military=danger_area [0x04 resolution 18 military=range [0x04 resolution 18] natural=glacier [0x4d resolution 16] -natural=marsh [0x51 resolution 20] -natural=mud [0x51 resolution 20] -natural=wetland [0x51 resolution 20] +natural ~ 'wetland\|marsh\|mud' [0x51 resolution 20] natural=scrub [0x4f resolution 20] natural=water [0x3c resolution 20] natural=sea [0x32 resolution 10] ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Re: [mkgmap-dev] [PATCH] Allow ~ and friends at top level
On 16.01.2010 20:59, Marko Mäkelä wrote: > +natural ~ 'wetland\|marsh\|mud' [0x51 resolution 20] > Is there a performance increase (or maybe memory usage decrease) vs: natural=wetland | natural=marsh | natural=mud [0x51 resolution 20] ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev