wttr.in icon indicating copy to clipboard operation
wttr.in copied to clipboard

Wrong temperature reported when `?format=` is used despite specifying the same GPS coordinates

Open rieje opened this issue 3 years ago • 16 comments

curl 'wttr.in/<GPS coordinates>'
curl 'wttr.in/<same GPS coordinates>?format=%c+%C+%m+%w+%t+%f'

The former reports 24(21) °F and the latter reports ☀️ Clear 🌒 0mph +24°F +20°F. I'm not sure how the "feels like" temperature is not the same (21°F vs 20°F). I've run the commands multiple times at the same time and this is consistent.

UPDATE: Same thing, 3-day weather report shows +44F(41)F for current while formatted one-liner shows +50F(+48F) for current. I am using GPS coordinates to 4 decimal places and %l reports as such. However, when specifying the same coordinates for the weather report, the GPS coordinates are shown to 14 decimal places and shows the my location quite accurately. If I then copy these coordinates back to the one-liner, I'm still getting the same incorrect temperature for the formatted one liner. So it seems parsing the curl one liner is broken.

rieje avatar Mar 05 '22 05:03 rieje

I am not sure about it. I rather would expect that it is a caching problem, and some of the queries are handled from the cache, and some are not. To prove it, please append &nonce=$RANDOM to the query, like this:

curl wttr.in/<LOCATION>?format=<FORMAT>&nonce=$RANDOM

chubin avatar Mar 26 '22 18:03 chubin

curl 'wttr.in/<GPS coordinates>' does not support &nonce=$RANDOM so it's not cached and always accurate?

Anyway, the temperatures are still different--same temperatures are reported below:

curl "wttr.in/<LOCATION>?format=<FORMAT>&nonce=$RANDOM"

and

curl "wttr.in/<LOCATION>?format=<FORMAT>"

rieje avatar Apr 25 '22 03:04 rieje

I also niticed that temperature is differend from what I see online sometimes 3 degrees

Blisk avatar May 08 '22 19:05 Blisk

Theoretically, it is possible that the location is resolved to wrong coordinates. To verify that, specify format=j1 as an argument, and check the coordinates of the nearest_area

chubin avatar Jun 06 '22 11:06 chubin

Unfortunately &nonce=$RANDOM does not produce the correct output either:

curl "wttr.in/Berlin?Q0&nonce=$RANDOM&lang=de&format=3"
Berlin: ☀️   +20°C

curl "wttr.in/Berlin" | head -n 5  
Weather report: Berlin

      \   /     Sunny
       .-.      +29(28) °C     
    ― (   ) ―   ↖ 9 km/h   

I verified that the coordinates are the same. Is there a different way to clear the cache?

ronnyworm avatar Jul 20 '22 08:07 ronnyworm

Yes I tested that too and still temperature varies alot from 2-4 oC and location is valid.

Blisk avatar Jul 20 '22 09:07 Blisk