Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Straight-forward API server to convert rain area radar images (Singapore) to GeoJSON

NotificationsYou must be signed in to change notification settings

cheeaun/rain-geojson-sg

Repository files navigation

Straight-forward API server to convert rain area radar images (Singapore) to GeoJSON.

Convert rain area radar image 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 intoMultiPolygons. 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.

🚧 UPDATE: GeoJSON output is not used anymore 🚧


🚧 Current root (/) API calls runs onmicro 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.

Technicalities

Node.js andVercel is required to run this server. These are the commands:

  • npm i - install all dependencies
  • npm run dev - run a development server
  • npm start - run a production server
  • vercel 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.

Copyright/License


[8]ページ先頭

©2009-2025 Movatter.jp