Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11330 closed enhancement (fixed)

add validator warning for short keys

Reported by: Klumbumbus Owned by: team
Priority: normal Milestone: 15.04
Component: Core validator Version:
Keywords: Cc: bastiK

Description

follow up from #11234

we should warn about keys with 1 or 2 characters as these are mostly typos, except to (used in route relations).

I think we should not allow id, since this is not documented in the wiki and mostly part of local imports or should be ref instead.

the 2 following mapcss syntaxes do not work however:

*[/.{1,2}/] {
  throwWarning: tr("uncommon short key");
}
*[/.?.?/] {
  throwWarning: tr("uncommon short key");
}

Attachments (0)

Change History (17)

comment:1 Changed 4 years ago by stoecker

Cc: bastiK added

comment:2 Changed 4 years ago by bastiK

This isn't possible at the moment. We'd need a MapCSS extension or a custom validator test class.

comment:3 in reply to:  description ; Changed 4 years ago by simon04

Hi all :),
what about …

*[/^.$/], *[/^..$/] {
  throwWarning: tr("uncommon short key");
}

comment:4 Changed 4 years ago by Klumbumbus

That works, thanks :)

comment:5 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: newclosed

In 8192/josm:

fix #11330 - add validator warning for short keys with only one or two characters (code by simon04)

comment:6 in reply to:  3 Changed 4 years ago by bastiK

Replying to simon04:

Hi all :),
what about …

*[/^.$/], *[/^..$/] {
  throwWarning: tr("uncommon short key");
}

Hi Simon, it's nice to hear from you again!

I completely forgot you added this syntax in r6547, sorry about that. :)

comment:7 Changed 4 years ago by aceman

Is "uncommon short key" proper English?
Also, should the "to" be restricted to only occur in relations? Can mapCSS distinguish the object type?

comment:8 in reply to:  7 ; Changed 4 years ago by Klumbumbus

Replying to aceman:

Is "uncommon short key" proper English?

I don't know :)

Also, should the "to" be restricted to only occur in relations? Can mapCSS distinguish the object type?

Yes it can. For sure we can warn also for to on nodes. I'm not sure about ways. It is not documented, but it seems it is (geographically limited) used on some power cables, see http://taginfo.openstreetmap.org/keys/to?filter=ways#map

comment:9 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: closedreopened

comment:10 in reply to:  8 ; Changed 4 years ago by aceman

Replying to Klumbumbus:

Replying to aceman:

Is "uncommon short key" proper English?

I don't know :)

"unusually short key" or something else with -ly suffix would seem more proper to me.

Also, should the "to" be restricted to only occur in relations? Can mapCSS distinguish the object type?

Yes it can. For sure we can warn also for to on nodes. I'm not sure about ways.

It seems the current patch will NOT warn for nodes. Or any objects with "to". Making it NOT warn only on relations is the proposal.

comment:11 in reply to:  10 Changed 4 years ago by Klumbumbus

Replying to aceman:

It seems the current patch will NOT warn for nodes. Or any objects with "to". Making it NOT warn only on relations is the proposal.

Yes, thats what I mean. What I tried to say was that some people think that to is also valid for ways.

Last edited 4 years ago by Klumbumbus (previous) (diff)

comment:12 Changed 4 years ago by aceman

Yeah so either we leave it as is or warn at least for nodes.

comment:13 in reply to:  8 Changed 4 years ago by skyper

Replying to Klumbumbus:

I'm not sure about ways. It is not documented, but it seems it is (geographically limited) used on some power cables, see http://taginfo.openstreetmap.org/keys/to?filter=ways#map

That is bad tagging as this information should be either on a relation or simply taken from data as the destination would be any power=substation at the end of the lines.

+1 for warning on ways, too.

comment:14 Changed 4 years ago by Klumbumbus

Can someone help with the correct english phrase?

  • uncommon short key
  • unusually short key
  • ...

?

comment:15 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: reopenedclosed

In 8204/josm:

see #11245 - remove controversial clothes tag; fix #10329 - improve color validator warning; fix #11330 - improve uncommon short key validator warning; fix #11344 - add validator warning for 'tower|pole=air_to_ground'

comment:16 Changed 4 years ago by aceman

Please, why do you do changes in unrelated tickets? And why is 'clothes' removed, now that localizers have done the work of translating the values? What is controversial in it?

comment:17 in reply to:  16 Changed 4 years ago by Klumbumbus

Replying to aceman:

Please, why do you do changes in unrelated tickets?

I thought it wouldn't hurt to combine these minor changes.

And why is 'clothes' removed, now that localizers have done the work of translating the values? What is controversial in it?

See #11245

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.