[Patch v1] improve mdr7 index

Hi all, attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,.... So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words. @Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed. Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ... Gerd

that looks more useful. I don't think reporting is needed - you can check if things are working in the map themselves - so it should be only in some kind of debug mode. Could there be a wildcard like "?". I have thinks like M?? for M00 to M66. Of course I could add all combinations into the file so I'm not sure if a wildcard like ? is a good idea. Maybe have ? not as wildcard but escaped "^?" as wildcard? Then I could simply have M^?^? as a rule in mdr-7-del instead of putting in all the possible combinations. I guess allowing ^* as wildcard would be a bit too strong though - and I guess should not be allowed? On 5 April 2017 at 16:03, Gerd Petermann <GPetermann_muenchen@hotmail.com> wrote:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Felix Hartman - Openmtbmap.org & VeloMap.org Schusterbergweg 32/8 6020 Innsbruck Austria - Österreich

Hi Felix, the current patch adds the list of values to a HashSet and searches for exact matches only. If we allow wildcards or regular expressions in general we need a lot more code to parse a new option file and implement a sequential search for the given patterns. I'd prefer to keep this simple for now, so please add each pattern. Or do you think that is not possible? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Felix Hartmann <extremecarver@gmail.com> Gesendet: Mittwoch, 5. April 2017 18:03:08 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index that looks more useful. I don't think reporting is needed - you can check if things are working in the map themselves - so it should be only in some kind of debug mode. Could there be a wildcard like "?". I have thinks like M?? for M00 to M66. Of course I could add all combinations into the file so I'm not sure if a wildcard like ? is a good idea. Maybe have ? not as wildcard but escaped "^?" as wildcard? Then I could simply have M^?^? as a rule in mdr-7-del instead of putting in all the possible combinations. I guess allowing ^* as wildcard would be a bit too strong though - and I guess should not be allowed? On 5 April 2017 at 16:03, Gerd Petermann <GPetermann_muenchen@hotmail.com<mailto:GPetermann_muenchen@hotmail.com>> wrote: Hi all, attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,.... So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words. @Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed. Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ... Gerd _______________________________________________ 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 -- Felix Hartman - Openmtbmap.org & VeloMap.org Schusterbergweg 32/8 6020 Innsbruck Austria - Österreich

On 5 April 2017 at 18:13, Gerd Petermann <GPetermann_muenchen@hotmail.com> wrote:
the current patch adds the list of values to a HashSet and searches for exact matches only. If we allow wildcards or regular expressions in general we need a lot more code to parse a new option file and implement a sequential search for the given patterns. I'd prefer to keep this simple for now, so please add each pattern. Or do you think that is not possible?
Sorry for the late reply. No no problem. I can just write down all the possible combinations into the option file too. Going to be maybe 100 entries - so should be fine. -- Felix Hartman - Openmtbmap.org & VeloMap.org Schusterbergweg 32/8 6020 Innsbruck Austria - Österreich

I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success. El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd

Hi Carlos, the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success. El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I already tried with grade1 with the same result El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd

--x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1 El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd

Hi Carlos, so I guess you don't use --lower-case. The label is stored in UPPER-case and the Garmin software translates it to mixed-case. Maybe I should change the implementation of the options to ignore the case? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 20:06:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index --x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1 El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Wouldn't it be better to compare with actual values in OSM object? By the way, could you add capability to catch multiple words? I would like to remove from index entries like "grade1, (3m)" El 12/04/17 a las 23:14, Gerd Petermann escribió:
Hi Carlos,
so I guess you don't use --lower-case. The label is stored in UPPER-case and the Garmin software translates it to mixed-case. Maybe I should change the implementation of the options to ignore the case?
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 20:06:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
--x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1
El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd

Hi Carlos, the global index is created from data in the img files. The algo has no access to the original OSM data. If you append information in brackets () they are not indexed. Does that help? Or maybe we can define another special character which starts information that should be ignored? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 23:21:07 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index Wouldn't it be better to compare with actual values in OSM object? By the way, could you add capability to catch multiple words? I would like to remove from index entries like "grade1, (3m)" El 12/04/17 a las 23:14, Gerd Petermann escribió:
Hi Carlos,
so I guess you don't use --lower-case. The label is stored in UPPER-case and the Garmin software translates it to mixed-case. Maybe I should change the implementation of the options to ignore the case?
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 20:06:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
--x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1
El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I see the point about original OSM data, that's no problem. If I use brackets I get an error: bash: syntax error near unexpected element `(' I tried --x-mdr7-del=GRADE1(3M) and --x-mdr7-del=GRADE1 (3M) May be it works in Windows. El 12/04/17 a las 23:28, Gerd Petermann escribió:
Hi Carlos,
the global index is created from data in the img files. The algo has no access to the original OSM data. If you append information in brackets () they are not indexed. Does that help? Or maybe we can define another special character which starts information that should be ignored?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 23:21:07 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
Wouldn't it be better to compare with actual values in OSM object? By the way, could you add capability to catch multiple words? I would like to remove from index entries like "grade1, (3m)"
El 12/04/17 a las 23:14, Gerd Petermann escribió:
Hi Carlos,
so I guess you don't use --lower-case. The label is stored in UPPER-case and the Garmin software translates it to mixed-case. Maybe I should change the implementation of the options to ignore the case?
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 20:06:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
--x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1
El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd

Hi Carlos, my idea was to use brackets in the label produced by the style , something like "ABC Road (grade1 (3m))" Everything after the opening bracket is ignored by the --x-split-name-index option. You can put the option into a file if the commandline causes trouble with special characters. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Donnerstag, 13. April 2017 07:04:43 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index Hi Gerd I see the point about original OSM data, that's no problem. If I use brackets I get an error: bash: syntax error near unexpected element `(' I tried --x-mdr7-del=GRADE1(3M) and --x-mdr7-del=GRADE1 (3M) May be it works in Windows. El 12/04/17 a las 23:28, Gerd Petermann escribió:
Hi Carlos,
the global index is created from data in the img files. The algo has no access to the original OSM data. If you append information in brackets () they are not indexed. Does that help? Or maybe we can define another special character which starts information that should be ignored?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 23:21:07 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
Wouldn't it be better to compare with actual values in OSM object? By the way, could you add capability to catch multiple words? I would like to remove from index entries like "grade1, (3m)"
El 12/04/17 a las 23:14, Gerd Petermann escribió:
Hi Carlos,
so I guess you don't use --lower-case. The label is stored in UPPER-case and the Garmin software translates it to mixed-case. Maybe I should change the implementation of the options to ignore the case?
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 20:06:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
--x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1
El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

My test was without --x-split-name-index, only --x-mdr7-del. I don't get good results with --x-split-name-index by now. El 13/04/17 a las 08:39, Gerd Petermann escribió:
Hi Carlos,
my idea was to use brackets in the label produced by the style , something like "ABC Road (grade1 (3m))" Everything after the opening bracket is ignored by the --x-split-name-index option. You can put the option into a file if the commandline causes trouble with special characters.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Donnerstag, 13. April 2017 07:04:43 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
Hi Gerd I see the point about original OSM data, that's no problem. If I use brackets I get an error: bash: syntax error near unexpected element `(' I tried --x-mdr7-del=GRADE1(3M) and --x-mdr7-del=GRADE1 (3M) May be it works in Windows.
El 12/04/17 a las 23:28, Gerd Petermann escribió:
Hi Carlos,
the global index is created from data in the img files. The algo has no access to the original OSM data. If you append information in brackets () they are not indexed. Does that help? Or maybe we can define another special character which starts information that should be ignored?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 23:21:07 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
Wouldn't it be better to compare with actual values in OSM object? By the way, could you add capability to catch multiple words? I would like to remove from index entries like "grade1, (3m)"
El 12/04/17 a las 23:14, Gerd Petermann escribió:
Hi Carlos,
so I guess you don't use --lower-case. The label is stored in UPPER-case and the Garmin software translates it to mixed-case. Maybe I should change the implementation of the options to ignore the case?
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 20:06:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
--x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1
El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd

Hi Carlos, okay, you did not yet say if --x-mdr7-del=GRADE1 works. If you don't use the --lowercase option all labels are saved as upper case strings and the Garmin software converts it back to mixed case. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Donnerstag, 13. April 2017 21:00:14 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index My test was without --x-split-name-index, only --x-mdr7-del. I don't get good results with --x-split-name-index by now. El 13/04/17 a las 08:39, Gerd Petermann escribió:
Hi Carlos,
my idea was to use brackets in the label produced by the style , something like "ABC Road (grade1 (3m))" Everything after the opening bracket is ignored by the --x-split-name-index option. You can put the option into a file if the commandline causes trouble with special characters.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Donnerstag, 13. April 2017 07:04:43 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
Hi Gerd I see the point about original OSM data, that's no problem. If I use brackets I get an error: bash: syntax error near unexpected element `(' I tried --x-mdr7-del=GRADE1(3M) and --x-mdr7-del=GRADE1 (3M) May be it works in Windows.
El 12/04/17 a las 23:28, Gerd Petermann escribió:
Hi Carlos,
the global index is created from data in the img files. The algo has no access to the original OSM data. If you append information in brackets () they are not indexed. Does that help? Or maybe we can define another special character which starts information that should be ignored?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 23:21:07 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
Wouldn't it be better to compare with actual values in OSM object? By the way, could you add capability to catch multiple words? I would like to remove from index entries like "grade1, (3m)"
El 12/04/17 a las 23:14, Gerd Petermann escribió:
Hi Carlos,
so I guess you don't use --lower-case. The label is stored in UPPER-case and the Garmin software translates it to mixed-case. Maybe I should change the implementation of the options to ignore the case?
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 20:06:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
--x-mdr7-del=GRADE1 works although actual tag value is grade1, and MapSource displays Grade1
El 12/04/17 a las 19:27, Gerd Petermann escribió:
Hi Carlos,
the option is case sensitive. Please try --x-mdr7-del=grade1 or maybe --x-mdr7-del=GRADE1. Depends on option lower-case. I've probably mislead you by giving examples for the "Speiche" style which really adds "Gr1" for tracktype=grade1 or "Primary" for a highway=primary.
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Mittwoch, 12. April 2017 19:13:32 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index
I have the following rule in my lines file: highway=track {name '${ref} ${name}' | '${ref}' | '${name}' | '${tracktype}' } If I got that right, using --x-mdr7-del=Grade1 should avoid all tracks tagged tracktype=grade1 (without name and ref) to be indexed, but I can still search for them. I tried with and without --x-split-name-index without success.
El 05/04/17 a las 16:03, Gerd Petermann escribió:
Hi all,
attached is a patch which changes the meaning of --x-mdr7-excl and adds a 2nd option --x-mdr7-del. A binary is here: http://files.mkgmap.org.uk/download/345/mkgmap.jar
The new option --x-mdr7-del can be used to delete strings from road names before they are written to any index. The option --x-mdr7-excl is now only used for the partial names created by the --x-split-name-index option. If you place them in an option file, you may use this: x-mdr7-excl=Weg,Straße,Street,Road x-mdr7-del=Service,Primary,Secondary,Tertiary,....
So, in x-mdr7-excl you list parts of real road names which should not be searchable. In x-mdr7-del you put words which were added by your style and should be removed from the name. The removement of those strings is done from the end, it stops when a word is found that should not be deleted. This is what I described as 1a) here: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q2/026584.html
You may now add blanks to improve readabilty, so x-mdr7-excl=Weg, Straße, Street, Road works like above. I am not sure if there is a case where we want to be able to exclude multiple words.
@Arndt: In your current config file you use "Via Ferrata" and some other combinations with blanks like "unpav CyW". This will no longer work with this patch. Maybe you can change your style to add "Via-Ferrata" instead the other combinations are simply no longer needed.
Do we need some kind of reporting for these options? Maybe some stats like mdr7-excl option Weg matched 11231 times mdr7-excl option Straße matched 2321 times ...
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Carlos, you were clear, I simply forgot it. Getting old ;-) Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Donnerstag, 13. April 2017 21:32:34 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] [Patch v1] improve mdr7 index El 13/04/17 a las 21:11, Gerd Petermann escribió:
you did not yet say if --x-mdr7-del=GRADE1 works.
Yes, it works. I told it in a message yesterday. Sorry if I wasn't clear enough. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
Carlos Dávila
-
Felix Hartmann
-
Gerd Petermann