You are not logged in.

#1 2019-11-22 10:13:41

nadol
Member
Registered: 2017-07-06
Posts: 8

mkgmap - highway ref name manipulation

Hi!
Maybe someone will help solve my problem...
On my custom map I've road shields with it name/number.
For secondary and tertiary I get some OSM internal refs which are useless (no real live use while navigation).
I would like to get rid of them.
Example crossing: https://www.openstreetmap.org/#map=18/52.31347/21.00157
Secondary 633 is OK, tertiary 5580W - not.
Lines code:
highway = secondary & ref! (~ '[0-9][0-9][0-9][0-9][A-Z]') {name '${ref|highway-symbol:oval}'} [0x10d04 resolution 18-19 continue]
highway = secondary & ref ~ '[0-9][0-9][0-9][0-9][A-Z]' [0x10d04 resolution 18-19 continue]

To goal is to not show shields for roads with OSM internal refs like 5580W.

Please help.

Offline

#2 2019-11-22 13:07:48

GerdP
Member
Registered: 2015-12-18
Posts: 889

Re: mkgmap - highway ref name manipulation

I am not sure what problem you get with those two rules. Maybe you should add a rule which handles ways without a ref?

Besides that I don't understand the phrase "OSM internal refs". OSM doesn't need any internal refs.

Offline

#3 2019-11-22 14:01:31

nadol
Member
Registered: 2017-07-06
Posts: 8

Re: mkgmap - highway ref name manipulation

Gerd, please take a look at provided link. At this crossing there is a road with ref 5580W.
This number is useless - there is no road called 5580W in real life so in such condition there no need to display shield with this number.
Rule which I try to appply need to hide shields for such roads.

Offline

#4 2019-11-22 16:21:46

ligfietser
Moderator
Registered: 2008-10-09
Posts: 5,127
Website

Re: mkgmap - highway ref name manipulation

I dont know your code, but in the default line style the ref shields are processed like this


# Display highway shield for mayor roads if they have a ref and make them searchable by their name
(highway=motorway | highway=trunk) & ref=* {name '${ref|highway-symbol:hbox}'; addlabel '${name}'}
highway=primary & ref=* {name '${ref|highway-symbol:box}'; addlabel '${name}'}
(highway=secondary | highway=tertiary) & ref=* {name '${ref|highway-symbol:oval}'; addlabel '${name}'}

name=* {name '${name}'}
highway=* & ref=* & highway!=motorway & highway!=trunk & highway!=primary & highway!=secondary & highway!=tertiary
    {addlabel '${ref}'}

highway=* & int_ref=* {addlabel '${int_ref}'}
highway=* & nat_ref=* {addlabel '${nat_ref}'}
highway=* & reg_ref=* {addlabel '${reg_ref}'}

So if you dont like to see them, just  delete the  highway=tertiary from line 4 and 7 right?

BTW if 5580W does not exist in real life, the OSM data should be corrected by editing the map.

Offline

#5 2019-11-23 11:21:28

GerdP
Member
Registered: 2015-12-18
Posts: 889

Re: mkgmap - highway ref name manipulation

nadol wrote:

Gerd, please take a look at provided link. At this crossing there is a road with ref 5580W.
This number is useless - there is no road called 5580W in real life so in such condition there no need to display shield with this number.
Rule which I try to appply need to hide shields for such roads.

In Germany you don't see refs for tertiary roads on normal road signs but you find them on milestones and they are also used in newspapers in articles about construction work or accidents.

Offline

#6 2019-12-02 15:52:00

nadol
Member
Registered: 2017-07-06
Posts: 8

Re: mkgmap - highway ref name manipulation

I don't want to get rid of those road. I just don't want to display shields for it. So working regex is needed with logic as follow:
If ref length = 5 and 1st char is digit[0-9] and 2nd char is digit[0-9] and 3rd char is digit[0-9] and 4th char is digit[0-9] and 5th char is letter[A-Z] don't display shield for it.

Offline

#7 2019-12-02 17:41:56

ligfietser
Moderator
Registered: 2008-10-09
Posts: 5,127
Website

Re: mkgmap - highway ref name manipulation

The rule (highway=secondary | highway=tertiary) & ref=* {name '${ref|highway-symbol:oval}'; addlabel '${name}'} is only adding a shield. If you remove this line it does not remove the road from your map.

Offline

#8 2019-12-02 18:59:12

GerdP
Member
Registered: 2015-12-18
Posts: 889

Re: mkgmap - highway ref name manipulation

nadol wrote:

I don't want to get rid of those road. I just don't want to display shields for it. So working regex is needed with logic as follow:
If ref length = 5 and 1st char is digit[0-9] and 2nd char is digit[0-9] and 3rd char is digit[0-9] and 4th char is digit[0-9] and 5th char is letter[A-Z] don't display shield for it.

I think

highway = tertiary & ref ~ '[0-9][0-9][0-9][0-9][A-Z]' 

should work, means, it should match for way 188220733.

So, maybe the problem is to find the negation? That would be

highway = tertiary & !(ref ~ '[0-9][0-9][0-9][0-9][A-Z]') 

Offline

#9 2019-12-03 12:08:53

nadol
Member
Registered: 2017-07-06
Posts: 8

Re: mkgmap - highway ref name manipulation

Thanks Gerd, I will test this rule negation.

Edit...
After some more modifications of lines file I get what I need.
Moreover I dig deeper to find source of road naming and I found that those ref names are OK but I never saw it on road signs or maps.

Regards,
Artur

Last edited by nadol (2019-12-04 11:23:44)

Offline

Board footer

Powered by FluxBB