Skip to content

Opening hours resurvey#6492

Merged
westnordost merged 14 commits into
streetcomplete:masterfrom
paulklie:opening_hours_resurvey
Sep 30, 2025
Merged

Opening hours resurvey#6492
westnordost merged 14 commits into
streetcomplete:masterfrom
paulklie:opening_hours_resurvey

Conversation

@paulklie

@paulklie paulklie commented Sep 11, 2025

Copy link
Copy Markdown
Collaborator

Based on the discussion in #6465.
It changes two things:

  1. It removes the name/brand requirement for the elements that only get resurveyed. In effect this only applies to leisure = park and amenity=charging_station since the other elements are already excluded from the name filter. This does not affect any of the other places that we add opening hours for.
  2. I also added these elements to the resurvey filter:
leisure ~ garden|beach_resort|sports_centre|disc_golf_course|nature_reserve|playground|fitness_station
or tourism = attraction
or amenity ~ place_of_worship|parking|research_institute|shower|grave_yard|kitchen|marketplace
or railway = station
or aeroway = terminal
or man_made = observatory

Thus we only ask for them if they already have (potentially out of date) opening_hours tagged.
These all seem like places that may have opening hours but commonly but also might not have them, so surveying them for elements where opening_hours is not set seems spammy.
All of these places seem to me like places that are unlikely to be confused, so a name is not required to correctly identify them because they are either: large enough so that they can be clearly identified even with inaccurate GPS or rare enough so that they are very unlikely to be close to each other.
3. I have removed a duplicate filter: We filter for name / brand twice, once in the filter and once with the hasName function. The former allowed noname = yes while the latter does not. This gets rid of code duplication and inconsistency. Instead we only use the filter.
4. I added additional tests to verify the functionality.

@paulklie paulklie changed the title WIP: Opening hours resurvey Opening hours resurvey Sep 13, 2025
@paulklie paulklie marked this pull request as ready for review September 16, 2025 23:35
@westnordost

Copy link
Copy Markdown
Member

Did you change the indentation? This makes it hard to see the changes in a review.

@paulklie

paulklie commented Sep 17, 2025

Copy link
Copy Markdown
Collaborator Author

Did you change the indentation? This makes it hard to see the changes in a review.

Hard to avoid, I had to change the indentation level for most of the filter to adapt to the new logic.
But this view makes it clearer: https://github.com/streetcomplete/StreetComplete/pull/6492/files?diff=split&w=1

@westnordost westnordost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that now the getFeature field is unused for this class, right? Then, it should be removed.

class AddOpeningHours(
    private val getFeature: (Element) -> Feature?
) : OsmElementQuestType<OpeningHoursAnswer>, AndroidQuest {

@paulklie

Copy link
Copy Markdown
Collaborator Author

I believe that now the getFeature field is unused for this class, right? Then, it should be removed.

class AddOpeningHours(
    private val getFeature: (Element) -> Feature?
) : OsmElementQuestType<OpeningHoursAnswer>, AndroidQuest {

done!

@westnordost

Copy link
Copy Markdown
Member

Right, thanks! LGTM

@westnordost westnordost merged commit 667e106 into streetcomplete:master Sep 30, 2025
leisure ~ park|garden|beach_resort|sports_centre|disc_golf_course|nature_reserve|playground|fitness_station
or barrier
or tourism = attraction
or amenity ~ toilets|bicycle_rental|charging_station|place_of_worship|parking|research_institute|shower|grave_yard|kitchen|marketplace

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any specific reason why amenity=grave_yard got added and landuse=cemetery is not present?

I am also thinking about extracting this set from megastring into another dictionary, though I admit that primary reason would be to make it parsable in my little tool
maybe that is a really bad reason for changing format here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, I just did not even consider cemetery (did not know there was a distinction). Extracting sounds good though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants