Skip to content

Web service to expose GRIB2 GFS wind forecast data as pre-formatted JSON

License

Notifications You must be signed in to change notification settings

AndresHerrera/wind-server

 
 

Repository files navigation

Wind Server

Simple REST web service to expose GRIB2 GFS wind forecast data (0.5 or 1 degree resolution, 6 hourly from NOAA) as pre-formatted JSON. It is usually consumed by leaflet-velocity or wind-layer.

It relies on the grib2json CLI for data conversion. The 0.8 version of the converter is embedded in the project, if you want to use your own simply define the GRIB2JSON environment variable pointing to your grib2json command in the execution context.

Adapted from the wind-server fork of wind-js-server.

Build and Run

Docker

# Build docker image
$ docker build -t wind-server .

# Run container
$ docker run --name windserver -d -p 7000:7000 wind-server

Node

# Install dependencies
$ npm install

# Start
$ npm start

Launch options

The following environment variables can be used to customize behaviour:

Variable Description Default Options
PORT The port the server will listen on 7000 Port number
RESOLUTION Requested GFS data resolution 0.5 0.5, 1
WIND Enable the download of wind data true true, false
TEMP Enable the download of temperature data false true, false

Endpoints

  • /latest returns the most up to date JSON data available
  • /nearest returns JSON data nearest to requested
    • $GET params:
      • timeIso an ISO timestamp for temporal target
      • searchLimit number of days to search beyond the timeIso (will search backwards, then forwards)
  • /alive health check url, returns simple message

License

MIT License (MIT)

About

Web service to expose GRIB2 GFS wind forecast data as pre-formatted JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.3%
  • Dockerfile 5.1%
  • Batchfile 2.1%
  • Shell 1.5%