jdemaeyer / brightsky

JSON API for DWD's open weather data.
https://brightsky.dev/
MIT License
290 stars 18 forks source link

DWD locations. #116

Closed poetaster closed 3 years ago

poetaster commented 3 years ago

Ahoi! I downloaded the weather stations from the DWD to have a more complete list and found it diverges from your list. For instance, you have Berlin-Tempelhof which is not even in the list I get. Between Berlin-Tegeler Fliesstal and Berlin-Weissensee, de nada.

I'm assuming I'm using the 'wrong' sources. I posted my json version at: https://poetaster.de/stations.json derived from: https://www.dwd.de/DE/leistungen/klimadatendeutschland/statliste/statlex_html.html

Presumably, the list changes as stations come online/offline?

How / Where should I retrieve the full set? Or does it matter since I'm passing lat/lon anyway?

jdemaeyer commented 3 years ago

Heyho @poetaster! The DWD list that you posted does contain Berlin-Tempelhof, maybe there's a mistake in how you're parsing it? image

If you're interested in a list of all Bright Sky sources, you can play around with the /sources endpoint, setting max_dist to 500000 (i.e. 500 km) and lat/lon to a bunch of points throughout Germany, e.g. use

https://api.brightsky.dev/sources?lat=51.55&lon=9.9&max_dist=500000

to retrieve all sources in a 500 km radius around beautiful Göttingen (:heart:). Note that sources are not the same as stations: most real-world weather stations correspond to multiple sources, one for historical records, one for current weather records, and one for forecasts; on the other hand, many sources do not correspond to any real-world station at all (they are "virtual stations" only present in forecasts).

How / Where should I retrieve the full set? Or does it matter since I'm passing lat/lon anyway?

If you're only interested in weather for a particular location, you don't need to worry about sources and stations at all. Just pass lat/lon and Bright Sky will automatically select the most appropriate source (or often, multiple sources).

Hope that helps :)

poetaster commented 3 years ago

Hmm. I must have screwed up in the json conversion.

https://api.brightsky.dev/sources?lat=51.55&lon=9.9&max_dist=500000

Is just what I was looking for! I need to allow people to search by geographical means anyway, but this simplifies live a lot!

Thanks!