[generator] Add check_date and variants

Includes survey:date and check_date:opening_hours
Only apply to amenity and shop types for now

[generator] Add check_date to further types

[generator] Improve date validation

Check if it can be parsed to a proper date

Signed-off-by: Eivind Samseth <eisa01@gmail.com>
This commit is contained in:
Eivind Samseth
2025-08-01 21:37:52 +02:00
committed by x7z4w
parent b096199695
commit 04246a55f2
7 changed files with 66 additions and 2 deletions

View File

@@ -267,6 +267,8 @@ public:
string const denomination(meta.Get(feature::Metadata::FMD_DENOMINATION));
string const wheelchair(GetWheelchairType(f));
string const opening_hours(meta.Get(feature::Metadata::FMD_OPEN_HOURS));
string const check_date(meta.Get(feature::Metadata::FMD_CHECK_DATE));
string const check_date_opening_hours(meta.Get(feature::Metadata::FMD_CHECK_DATE_OPEN_HOURS));
string const wikipedia(meta.Get(feature::Metadata::FMD_WIKIPEDIA));
string const wikimedia_commons(meta.Get(feature::Metadata::FMD_WIKIMEDIA_COMMONS));
string const panoramax(meta.Get(feature::Metadata::FMD_PANORAMAX));
@@ -277,7 +279,7 @@ public:
vector<string> columns = {
osmId, uid, lat, lon, mwmName, category, name, std::string(city),
addrStreet, addrHouse, phone, website, stars, std::string(metaOperator), internet,
denomination, wheelchair, opening_hours, wikipedia, floor, fee, atm, contact_facebook,
denomination, wheelchair, opening_hours, check_date, check_date_opening_hours, wikipedia, floor, fee, atm, contact_facebook,
contact_instagram, contact_twitter, contact_vk, contact_line, contact_fediverse, contact_bluesky, wikimedia_commons, panoramax};
AppendNames(f, columns);
@@ -290,7 +292,7 @@ void PrintHeader()
vector<string> columns = {"id", "old_id", "lat", "lon", "mwm",
"category", "name", "city", "street", "house",
"phone", "website", "cuisines", "stars", "operator",
"internet", "denomination", "wheelchair", "opening_hours", "wikipedia",
"internet", "denomination", "wheelchair", "opening_hours", "check_date", "check_date_opening_hours", "wikipedia",
"floor", "fee", "atm", "contact_facebook", "contact_instagram",
"contact_twitter", "contact_vk", "contact_line", "contact_fediverse", "contact_bluesky", "wikimedia_commons", "panoramax"};
// Append all supported name languages in order.