Getting reading from closest station to location in latitude, longitude
Closed this issue · 1 comments
IvanNik17 commented
Hi,
I am trying to get data from the API. I can get queries, but I want to get the weather data from a weather station closest to specific coordinates that I give? Is that currently possible
LasseRegin commented
Hi @IvanNik17
You could get the closest weather station by calculating the haversine distance between your coordinates and all the station locations and finding the lowest (closest) one. I have added a function get_closest_station(latitude, longitude)
which can be used for this. Please see version 0.0.3
.
Note: This can be implemented more efficient but in order to prevent any unnecessary dependencies I have just used the built-in math
library.