OpenWeatherMap-PHP-API
OpenWeatherMap-PHP-API copied to clipboard
Feature request: wind in km/hour instead of m/s
In Europe, we tend to say "20 km/hour" when talking about wind speed, not meters/second. It might be a valuable addition to get the speed in km's?
I am not sure whether or not something like this should be part of the library. The Celsius / degree fix is done to normalise the API. A conversion would however add additional logic. I might consider to add it through an additional static class like UnitConverter, which might take a unit object as an argument and a target unit string as second parameter. How does that sound?
At this moment I had written my own conversion, but that feels like a hack. The ideal case would be to have it in the API's response but that's unlikely to happen. Second best to me would be a UnitConverter class like you mentioned, but included in your library. If you consider this to be an edge case, I'll keep my own conversion logic in my code. I guess it's up to you to decide if this would serve your library or not!
I'd find this quite useful! :+1:
In Russia we tend to say "20 m/s" when talking about wind speed.
"Own conversion" (m/s to km/h vice versa) is not a hack.