JA:Key:opening_hours

From OpenStreetMap Wiki
Jump to navigation Jump to search
Public-images-osm logo.svg opening_hours
Neon Internet Cafe open 24 hours.jpg
説明
営業時間。何かがいつ開いていつ閉まるかを記述します。このデータには標準の書式があります。 Show/edit corresponding data item.
グループ: プロパティ
URL 形式
https://openingh.openstreetmap.de/evaluation_tool/?EXP=$1
適用できる要素
ノードに使用可能ウェイに使用可能領域に使用可能リレーションに使用可能
関連項目
状態:事実上の標準

broom

Help (89606) - The Noun Project.svg

営業時間が知られているものであればほとんどすべて、 opening_hours=* によって営業時間を記入することが可能です。スーパーマーケットや小規模なコンビニエンスストアは同じ国であっても(同じ都市の中ですら)閉店時間が異なり、大都市部では一晩中開いている小さな店がよくみかけられます。24時間年中無休の薬局やガソリンスタンド、パブ、ファストフード店もあります。夜間に特定の施設を探す際、このような情報はとても重要です。

加えて、現在の営業時間を参照できる URL を、 opening_hours:url=http://example.org/ でタグ付けすることもできます。

文法は複雑ですが、複雑な営業時間を入力できます。しかし、ほとんどのマッパーはタグを直接入力するよりも JOSM のOpeningHoursEditorプラグイン(設定のプラグインからインストールできます)や Vespucci に内蔵されたエディタ、 StreetComplete などを使用するほうがよいでしょう。

このページを読む前に、 Proposed features/Time domainsJA:Key:opening_hours/仕様に注意してください。


簡単な記述例

単純な営業時間の場合

Image demonstrating to use a hyphen to separate the first and last weekday in the range, a space between the day range and the time interval, and noting that a leading zero is mandatory.

この画像の場合、平日(月~金)の8:00から17:30(午後5時30分)までが営業時間です。 記述する際、次のことに注意してください。

Mo-Frなどで営業している曜日を表します。英語の略記で記述し、上の画像の場合は月曜から金曜まで営業します。(英語の略記法については後述の表で確認してください。)

8時0分など、時刻が1ケタの場合、最初に0をつけて08:00のように表記します。

17:30のように24時間制を使用してください。午後5時半やPM5:30のような12時間制は使用できません。また、00分のことをちょうどと表記したり、30分のことを半と表記することもできません。

  • 曜日については次の表に示した英語の略記法で記述します。:
略記 曜日
Mo 月曜日(Monday)
Tu 火曜日(Tuesday)
We 水曜日(Wednesday)
Th 木曜日(Thursday)
Fr 金曜日(Friday)
Sa 土曜日(Saturday)
Su 日曜日(Sunday)

祝祭日については後述します。

中休みを挟む営業時間

opening_hours=Mo-Fr 08:00-12:00,13:00-17:30
先程の例と営業日や開店・閉店時間は同じですが、12時00分から13時00分までは中休みで営業しません。
  • 中休みを挟む営業時間の場合、半角のカンマ (,)で区切って表記します。


日によって営業時間が異なる場合

opening_hours=Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-12:00
平日は中休みを挟む例に加えて、土曜日の8時00分から12時00分も営業します。
  • 営業時間が違う日を記載するには、半角のセミコロンと半角のスペース(; )で区切って表記します。


祝祭日に休業する場合

opening_hours=Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-12:00; PH off
日によって営業時間が異なる場合の例に加えて、祝祭日は営業しません。
  • 曜日の代わりにPHを使うことで祝日を表します。また、時間の代わりにoffと記述することで終日営業しないことを表します。
  • SHは休校日です。学校が休みの日を表します。あまりないでしょうが、PHSHを併用することも可能です。

例:opening_hours=Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-12:00; PH off; SH off


祝祭日は営業時間が異なる場合

opening_hours=Mo-Fr 08:00-12:00,13:00-17:30; Sa 08:00-12:00; PH 09:00-12:00
祝日は9時00分から12時00分まで営業します。


  • 前述のとおり、PHは曜日と同じように記載されます。また、曜日と同じように解釈されます。

opning_hourの記法では、右(文章の後の方)に書かれたほうが左(文章の前の方)にかかれているものより優先されるという規則があるため、平日などの記述があっても祝日が優先されます。つまり、平日などの記載を祝日より後に記載してしまうと祝日の記載は無効になってしまいますので、注意してください。 記述の優先関係について詳しくは、this more elaborate guide(英語)を参照してください。

マッピング方法

性質を表すタグなので、以下のような関連タグとともに使用します。例)

ウェイ ウェイ をタグ付けする前に JA:Key:access を参照してください。

評価ツールYoHours は値を決めるのに役立つウェブツールです。月と曜日の名前は英語で入力してください。

  • 24/7
    適用例:24時間年中無休のすべての施設(関連タグ)
    地図上でのレンダリング:オブジェクトアイコンに24が付いたもの
  • Sa-Su 00:00-24:00
    適用例:週末のみの営業だが24時間営業
  • Mo-Fr 08:30-20:00 あるいは以下のようにより複雑な営業時間:
    Mo 10:00-12:00,12:30-15:00; Tu-Fr 08:00-12:00,12:30-15:00; Sa 08:00-12:00
    Mo-Su 08:00-18:00; Apr 10-15 off; Jun 08:00-14:00; Aug off; Dec 25 off
    適用例:営業時間をもつすべての施設(関連タグ)
    地図上でのレンダリング:されません。情報はソフトウェアにより復元されます。
  • Mo-Sa 10:00-20:00; Tu off または Mo-Sa 10:00-20:00; Tu 10:00-14:00
    週の途中に休業日がある場合
    適用例:営業時間をもつすべての施設(関連タグ)
    地図上でのレンダリング:されません。情報はソフトウェアにより復元されます。
  • sunrise-sunset
    適用例:毎日日の出から日没まで営業
    時間のオフセットを付ける場合は丸括弧 () を使用してください。例えば、ある公園が日の出時刻の2時間後から日の入り時刻の2時間前まで開いているような場合には (sunrise+02:00)-(sunset-02:00) となります。
  • Su 10:00+
    日曜日 10:00 開店で閉店時間は不明
    適用例:営業時間をもつすべての施設(関連タグ)
    地図上でのレンダリング:されません。情報はソフトウェアにより復元されます。
  • week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00
    奇数週は金曜日、偶数週は水曜日、09:00-12:00に開店。
    適用対象:営業時間があるすべての施設
    地図上でのレンダリング:されません。情報はソフトウェア処理されます。


  • Mo-Sa 08:00-13:00,14:00-17:00 || "by appointment"
    フォールバックルールを適用する例です。前のルールが適用されなかったすべての時間帯に適用されます。
  • Su-Tu 11:00-01:00, We-Th 11:00-03:00, Fr 11:00-06:00, Sa 11:00-07:00
    後ろのあるルールは前のルールを上書きすると決められているので、深夜をまたぐ時間帯を指定する場合は、セミコロンではなくコンマを使います。
  • Mo-Su,PH 15:00-03:00; easter -2 days off
    祝日を含む毎日開店するが、聖金曜日(イースター前の金曜日)は休み。

文法の概要

多くの場面に対応できる概要を示します。 opening_hours タグを完全な文法の説明ではなく、短い時間で書けるようになることを目指しています。もっと複雑な場面では、以降の節にある文章や仕様の全体追加の説明を参照してください。
評価ツール、またはより単純な YoHours アプリケーションを使用すると、組み立てた値をチェックできます。

注: Anyone being sure to have understood something upon which everyone agrees and that's different from this syntax explanation is welcome to make the correction in it.

凡例
コード はそのまま記述されます(必要な空白文字   を含めます。それ以外の文法内の空白文字は実際には入れません)。
要素 は以下の 要素: で始まる行で文法が定義されている 要素 に置き換えられます。
項目... はその 項目 が必要なだけ繰り返されることを示します。
[ 一連の項目 ] は、 一連の項目 が任意であることを示します。
| は(この記号で区切られた)一連の項目のうち一つを選択することを示します。
全般的な文法
opening_hours= ルールセット [ ; ルールセット ]...
それぞれの ルールセット は順番に評価され、後の ルールセット は以前の ルールセット と一致した開店・閉店の状態を上書きする可能性があります。
ルールセット: ルール [ || ルール ]...
それぞれの ルール は示されている日付や時刻に一致するか、 ルールセット 内にある次の ルール がフォールバックとしてのみチェックされるまで、順番に評価されます。
ルール: 範囲 [ 状態 ] [ コメント ]
範囲: [ 年の定義 ] 日付の定義 [   時間の定義 ] | 時間の定義 | 24/7
任意の年を指定する文法
年の定義: 年の範囲 [ , 年の範囲 ]...
年の範囲: [ - | + ] [ / n ]
任意で、 で指定された年から始まる年数を n 年と指定できます。
: はグレゴリオ暦における4桁の年号です。
日付を指定する文法(任意の時間を含む)
日付の定義: 月次 | 週次 | 日次 | 変動日の定義 | 祝日
月次: 日の定義 [   曜日の定義 ]
週次: [ week   週の範囲 [ , 週の範囲 ]...   ] 曜日の範囲 [ , 曜日の範囲 ]...
日次: 月の定義 [   日の定義 [ , 日の定義 ]... ]
変動日の定義: 変動日 [ - 変動日 ]
月の定義: [ - ]
日の定義: [ - ]
週の範囲: 週番号 [ - 週番号 | + ] [ / n ]
任意で、 週番号 で指定された週から始まる週の数を n 週と指定できます。
曜日の定義: 曜日の範囲 [ , 曜日の範囲 ]... | 曜日[ n [ , n ]... ]
曜日の後に番号が付くことがあり、正の数ならば月初から数えて第n週、負の数ならば月末から数えて第n週を示します。
e.g. Mo-Fr 08:00-09:00, or Mo[1,3] 08:00-09:00;
e.g. Su[1] は月の第1日曜日を表し、 Su[-1] は月の最終日曜日を表します。
曜日の範囲: 曜日 [ - 曜日 ]
週番号: (ISO 年の)週番号を2桁(01-53)で、例えば week 25 Mo 08:30-20:00
: 日を2桁(01-31)で、例えば Dec 25
: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec
英語の月名を3文字に略したもの、例えば Dec 25
曜日: Mo | Tu | We | Th | Fr | Sa | Su
英語の曜日名を2文字に略したもの、例えば Fr 08:30-20:00
変動日: 祭日 [ 符号 n days ] e.g. easter -2 days 08:00-17:00 for opening hours on Good Friday.
祭日: easter
現在のところ、定義されている変動する祭日はイースターのみです(キリスト教のグレゴリオ暦による)。
祝日: PH | SH
PH 国民の祝日(地域による、国や地域別のデータが必要)、または、 SH 学校休日(地域による、学校ごとのデータが必要)
時間を指定する文法
時間の定義: 時間の範囲 [ , 時間の範囲 ]...
時間の範囲: 時刻 [ - 時刻 | + ]
This may be used in place of "late" or "until last customer", e.g. 12:00+.
時刻: 固定時刻 | 変動時刻
固定時刻: HH : mm
変動時刻: イベント | ( イベント 相対時刻 )
イベント: dawn | sunrise | sunset | dusk
Note that sunset and sunrise times requires geolocation to compute the position angular elevation of the sun, and the the angular elevation of the observable horizon (which is also dependant of the altitude). They may be approximated at sea level on the modeling geoid, or just estimated roughly in local time (per country and time zone).
相対時刻: 符号 hh : mm
hh: 相対的な時を2桁(00-48)で、例えば (sunrise+01:00)-12:00
HH: 絶対的な時を2桁(00-23)で(1日の中で、午前・午後ではなく24時制で)、例えば Fr 08:30-20:00
mm: (時間の中の)分を2桁(00~59)で、例えば Fr 08:30-20:00
その他の日付や時刻を調整するために使われる全般的な文法要素
符号: + | -
n: 正の整数。
任意の修飾子の文法
状態: unknown | open | closed | off
unknown: initial open or closed state, except at overriding dates and times that follow (may also be used to override a previous explicit open or closed status);
open: open at the indicated dates and times (or permanently if no time is given), except at overriding dates and times that follow;
closed or off: closed at the indicated dates and times (or permanently if no time is given), except at overriding dates and times that follow;
In each ルール of the first ルールセット of the tag value (including fallbacks), if the 状態 is not explicitly specified with the specified 範囲, it is assumed to be meant as open, leaving all other unspecified dates and times as unknown; the resulting schedule is then successively modified by each following ルールセット.
コメント: "text"
制限や詳細についての短いコメントです(ダブルクオーテーションの" 内側のみ表示されます ")。例として、"子ども限定""限定サービス""電話予約"
このコメントはアプリケーションで表示されるもので、自動的な処理はされません。また、使用する言語は指定されていませんが、ローカライズのために言語接尾辞を使うこともできます。

記法

  • wd weekday, available: Mo · Tu · We · Th · Fr · Sa · Su (e.g., > Fr 08:30-20:00)
  • hh hour, always two digits number in 24h basis (no am/pm), in the format "hh:mm" · (e.g., > Fr 08:30-20:00)
  • mm minute, always two digits number in the format "hh:mm" (e.g., > Fr 08:30-20:00)
  • mo month, available: Jan · Feb · Mar · Apr · May · Jun · Jul · Aug · Sep · Oct · Nov · Dec · "mo md" (e.g., > Dec 25)
  • md monthday, always two digits number in the format · "mo md" (e.g., > Dec 25)
  • we week number, always a two digit number in range 01-53, in the format "week we" (e.g., > week 25 Mo 08:30-20:00)
  • SH 学校の休日(夏休みなどを含む)。学校休日で営業日が異なる場合に使用する。 (e.g., Mo-Fr 08:00-09:00,14:00-15:00; SH off)[1]
  • PH 祝日。祝日で営業日が異なる場合に使用する。 (e.g., Mo-Fr 09:00-17:00; PH 10:00-12:00; PH Su off)[1]
上の例は、通常営業時間が月-金の午前9時〜午後5時で、祝日の営業時間は午前10時〜午後12時、祝日が日曜日の場合は休みであることを意味しています。

The general syntax for the value is: hh:mm-hh:mm (e.g., > 08:30-20:00)

The general syntax for the value is: wd hh:mm-hh:mm (e.g., > Fr 08:30-20:00)

The general syntax for the value is: mo md: hh:mm-hh:mm (e.g., > Dec 25: 08:30-20:00) Note that the colon is optional as mentioned under JA:Key:opening_hours/仕様

The general syntax for the value is mo-mo: wd hh:mm-hh:mm (e.g., Jun-Aug: Su 10:30-16:00 to specify the opening times on Sundays in June, July and August. Note that the colon is optional as mentioned under JA:Key:opening_hours/仕様).

The general syntax for the value is: week we: wd hh:mm-hh:mm (e.g., > week 25: Mo 08:30-20:00) Note that the colon is optional as mentioned under JA:Key:opening_hours/仕様

規則

  • 連続する時間(常に開店時間-閉店時間の形)は "-" で区切ります。 例)08:30-20:00
  • 連続する曜日の開店は "-" で区切ります。例)Mo-Fr
  • 連続する(月を合わせた)日にちの開店は "-" で区切ります。例1)Dec 20-26 例2)Dec 20-Jan 06
  • Open with periodicity "n" within a range of consecutive monthdays, the range is followed by "/n" (e.g., > 02-30/n)
  • 連続する週の開店は "-" で区切ります。例)week 01-26
  • Open with periodicity "n" within a range of consecutive weeks, the range is followed by "/n" ( e.g.> week 02-52/n )
  • 曜日を分ける時は、 "," で区切ります。例)Mo,We,Fr
  • 時間を分ける時は、 "," で区切ります。例)08:30-14:00,16:30-20:00
  • 日によって営業時間が異なる場合は ";" で区切られます。 例)Mo 10:00-12:00,12:30-15:00; Tu-Fr 08:00-12:00,12:30-15:00; Sa 08:00-12:00
次のように読みます。: この日の開店時間; あの日の開店時間
  • 曜日の休業は "wd off" (wdには具体的な曜日を入れます)のようにタグ付けします。例)Tu off
  • 連続する曜日の休業は "wd-wd off" のようにタグ付けします。例)Tu-Th off
  • 月の休業は "mo off" (moには具体的な月を入れます)のようにタグ付けします。例)Aug off
  • 連続する月の休業は "mo-mo off" のようにタグ付けします。例)Aug-Sep off
  • (月を合わせた)日にちの休業は "mo md off" (mdには具体的な日を入れます)のようにタグ付けします。例)Dec 25 off
  • 連続する日にちの休業は "mo md-md off" または "mo md - mo md off" のようにタグ付けします。例1)Dec 24-26 off 例2)Dec 25-Jan 06 off
  • 連続する曜日の中の例外は、最初に連続する曜日を記入し、次に例外を記入します。例1)Mo-Sa 10:00-20:00; Tu off 例2)Mo-Sa 10:00-20:00; Tu 10:00-14:00 例3)Mo-Fr 08:00-12:30; We 14:00-17:00
これは開店時間の追加を意味しません。例えば、「Mo-Fr 08:00-12:30; We 14:00-17:00」は水曜日においては、午後だけ開店することを意味し、午後も開店することを意味しません
  • 例外に該当する曜日が連続する曜日の最初又は最後であるときは、例外ルールを使用せず、普通に記入してください。例)Mo-Fr 10:00-20:00; Sa 10:00-14:00
  • Non-consecutive or semi-consecutive days of the week will be tagged as wd[x] (e.g., Su[3] 09:00-12:00)
これはその月の第三日曜日の午前9時から12時を示します。
-1を使うとその月の前の月の最後の曜日を示します。例)「Aug Th[-1]」は、7月の最終木曜日を意味します。
グループ化が使えます。例)Su[1,3,5] 例2)Su[1-3]
  • その日において休業時間がない時は次のようにタグ付けします。: 00:00-24:00
  • 毎日24時間営業するときは特別な値があります。: 24/7
this way it can render a specific icon.このようなタグ付けは、特定のアイコンを地図上に追加します。
  • 日の出を示す特別な時間は次の通りです: sunrise
  • 日の入りを示す特別な時間は次の通りです: sunset
  • 時間の後ろに “+” を加えると、「から」や「就業時間不定」を意味します。例)Sa 22:00+ 例2) Sa 18:00-22:00+

詳細は JA:Key:opening_hours/仕様 を参照してください。

よくある間違い

  • 7/8-23 (誤り) → Mo-Su 08:00-23:00 (修正後)
  • 0600-180006:00-18:00
  • 07;00-2;00pm07:00-14:00
  • 08.00-16.00, public room till 03.00 a.m08:00-16:00 open, 16:00-03:00 open "public room"
  • 09:00-21:00 TEL/072(360)320009:00-21:00 "call us" (and add contact:phone=*)
  • 10:00 - 13:30 / 17:00 - 20:3010:00-13:30,17:00-20:30
  • April-September; Mo-Fr 09:00-13:00, 14:00-18:00, Sa 10:00-13:00 -> Apr-Sep: Mo-Fr 09:00-13:00,14:00-18:00; Apr-Sep: Sa 10:00-13:00
  • Dining in: 6am to 11pm; Drive thru: 24/7 -> 06:00-23:00 open "Dining in" || 00:00-24:00 open "Drive-through"
  • MWThF: 1200-1800; SaSu: 1200-1700 -> Mo,We,Th,Fr 12:00-18:00; Sa-Su 12:00-17:00
  • BAR: Su-Mo 18:00-02:00; Tu-Th 18:00-03:00; Fr-Sa 18:00-04:00; CLUB: Tu-Th 20:00-03:00; Fr-Sa 20:00-04:00 -> Tu-Th 20:00-03:00 open "Club and bar"; Fr-Sa 20:00-04:00 open "Club and bar" || Su-Mo 18:00-02:00 open "bar" || Tu-Th 18:00-03:00 open "bar" || Fr-Sa 18:00-04:00 open "bar"
  • Su-Th 11:00-03:00; Fr-Sa 11:00-05:00 -> Su-Th 11:00-03:00, Fr-Sa 11:00-05:00 See last example
  • Mo-We 17:00-01:00; Th,Fr 15:00-01:00; PH,Sa,Su off -> Mo-We 17:00-01:00, Th,Fr 15:00-01:00; PH off. Use additional rules. You can not say "Sa,Su off" because that would set the time "Sa 00:00-01:00" to closed.

グレゴリオ暦以外について

There has been some discussion about how to map non-gregorian calendars ( “Opening hours syntax for non Gregorian calendar”. 17 May 2019.  ).

実装

JavaScript

JavaScript implementation by User:Ypid:

Java

PHP

OsmAnd

OsmAnd 2.0 showing whether the POI is known to be open or closed based on tagging of opening_hours. For example, the my daBBA restaurant was closed when the screenshot was taken; however, Sugran Swayapakghar was open.

OsmAnd uses this tag on the POI search screen. The implementation now includes more values (such as months and dates), added together with conditional restriction support.

Opening hours for Ulm, Neu-Ulm & surroundings

Ulm, Neu-Ulm and surrounding areas.

The web application is available on http://ulm-oeffnungszeiten.creal.de. Opening hours for the local area are visualized on a map. The source code of this application is freely licensed and available via GitHub. Adapting the application to a different city is very easy and described on the GitHub page.

More maps and applications

Web apps:

Mobile Apps:

  • My Opening Hours for Android devices
  • Vespucci, full featured OSM editor for Android that includes special opening hours interface that includes support for highly complicated opening hours
  • StreetComplete, newbie friendly OSM editor that allows to collect, among other data, opening hours info.

Tools:

  • statistics Visualization of the data quality and growth over time.
  • YoHours カレンダー上で時間をドラッグするだけで opening_hours を作れるウェブサイトです。


レンダリング

In the case of 24/7 it can be something like adding a 24 to the object icon.

Pharmacy dispencing 24.png

The rest of values have no obvious rendering and may be accessed with context menu or alike.

以前の非推奨になったタグ

The following (undocumented) keys have been deprecated and should be replaced by this opening_hours=*. Their value should be interpreted to set the value of the new key, as described above:

条件付き制限 も参照してください。

関連項目

類似のタグ

脚注

  1. 1.0 1.1 The default holidays can be added to opening_hours.js. There is an alternative system for default values which is currently not evaluated by opening_hours.js: Default is a proposal for a default values system. This proposal can set default values such as maxspeed for areas (countries, states...) but also holidays periods. A country, a zone area can subscribe to a default containing such holidays definitions.