Straight-forward API server to convert rain area radar images (Singapore) to GeoJSON.
- 50-km radar images: Weather.gov.sg
- 70-km radar images: MyENV apps
- Radar images are generated every 5 minutes.
- Raster image is converted to GeoJSON, pixel by pixel. From pixels to polygons.
- Polygons in GeoJSON are grouped by color/intensity into
MultiPolygon
s. Adjacent polygons are unioned/combined. - Intensity values are improvised to be 0-100. These may not be standard/scientific values. They are reverse-engineered from the rain intensity color scheme (Light → Moderate → Heavy).
- Only the latest GeoJSON data is cached and will updated every few minutes.
🚧 Current root (/
) API calls runs on micro
which is not very "serverless". This endpoint will be deprecated soon.
🚧 A new set of APIs have been added as /api
endpoints which runs better as serverless functions.
Node.js and Vercel is required to run this server. These are the commands:
npm i
- install all dependenciesnpm run dev
- run a development servernpm start
- run a production serververcel dev
- runs local server
The URLs:
/
- return a basic JSON of basic information/now
- return the GeoJSON result of latest radar image
/api/observations
- returns weather observations data (temperature, relative humidity, wind direction, etc)/api/rainarea
- returns precipitation radar data.
- Rain area radar images © Meteorological Service Singapore © National Environment Agency
- Singapore region boundary, under Singapore Open Data License
- Code under MIT.