refactor(normalizers): deduplicate synthetic station ID generation
- Add common SynthStationID helpers for coordinate-based providers - Use shared helper for Open-Meteo and OpenWeather station ID synthesis - Require both lat/lon when generating synthetic IDs to avoid misleading defaults - Remove unused Open-Meteo normalizer wrapper code This reduces cross-provider duplication while keeping provider-specific mapping logic explicit and readable.
This commit is contained in:
@@ -56,14 +56,11 @@ func roundValue(v reflect.Value, decimals int) reflect.Value {
|
||||
out.Set(elem)
|
||||
return out
|
||||
}
|
||||
if elem.IsValid() && elem.Type().AssignableTo(v.Type()) {
|
||||
out.Set(elem)
|
||||
return out
|
||||
}
|
||||
if elem.IsValid() && elem.Type().ConvertibleTo(v.Type()) {
|
||||
out.Set(elem.Convert(v.Type()))
|
||||
return out
|
||||
}
|
||||
|
||||
// If we can't sensibly re-wrap, just keep the original.
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user