How do I transform the name of all Ways?

Hi everyone, I want to do some transformations on the names of all the Ways, is there a standard way to do that? For example, I want to replace all occurrences of "Avenida" for "Av.". I tried adding this to my lines file: |highway=* & name ~ '(?i)avenida\s+.*' { add streettype:movedend='${name|subst:(?i)avenida\s+~>}, Av.'} #| But There was no effect. Thanks in advance, Alexandre

Hi Alexandre, I use an Excel spreadsheet (enclosed) to do this kind of transformation for Dutch-language street names. There's a macro (Alt-f11) which writes a file "fix_names" (the path is hard-coded in the macro code, sorry about that - please edit to suit). There's a tab for prefixes, one for suffixes, and one for the matching rules. You need to "include" this "fix_names" from an appropriate place in the "lines" file. I hope it's useful - please let me know if you have any questions! --colin On 2016-06-12 23:42, Alexandre de Menezes wrote:
Hi everyone,
I want to do some transformations on the names of all the Ways, is there a standard way to do that? For example, I want to replace all occurrences of "Avenida" for "Av.".
I tried adding this to my lines file:
highway=* & name ~ '(?i)avenida\s+.*' { add streettype:movedend='${name|subst:(?i)avenida\s+~>}, Av.'} #
But There was no effect.
Thanks in advance,
Alexandre _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

You may also like to read How to replace Road with Rd , Street with St etc from Tricks with mkgmap Styles 3.pdf on http://www.pinns.co.uk/osm/styleideas.html -- View this message in context: http://gis.19327.n5.nabble.com/How-do-I-transform-the-name-of-all-Ways-tp587... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hallo at all, in some cases r-3676 (and also earlier releases) generate a wrong preview.img. But tdb-file is always okay. My way is : first i generate all tiles from the europe-latest.osm.pbf . This makes no problems; and second i arrangiere some tiles to countries and for those contry-tiles and additionally Contourline-tiles I run a batch to generate the preview and tdb. My example : first i use 2 tiles 50000002.img and 50000779.img (Island) ; r-3676 generate the preview+tdb, all okay. second : this 2 tiles and additionally a third tile(Contourlines) : r-3676 generate a wrong preview. This wrong preview is in Mapsource and also in Mapinstall . It makes no different, if the contourline-tile is inside or ouside the other tiles. What is wrong with mkgmap ? All sourcefiles for evaluation can you download : http:\\img2ms.de\Downloads\Test.rar. I assume the reason is the actual see.zip or bounds.zip ? 4 months ago with older see and bounds was not this error. Screenshot preview okay : Screenshot wrong preview.img : regards thomas

Hi Thomas
in some cases r-3676 (and also earlier releases) generate a wrong preview.img. But tdb-file is always okay.
Thanks for the bug report. I have found that the problem was introduced in version r3674, so it is a change I made... I am investigating the problem and don't know why this is happening yet. Best wishes ..Steve

Hi Steve, thanks for your investigation. I hope you will find a solution... Thomas Am 16.06.2016 um 23:22 schrieb Steve Ratcliffe:
Hi Thomas
in some cases r-3676 (and also earlier releases) generate a wrong preview.img. But tdb-file is always okay.
Thanks for the bug report. I have found that the problem was introduced in version r3674, so it is a change I made...
I am investigating the problem and don't know why this is happening yet.
Best wishes ..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi
Thanks for the bug report. I have found that the problem was introduced in version r3674, so it is a change I made...
In fact this is not the problem. In the test case you have three files in the order: 50000002.img 50000779.img 40001345.img The change of r3674 causes them to be compiled in the sorted order: 40001345.img 50000002.img 50000779.img However all versions of mkgmap back to r3605 create a bad overview map when the input files are in this order. So r3674 is only revealing another bug, and is not the bug itself. Earlier versions than 3605 are not compatible with the provided .img files so it isn't possible to say if the same problem existed earlier. So it appears to be something to do with the 40001345.img file as the problem only occurs when it is included. It appears to be an old file, so it might be possible that re-compiling it may fix the problem. I'll keep investigating... Best wishes ..Steve

Hi An update on the problem. The contour line tiles have the levels 0:24,1:23,2:22,3:20,4:18 whereas the content tiles have levels of 0:24,1:22,2:20,3:18,4:16,5:15 The first tile encountered determines the levels in the overview map and so the overview maps are different. It is surely a bug that the map outlines are wrong and so I will look at this next. However I am not sure what the full solution is though as there are other noticable problems, as the overview map is going to be wrong for one set of tiles whatever is done. Perhaps mixing tiles with different levels should not be allowed? ..Steve

Hi Steve, aren't overview levels defined by options or style? -- Best regards, Andrzej

The overview levels are defined in options as -overview-levels=5:17 , 6:15, 7:12 and the contentfile-levels are defined in \STYLE\options as levels= 0:24, 1:22 , 2:20, 3:18, 4:16 Thomas Am 18.06.2016 um 23:08 schrieb Andrzej Popowski:
Hi Steve,
aren't overview levels defined by options or style?

Hi Andrzej
aren't overview levels defined by options or style?
Good question, but it seems that the options are not used in this case... I think that the --overview-levels option is only used when there are ovm_ files present? I believe we should change it so that the option does work always. Best wishes ..Steve

Hi Steve, just have tripped on similar problem. I have made a transparent map with layers 24-23 and preview map in layer 18. This went wrong, since tile's areas in preview (objects 4A) were split into parts. Mapsource and MapInstall expect single area for each object 4A. I guess mkgmap takes background object 4B from img and convert it to tile's area 4A. Background can be split, probably mkgamp should merge all instances of background into single object 4A. Simplified solution could be to use map extent form TRE header instead but this won't work for irregular background. -- Best regards, Andrzej

Hi Andzrej, I fear I still don't understand what to do to reproduce the problem. Can you please post more details? Gerd ________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Dienstag, 28. Juni 2016 15:49:14 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Error in mkgmap r-3676, wrong preview generation Hi Steve, just have tripped on similar problem. I have made a transparent map with layers 24-23 and preview map in layer 18. This went wrong, since tile's areas in preview (objects 4A) were split into parts. Mapsource and MapInstall expect single area for each object 4A. I guess mkgmap takes background object 4B from img and convert it to tile's area 4A. Background can be split, probably mkgamp should merge all instances of background into single object 4A. Simplified solution could be to use map extent form TRE header instead but this won't work for irregular background. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, see attached example. I have used mp format because I couldn't invent equivalent example with osm data. See that both background 4B in level 1 of detailed img and map area 4A in overview consist of 2 parts. Mapsource and Mapinstall use only one part of object 4A. Other note: parameter overview-levels seems to be ignored for mp format. -- Best regards, Andrzej

Hi Andrzej, thanks, I was able to reproduce the 0x4a problem now and - as assumed - the problem seems to be caused by a size filter. The attached patch changes the filter so that it is skipped . Please check if this fixes your problems. I'll nowcheck the 2nd problem regarding "overview-levels seems to be ignored for mp format." Gerd ________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Dienstag, 5. Juli 2016 16:05:07 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Error in mkgmap r-3676, wrong preview generation Hi Gerd, see attached example. I have used mp format because I couldn't invent equivalent example with osm data. See that both background 4B in level 1 of detailed img and map area 4A in overview consist of 2 parts. Mapsource and Mapinstall use only one part of object 4A. Other note: parameter overview-levels seems to be ignored for mp format. -- Best regards, Andrzej

Hi, I am back from a nice cycle trip to Sicilia. I did not yet investigate the problem in detail, but I can for sure say that I did not think about this situation when I wrote the code for the overview map creation. If nobody claims that mkgmap should support this I would also prefer to print an error message and stop processing. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Steve Ratcliffe <steve@parabola.me.uk> Gesendet: Samstag, 18. Juni 2016 18:19 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Error in mkgmap r-3676, wrong preview generation Hi An update on the problem. The contour line tiles have the levels 0:24,1:23,2:22,3:20,4:18 whereas the content tiles have levels of 0:24,1:22,2:20,3:18,4:16,5:15 The first tile encountered determines the levels in the overview map and so the overview maps are different. It is surely a bug that the map outlines are wrong and so I will look at this next. However I am not sure what the full solution is though as there are other noticable problems, as the overview map is going to be wrong for one set of tiles whatever is done. Perhaps mixing tiles with different levels should not be allowed? ..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, please make a really solution of the error or untouch the code. No error mesasage ! Maybee a error message prevent mkgmap to create the _mdr.ing. I use a workaround with cgpsmapper to create the preview.img. I am angry, that my workaround wil lnot longer work, if mkgamp gives me error message.thank you. thomas by the way... : the problem is: mkgmap creates many 0x4a for one maptile. it should creates only one 0x4a with the tile-boundaries, like in the corrresponding tdb. Maybee is the solution, to use the same algorythmus for writing 0x4a in preview like in tdb ? Am 01.07.2016 um 10:57 schrieb Gerd Petermann:
Hi,
I am back from a nice cycle trip to Sicilia. I did not yet investigate the problem in detail, but I can for sure say that I did not think about this situation when I wrote the code for the overview map creation. If nobody claims that mkgmap should support this I would also prefer to print an error message and stop processing.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Steve Ratcliffe <steve@parabola.me.uk> Gesendet: Samstag, 18. Juni 2016 18:19 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Error in mkgmap r-3676, wrong preview generation
Hi
An update on the problem.
The contour line tiles have the levels 0:24,1:23,2:22,3:20,4:18 whereas the content tiles have levels of 0:24,1:22,2:20,3:18,4:16,5:15
The first tile encountered determines the levels in the overview map and so the overview maps are different. It is surely a bug that the map outlines are wrong and so I will look at this next.
However I am not sure what the full solution is though as there are other noticable problems, as the overview map is going to be wrong for one set of tiles whatever is done. Perhaps mixing tiles with different levels should not be allowed?
..Steve _______________________________________________ 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

Hi Thomas, okay, I'll dig into this during the next days. My understanding so far is that the ovm_*.img tiles do not contain 0x4a polygons and that the code adds just one 0x4a polygon for the overview map. Maybe this is split into pieces because some size limits are reached... Gerd ________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Sonntag, 3. Juli 2016 06:15:54 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Error in mkgmap r-3676, wrong preview generation Hi Gerd, please make a really solution of the error or untouch the code. No error mesasage ! Maybee a error message prevent mkgmap to create the _mdr.ing. I use a workaround with cgpsmapper to create the preview.img. I am angry, that my workaround wil lnot longer work, if mkgamp gives me error message.thank you. thomas by the way... : the problem is: mkgmap creates many 0x4a for one maptile. it should creates only one 0x4a with the tile-boundaries, like in the corrresponding tdb. Maybee is the solution, to use the same algorythmus for writing 0x4a in preview like in tdb ? Am 01.07.2016 um 10:57 schrieb Gerd Petermann:
Hi,
I am back from a nice cycle trip to Sicilia. I did not yet investigate the problem in detail, but I can for sure say that I did not think about this situation when I wrote the code for the overview map creation. If nobody claims that mkgmap should support this I would also prefer to print an error message and stop processing.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Steve Ratcliffe <steve@parabola.me.uk> Gesendet: Samstag, 18. Juni 2016 18:19 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Error in mkgmap r-3676, wrong preview generation
Hi
An update on the problem.
The contour line tiles have the levels 0:24,1:23,2:22,3:20,4:18 whereas the content tiles have levels of 0:24,1:22,2:20,3:18,4:16,5:15
The first tile encountered determines the levels in the overview map and so the overview maps are different. It is surely a bug that the map outlines are wrong and so I will look at this next.
However I am not sure what the full solution is though as there are other noticable problems, as the overview map is going to be wrong for one set of tiles whatever is done. Perhaps mixing tiles with different levels should not be allowed?
..Steve _______________________________________________ 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
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Great site, this did what I wanted: name~'Avenida.*' & highway=* { set name='${name|subst:"Avenida=>Av."}'} I am also checking some of the other tricks. Thanks a lot! Alexandre On 13/06/2016 03:30, nwillink wrote:
You may also like to read
How to replace Road with Rd , Street with St etc
from
Tricks with mkgmap Styles 3.pdf
on
http://www.pinns.co.uk/osm/styleideas.html
-- View this message in context: http://gis.19327.n5.nabble.com/How-do-I-transform-the-name-of-all-Ways-tp587... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (7)
-
Alexandre de Menezes
-
Andrzej Popowski
-
Colin Smale
-
Gerd Petermann
-
nwillink
-
Steve Ratcliffe
-
Thomas Morgenstern