开放街图营业时间编辑器
OpenStreetMap 营业时间规范相当复杂,并不易于一个简单直观的使用者介面。
然而大部分的时候,你应该只会用到一小部分的定义。编辑器尝试在选单中隐藏更加难懂的功能,来达成这一点,大部分的时候减少“路上”设定,尽可能用预先设定的模版,加以小量修改。
本文档是早期文档,正在开发中
使用开放街图编辑器
在一般的工作流程中,你编辑的物件一般已经有开放时间的标签 (opening_hour、service_times 和 colllection_times),或是你可以重新设定物件的预设组合,用空白的开放时间栏位。如果你需要手动输入栏位,像是用 Vespucci,你可以在详情页面输入关键值,之后切换回栏位页签继续编辑。如果你相信开放时间标签必须多于预设组合的话,请在你的编辑器开启 issue。
If you have defined a default template (do this via the "Manage templates" menu item) it will be loaded automatically when the editor is started with an empty value. With the "Load template" function you can load any saved template and with the "Save template" menu you can save the current value as a template. You can define separate templates and defaults for specific key, for example "opening_hours", "collection_times" and "service_times" or custom values. Further you can limit applicability of a template to a region and a specific identifier, typically an OSM top-level tag (for example amenity=restaurant).
当然,您可以从头开始构建营业时间的值,但我们建议使用现有的模板之一作为开始。
如果已经有营业时间的数值则会载入,另外会自动修正以符合营业时间规范。如果无法修正,则会在大概的位置显示错误讯息,原始的营业时间数值,等待人工修正。开放街图资料库中有大约1/4的营业时间数值有问题,但只有少于10%的状况是无法修正。详见 OpeningHoursParser,并且看有那些允许的规范变体。
主菜单按键
- 添加规则:添加新规则。
- 为假期添加规则:当国家/地区改变时为假期添加新规则
- 为 24/7 增加规则:为总是开放的物件增加规则,开放时间规范不支持任何其他子值为24/7,但我们允许增加更高阶的选择器 (例如年份范围)。
- Load template:加载现有模板。
- 保存到模板:将当前的营业时间值另存为模板,以作为备份为将来使用。
- 管理模板:编辑(例如更改名称)并删除现有模板。
- 刷新:重新加载营业时间值。
- 全部删除:删除所有规则
规则
默认规则被添加为_normal_规则,这意味着它们将在同一天覆盖先前规则的值。在指定延长时间时中,可能会出现一个问题,通常您随后会希望通过_Show rule type_菜单项将规则切换为_additive_。
规则菜单
- 添加修饰符/注释:更改此规则的效果并添加可选注释。
- 添加假期:为公共或学校假期添加选择器。
- 增加时间跨度...
- 时间-时间:同一天的开始时间到结束时间。
- 时间-延长时间:第二天的开始时间到结束时间(例如26:00是第二天的凌晨02:00)。
- 变化时间-时间:从开始可变时间(黎明,黄昏,日出和日落)到同一天的结束时间。
- 变化时间-延长时间:从开始变化时间到第二天的结束时间。
- 时间-变化时间:开始时间到结束变化时间。
- 变化时间-变化时间:从开始变化时间到结束变化时间。
- 时间:一个时间点。
- 开放时间:从某个时间点开始。
- 变化时间:特定的变化时间
- 变化时间 - 一直持续:从变化时间到一直持续
- 增加工作日范围:添加基于工作日的选择器。
- 增加日期范围...
- 日期-日期:从开始日期(年,月,日)到结束日期。
- 变化日期-日期:从开变化变日期(当前规范仅定义_easter_)到结束日期。
- 日期-变化日期:从开始日期到变化日期
- 变化日期-变化日期:从开始变化日期到结束变化日期
- 每月发生-每月发生:一个月中从开始的周间是相同的。
- 日期- 每月发生:一个月中周间发生,到特定日期结束
- 日期-发生在月份:从开始日舒到一个月中的周间结束。
- Occurrence in month - variable date: from a start weekday occurrence in a month to an end variable date.
- Variable date - occurrence in month: from a start variable date to an end weekday occurrence in a month.
- Date - open end: from a start date onwards.
- Variable date - open end: from a start variable date onwards.
- Occurrence in month - open end: from a start weekday occurrence in a month onwards.
- With offsets...: the same entries as above however with offsets specified (this is rarely used).
- Add year range...
- Add year range: add a year based selector.
- Add starting year: add an open ended year range.
- Add week range: add a week number based selector.
- Duplicate: create a copy of this rule and insert it after the current position.
- Show rule type: display and allow changing of the rule type normal, additive and fallback (not available on the first rule).
- Move up: move this rule up one position (not available on the first rule).
- Move down: move this rule down one position.
- Delete: delete this rule.
Time spans
To make editing time spans as easy as possible, we try to choose an optimal time range and granularity for the range bars when loading existing values. For new time spans the bars start at 6:00 (am) and have 15 minute increments, this can be changed via the menu.
Clicking (not on the pins) the time bar will open the large time picker, when using the bars directly is too difficult. The time pickers extend in to the next day, so they are a simple way to extend a time range without having to delete and re-add the the range.
Time span menu
- Display time picker: show a large time picker for selecting start and end time, on very small displays this is the preferred way of changing times.
- Switch to 15 minute ticks: use 15 minute granularity for the range bar.
- Switch to 5 minute ticks: use 5 minute granularity for the range bar.
- Switch to 1 minute ticks: use 1 minute granularity for the range bar, very difficult to use on a phone.
- Start at midnight: start the range bar at midnight.
- Show interval: show the interval field for specifying an interval in minutes.
- Delete: delete this time span.
Manage templates
The template management dialog allows you to add, edit and delete templates.
In Android 4.4 and later the following additional functionality is available from the menu button.
- Show all: display all templates in the database.
- Save to file: write the contents of the template database to a file.
- Load from file (replace): load templates from a file replacing the current contents of the database.
- Load from file: load templates from a file retaining the current contents.
Save and edit template dialogs
The dialog allows you to set
- Name a descriptive name for the template.
- Default if checked this will be consider as a default template (typically further constrained by the other fields).
- Key the key this template is relevant for, if set to Custom key you can add a non-standard value in the field below. The key values support SQL wild cards, that is % matches zero or more characters, _ matches a single character. Both wild card characters can be escaped with \ for literal matches.
- Region the region the template is applicable to.
- Object an application specific string to use for matching.