Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mastay=* uses time ranges #9

Open
d1g opened this issue Sep 9, 2016 · 7 comments
Open

mastay=* uses time ranges #9

d1g opened this issue Sep 9, 2016 · 7 comments

Comments

@d1g
Copy link

d1g commented Sep 9, 2016

http://taginfo.openstreetmap.org/keys/maxstay#values - search for "@" here

Is this tag used by reports? I wasn't able to find it using Github seach

@ypid ypid added the question label Sep 9, 2016
@ypid
Copy link
Member

ypid commented Sep 9, 2016

The maxstay key is not related to the opening_hours syntax AFAIK. It is currently not handled by @opening-hours and I am not sure if it would be a fit.

@d1g
Copy link
Author

d1g commented Sep 10, 2016

Some users (<2%) were using combined values in maxstay=* - http://taginfo.openstreetmap.org/tags/maxstay=120%20%40%20Mo-Fr%2008%3A00-18%3A00#overview

Probably we can re-tag them as
opening_hours=Mo-Fr 08:00-18:00
maxstay=120 m

True that maxstay=* is more about "duration" (maximum possible) than about OH/schedules

@ypid
Copy link
Member

ypid commented Sep 10, 2016

Retagging as you proposed sounds good 😉 I am closing this for now. Feel free to comment.

@ypid ypid closed this as completed Sep 10, 2016
@ypid ypid reopened this Sep 10, 2016
@d1g d1g closed this as completed Sep 10, 2016
@ypid
Copy link
Member

ypid commented Sep 10, 2016

Ah now I get it. The @ (<opening_hours syntax>) notation is used for other tags as well and I already thought about that 😉

As it is documented in Key:maxstay the value 1 @ (08:00-18:00) is supported. The program that evaluates this (like OSMAnd) should parse the 1 @ (08:00-18:00) and can then hand the 08:00-18:00 to the @opening-hours tools for further processing.

The @opening-hours tools currently do not evaluate tags which support the @ notation syntax. If there is a list of those tags this could be added to the statistics. Thanks for the hint 👍

PS: I think I read something that OSMAnd has support for the @ notation for other keys.

@ypid ypid reopened this Sep 10, 2016
@d1g
Copy link
Author

d1g commented Sep 10, 2016

Well most important tags with "@" values are also quite complex: http://wiki.openstreetmap.org/wiki/Conditional_restrictions

It feels like you need a separate grammar only for Conditional restrictions 🐘

@ypid
Copy link
Member

ypid commented Sep 10, 2016

The good thing is the opening_hours-statistics only needs to worry about the part in the parentheses 😉

I imaging some value preparation for the statistics which could be based on regular expression substitution like s/^\S+\s*@\s*\((.*)\).*$/\1/;.

What do you think?

@d1g
Copy link
Author

d1g commented Sep 10, 2016

More than acceptable for stats, but it is possible to have multiple @@

120 @ (06:00-20:00); 100 @ (22:00-06:00)

Before matching against regex with one "@", check if string contains only one "@"

@ypid ypid added enhancement and removed question labels Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants