chubin / wttr.in

:partly_sunny: The right way to check the weather
https://wttr.in
Apache License 2.0
24.01k stars 1.08k forks source link

Querying from my current location returns weather from a different town with the same name #986

Open mschaaf opened 2 months ago

mschaaf commented 2 months ago

I am currently located in "Halle (Saale), Sachsen-Anhalt, Germany" and https://wttr.in returns the weather for "Halle, Nordrhein-Westfalen, Germany"

Update:

curl https://wttr.in/ from a Wi-Fi connection of a local ISP provider in Halle (Saale) returns the weather of Halle (Westfalen) instead of Halle (Saale). The same happens by opening https://wttr.in in a browser. My expectation is that the location chosen is Halle (Saale) as I am currently using a Wi-Fi connection inside the town. wttr.in seems to know the name of the town I am in but does pick the wrong one with the same name.

vitusson commented 2 months ago

curl wttr.in/Halle,Germany?1 Weather report: Halle,Germany

  \   /     Sunny
   .-.      20 °C          
― (   ) ―   ← 22 km/h      
   `-’      10 km          
  /   \     0.0 mm         
                                                   ┌─────────────┐                                                       

┌──────────────────────────────┬───────────────────────┤ Wed 01 May ├───────────────────────┬──────────────────────────────┐ │ Morning │ Noon └──────┬──────┘ Evening │ Night │ ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤ │ \ / Sunny │ \ / Sunny │ \ / Sunny │ \ / Clear │ │ .-. 19 °C │ .-. 22 °C │ .-. 19 °C │ .-. 16 °C │ │ ― ( ) ― ← 26-32 km/h │ ― ( ) ― ← 27-32 km/h │ ― ( ) ― ← 29-49 km/h │ ― ( ) ― ← 23-40 km/h │ │ -’ 10 km │-’ 10 km │ -’ 10 km │-’ 10 km │ │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ └──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘ Location: Halle (Saale), Sachsen-Anhalt, 06108, Deutschland [51.4825041,11.9705452]

mschaaf commented 2 months ago

curl https://wttr.in/ from a Wi-Fi connection of a local ISP provider in Halle (Saale) returns the weather of Halle (Westfalen) instead of Halle (Saale). The same happens by opening https://wttr.in/ in a browser. My expectation is that the location chosen is Halle (Saale) as I am currently using a Wi-Fi connection inside the town. wttr.in seems to know the name of the town I am in but does pick the wrong one with the same name.

vitusson commented 2 months ago

Then the geoiplookup database is wrong, nothing wtrr.in can do about. No wonder if there are like a dozen Halles here in Germany. Just use the right URl and everything is fine…

mschaaf commented 2 months ago

ip2location returns the correct town, state and country and also the correct geo coordinates for my ip.

mschaaf commented 2 months ago

wttr.in does not use the region for Germany. See code in https://github.com/chubin/wttr.in/blob/575908ae51010b2d71c0b1d4bf4def997bea0fa3/lib/location.py#L378