Modify

Opened 10 years ago

Closed 10 years ago

Last modified 5 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 (18)

comment:1 by stoecker, 10 years ago

Cc: bastiK added

comment:2 by bastiK, 10 years ago

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

in reply to:  description ; comment:3 by simon04, 10 years ago

Hi all :),
what about …

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

comment:4 by Klumbumbus, 10 years ago

That works, thanks :)

comment:5 by Klumbumbus, 10 years ago

Resolution: fixed
Status: newclosed

In 8192/josm:

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

in reply to:  3 comment:6 by bastiK, 10 years ago

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 by aceman, 10 years ago

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

in reply to:  7 ; comment:8 by Klumbumbus, 10 years ago

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 by Klumbumbus, 10 years ago

Resolution: fixed
Status: closedreopened

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

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.

in reply to:  10 comment:11 by Klumbumbus, 10 years ago

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 10 years ago by Klumbumbus (previous) (diff)

comment:12 by aceman, 10 years ago

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

in reply to:  8 comment:13 by skyper, 10 years ago

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 by Klumbumbus, 10 years ago

Can someone help with the correct english phrase?

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

?

comment:15 by Klumbumbus, 10 years ago

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 by aceman, 10 years ago

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?

in reply to:  16 comment:17 by Klumbumbus, 10 years ago

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

comment:18 by Klumbumbus, 5 years ago

In 15828/josm:

  • Fix #18642, see #11330 - Don't warn about the key to on route=ferry ways
  • Add vehicle combo to highway=track preset

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.