Skip to content
Wind layers for OpenLayers
JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
arrows
src
.babelrc
.eslintignore
.eslintrc.yml
.gitignore
LICENSE-gpl-3.md
LICENSE.md
README.md
arrow-fs8.png
arrow.png
babel.config.js
blog.md
grid.json
interpolate.py
jest.config.js
package.json
u.json
v.json
video.gif
webpack.config.js
white-arrow.png

README.md

OpenLayers wind layers

Goal

Provide:

  • a smooth particules layer animating the movement of the wind;
  • an arrow layer displaying wind force and direction;
  • a gradient layer displaying wind force;

Particles are kept while panning and zooming, contributing to a nice user experience.

It is compatible with OpenLayers 5 and probably OpenLayers 4.

Demo

See https://gberaudo.github.io/olwind

Blog post

See https://github.com/gberaudo/olwind/blob/master/blog.md

Local dev

git clone https://github.com/gberaudo/olwind.git
cd olwind
npm install
npm start

Limitations / Contribution ideas

  • handling map rotation
    • arrows are shifted (OpenLayers bug?);
    • custom layers dimensions is fix;
  • handling soft-zoom
    • when the browser uses softzoom (ctrl + wheel on a DOM element) the WebGL layer is shifted;
  • particle speed changes with resolution, it should be fixed (in pixels / frame);
  • WebGL gradient should use a nicer looking gradient (see OL heatmap);

If you are interested in working on one of these items, create an issue or contact me so that we can discuss it.

Other interesting projects

Custom dataset

If you want to use your own data, you need to provide 3 files:

  • metadata.json
{
  "extent":[576551.1954449099,5667450.411567883,1300927.6096102786,6160637.315193227],
  "width":233,
  "height":347
}

Where:

  • extent: the geographical extent of the dataset;

  • width: the number of columns of the dataset;

  • height: the number of rows of the dataset;

  • u.bin et v.bin the horizontal and vertical speeds as a 32 bit array of floating points. the indices in these files map to the following layout:

    9, 10, 11, 12
    5,  6,  7,  8
    1,  2,  3,  4
    

Licenses

The project is dual licensed:

  • BSD-2 clause for its ease of use and reuse;
  • GPL-3 as a tribute to Richard Stallman's incredible work for liberty.
You can’t perform that action at this time.