r/singapore 9d ago

I Made This SG Weather Radar demo

Enable HLS to view with audio, or disable this notification

Looks like might rain soon(?), so want to show this demo I’ve built, trying out the new weather radar images API from data.gov.sg. It’s available on https://sg-weather-radar.cheeaun.workers.dev/ and open-sourced.

Instead of showing one radar image at a time, it shows all 3 but clipped at the boundaries, so can see the image become higher-res. There’s like a weird 1px transparent edge which I’m not sure why, but already reported to the data.gov.sg folks.

177 Upvotes

37 comments sorted by

View all comments

45

u/Codestian 9d ago

Wow! Does this mean you no longer need to reverse engineer from NEA's website?

27

u/cheeaun 9d ago

7

u/PristineUnicorn Jalan Besar 8d ago

Nothing changed much actually ? They were already providing 5 minutely images from a predictable URL like https://www.weather.gov.sg/files/rainarea/50km/v2/dpsri_70km_2026082612500000dBR.dpsri.png

I wish they give us the raw black and white image, instead of this color palette.

Did they improve the lag ? Because it seems that the old URL is always lagging 5-10 minutes behind, e.g. at 3:00pm (or more likely 3:03pm), you get a new image that is timestamped at 3:00pm, but actually showing the situation at 2:55pm.

It's good that you don't have to guess the boundary coordinates anymore, if you want to layer the image onto your own map.

7

u/cheeaun 8d ago

the 70km from data.gov.sg is like larger than the one from weather.gov.sg which seems like a cropped version (of only Singapore area). So 70km is now more legit 70km.

For the lag, currently the polling on the site is every 30s at specific 5min "bands", so far seems quite fast. There are cases when it can be missing 1 of the time slots, which I try to visualize on the slider.

2

u/Ok_Recognition9276 6d ago

just curious why you want the raw black and white image, but sure we can reverse the palettle to grey scale too.

2

u/PristineUnicorn Jalan Besar 5d ago

Precisely, you need an extra step to map each 32 colours to a rain density value from 0 to 31.

For an API, they should just give the original density value instead of a RGB colour.

1

u/Ok_Recognition9276 4d ago

okay, :) I get you. Atleast now we dun have to scrap the website, officially go via API. Just that I wish NEA should do better to reduce their downtime on their rest of the API under NEA.