opening-hours / opening_hours.js

Library to parse and process the opening_hours tag from OpenStreetMap data
https://openingh.ypid.de/evaluation_tool/
222 stars 118 forks source link

Frauentag in Berlin doesn't evaluate as PH? #458

Open tohaklim opened 6 months ago

tohaklim commented 6 months ago

From what I could see in the code, location to be applied to PH/SH evaluation is based on reverse geocoding of coordinates which are fed to Nominatim, not on the hardcoded tag values of the POI itself. Yet when I wanted to check this REWE on 8th March, expecting it to be closed due to PH off, it was shown as open. I played around with the validation, and got eg the following error when inserting SH There are no holidays (SH) defined for country de and state {{state}}.

Does that mean the PH evaluation fails because reverse geocoding can't determine the state, despite having the country?

jaller94 commented 6 months ago

To reproduce:

https://openingh.ypid.de/evaluation_tool/?EXP=Mo-Sa%2007%3A00-23%3A30%3B%20PH%20off&lat=52.55048&lon=13.409781&mode=0&DATE=1709887260000

Yes, Nomatin does not return address.state which is used by the website.

{
  // other attributes
  "address":{
    "city":"Berlin",
    "ISO3166-2-lvl4":"DE-BE",
    "country":"Deutschland",
    "country_code":"de"
  }
}
ypid commented 6 months ago

Frauentag is defined as PH for Berlin.

It is as @jaller94 wrote.

Someone please clarify if that is expected behaviour of Nominatim. If not, this library needs to be updated.