Open ltog opened 5 years ago
Just avoid a misunderstanding you can store any number of custom/private templates in the current implementation, what you can't do is associate them with a specific preset/top level key.
@simonpoole: I've never done it, but I guess it's not what I (and probably other users) want/need: These "profiles" I talk about should be transparently available to every user, not just me. If they don't pay close attention to the exact hours, they wouldn't even notice this feature.
I liked those few instances where the hours in the template matched a given object and my proposal would increase the chances of this happening.
The current way of working would be to walk up to say a bank, load an exiting template or build a spec from scratch and then, deciding it is typical for a bank, save it as a template giving it a descriptive name. With other words you build the set of best suiting presets as you go along.
Naturally semi-automatically preselecting specific templates is clearly a possibility. As said we already provide this for opening_hours vs. service_times vs. collection_times. The problem with doing this based on "object type" is that it is not so well defined as one might assume and in the end boils down to matching against a preset item or at least against a list of multiple tags for a specific object.
In any case I'll give it some thought (importing and exporting templates is something that got dropped from the initial release but is still something I would want to do that belongs in this context too).
@simonpoole : For the sake of completeness, here my idea of the workflow:
User walks around to go for a little mapping tour -> user finds a certain type of POI, lets say a bank -> user tags the object as amenity=bank
-> user wants to add opening hours and opens the opening hours dialog -> user chooses a template, e.g. "Weekdays with lunch breaks" -> the user sees a pre-filled opening hours entry.
Important: This entry corresponds to the typical/most often used opening hour of a bank in this region that is open on weekdays and has lunch breaks.
To be able to make such a suggestion, one needs to do a statistical analysis beforehand:
amenity=*
with defined opening hours, services times, etc.)amenity=*
, maybe subgroups for different additional tags)Basic support for the fields in the template database added in https://github.com/simonpoole/OpeningHoursFragment/commit/4482ab2c153a5d707fc235d6d26711a5bd61ee24
When creating opening hours we can choose from several templates, e.g. "Weekdays with lunch break". These templates use hardcoded values for opening and closing times (defined in https://github.com/simonpoole/OpeningHoursFragment/blob/015d0b49140a24eeb13cd839edca108e2affad32/lib/src/main/java/ch/poole/openinghoursfragment/TemplateDatabaseHelper.java AFAICS).
I'd like to propose a system, where the exact hours are depending on the user's current position (e.g. country) and the type of POI (e.g. bank, restaurant), which the user wants to edit. Rationale: Different types of POIs (e.g. bank and restaurant) likely will have differing opening hours (banks typically are closed at noon and in the evening, while restaurants are not). The exact hours will also depend on local laws and customs, therefore the position of the user should also be considered.
What opening hours should be contained in the templates? We can use existing OSM data to do some data mining and gather the most frequently used combinations. I can assist if wanted...