OpenWeatherMap-PHP-API icon indicating copy to clipboard operation
OpenWeatherMap-PHP-API copied to clipboard

Feature request: wind in km/hour instead of m/s

Open iamgoodbytes opened this issue 9 years ago • 4 comments

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?

iamgoodbytes avatar Jul 14 '15 10:07 iamgoodbytes

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?

cmfcmf avatar Jul 14 '15 17:07 cmfcmf

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!

iamgoodbytes avatar Jul 15 '15 09:07 iamgoodbytes

I'd find this quite useful! :+1:

Kickball avatar Jan 06 '16 19:01 Kickball

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.

KarelWintersky avatar Feb 14 '19 11:02 KarelWintersky