OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
weather_city_hit.hpp
1// SPDX-FileCopyrightText: 2026 Mark G. Russell
2// SPDX-License-Identifier: MIT
3#pragma once
4
5#include <string>
6
7// Match actual rendered weather features rather than a geographic proximity guess.
8template <typename Properties>
9std::string weatherCityHitId(const Properties& properties) {
10 const auto city = properties.find("weather_city_id");
11 if (city == properties.end() || !city->second.template is<std::string>())
12 return {};
13 const auto identity = city->second.template get<std::string>();
14 return identity.rfind("weather-city:", 0) == 0 ? identity : std::string{};
15}