All Projects → nickcam → AnimatedEnvironmentLayer

nickcam / AnimatedEnvironmentLayer

Licence: other
A custom arcgis js api layer to display GRIB data formatted as json as animated particles on a canvas

Programming Languages

typescript
32286 projects
HTML
75241 projects

Projects that are alternatives of or similar to AnimatedEnvironmentLayer

wind-js-server
Service to expose Grib2 wind forecast data as JSON
Stars: ✭ 98 (+139.02%)
Mutual labels:  weather, grib, wind
leaflet-velocity
Visualise velocity data on a leaflet layer
Stars: ✭ 467 (+1039.02%)
Mutual labels:  weather, velocity, wind
grib
Golang GRIB2 parser
Stars: ✭ 41 (+0%)
Mutual labels:  weather, grib
DirectionalLineSymbol
ArcGIS javascript custom Line Symbol. Subclass of SimpleLineSymbol to display direction markers on line symbols.
Stars: ✭ 42 (+2.44%)
Mutual labels:  arcgis, esri-jsapi
gis4wrf
QGIS toolkit 🧰 for pre- and post-processing 🔨, visualizing 🔍, and running simulations 💻 in the Weather Research and Forecasting (WRF) model 🌀
Stars: ✭ 137 (+234.15%)
Mutual labels:  weather, grib
grib-rs
GRIB format parser for Rust
Stars: ✭ 23 (-43.9%)
Mutual labels:  weather, grib
gribr
GRIB interface for R using ECMWF ecCodes
Stars: ✭ 18 (-56.1%)
Mutual labels:  weather, grib
WorldWeather
The largest three-dimensional web-based interactive browser of satellite, weather, climate, and other time-aware geospatial data on the web, built upon NASA's revolutionary WorldWind technology.
Stars: ✭ 49 (+19.51%)
Mutual labels:  weather, wind
Flutter weather
An elegant, easy on the eyes weather app built with flutter
Stars: ✭ 193 (+370.73%)
Mutual labels:  weather
Wttr.in
⛅ The right way to check the weather
Stars: ✭ 16,345 (+39765.85%)
Mutual labels:  weather
Weather App React Native
The source code of react-native weather app
Stars: ✭ 176 (+329.27%)
Mutual labels:  weather
Good Weather
Open source weather app for Andorid
Stars: ✭ 198 (+382.93%)
Mutual labels:  weather
Ruby Scripts
A collection of ruby scripts for those who live in the command line
Stars: ✭ 234 (+470.73%)
Mutual labels:  weather
Homebridge Weather Plus
A comprehensive weather plugin for homebridge.
Stars: ✭ 176 (+329.27%)
Mutual labels:  weather
mpxday
mpxday是基于mpx开发的天气预报微信小程序
Stars: ✭ 3 (-92.68%)
Mutual labels:  weather
Forecastio
A Swift library for the Forecast.io Dark Sky API
Stars: ✭ 164 (+300%)
Mutual labels:  weather
Minimalistweather
Android 平台开源天气 App,采用 MVP、RxJava、Retrofit2、OKHttp3、Dagger2、RetroLambda 等开源库来实现。
Stars: ✭ 2,411 (+5780.49%)
Mutual labels:  weather
Openweathermap
Go (golang) package for use with openweathermap.org's API.
Stars: ✭ 161 (+292.68%)
Mutual labels:  weather
Datweatherdoe
Simple menu bar weather app for macOS
Stars: ✭ 209 (+409.76%)
Mutual labels:  weather
Marquee Scroller
Marquee Scroller Clock News Weather and More
Stars: ✭ 211 (+414.63%)
Mutual labels:  weather

AnimatedEnvironmentLayer

Supports arcgis-js-api v4.21. See the branches for code that supoprts older api versions.

An arcgis js api layer that can display data from GRIB2 files as animated particles. Uses a canvas to render the particles.

Demo page here: http://animatedenvironmentlayer.azurewebsites.net/index.html

GRIB files are a common format for meteorologcical data. See here for more info: https://en.wikipedia.org/wiki/GRIB.

Things such as wind, currents, waves etc can be modelled, anything with a velocity and direction. There's two wind files and one wave file used as test data included in the repo.

You can use grib files that contain a direction and velocity set of data. Standard use is wind data that has u and v components, but you can use a number of different grib types as long as one is direction and one is velocity and it will convert them to u and v datasets. See the swell dataset for an example of this.

Supports scan mode 0 and 64.

The layer requires the GRIB files to be converted to json for use. This tool is used to do that conversion: https://github.com/cambecc/grib2json

Has lots of options for flexible drawing. The global wind 2 option in the demo that is also in this repo has examples on how to use the more complex options. Here's the display options api that can be set to change the particle display. Best bet is to just look at the code in the repo though.

/** 
    The available display options to change the particle rendering
*/
export interface DisplayOptions {

    /**
     * Minimum velcity that will applied to a particle
     * default: 0
     * */
    minVelocity?: number;

    /**
     * Maimum velocity that will be applied to a particle
     * default: 10
     * */
    maxVelocity?: number;

    /**
     * Determines how quickly the particle moves based on it's velocity. Higher values mean faster moving.
     * default: 0.005
     * */
    velocityScale?: number;

    /**
     * The number of frames a particle will live for.
     * default: 90
     * */
    particleAge?: number;


    /**
     * The number of particles per 50x50 pixel block.
     * If a number that density is applied across the board. 
     * If a DensityStop[] declare the zoom level and density that would you like to apply in each entry. Start with higher zoom first eg: [{ zoom: 2, density: 10 }, { zoom: 5, density: 8 }, {zoom: 6, density: 7}]
     * default: 10
     * */
    particleDensity?: number | DensityStop[];


    /**
     * The frame rate to use when animating. If the velocityScale parameter is higher then this will need to be increased to keep up with the required frames to draw the particles at a quicker speed. 
     * If it's not a high enough value the animations could appear jumpy.
     * default: 15
     * */
    frameRate?: number;

    /**
     * An array of color values to use. Velocity values will be mapped to this color scale.
     * default: ["rgb(61,160,247)", "rgb(99,164,217)", "rgb(138,168,188)", "rgb(177,173,158)", "rgb(216,177,129)", "rgb(255,182,100)", "rgb(240,145,87)", "rgb(225,109,74)", "rgb(210,72,61)", "rgb(195,36,48)", "rgb(180,0,35)"];
     * */
    colorScale?: string[];

    /**
     * The width of the line for default rendering.
     * default: 1
     * */
    lineWidth?: number;

    /**
     * An amount to reduce particle numbers by on mobile devices
     * default: (Math.pow(window.devicePixelRatio, 1 / 3) || 1.6)
     * */
    particleReduction?: number;

    /** 
     * A function that if exists will be called in the draw method that allows for specific code to be run for the fading out part of the drawing. 
     * */
    customFadeFunction?: CustomFadeFunction; 

    /**
     * A function that if exists will be called to draw the particles. Allows for caller to have complete control over drawing. Will pass the context, particle object and the color style. 
     * */
    customDrawFunction?: CustomDrawFunction;
}

Credit

This is essentially an arcgis and typescript port of this awesome project -

https://github.com/danwild/leaflet-velocity, so check that out.

That project takes inspiration from the following two projects which are well worth checking out as well!

https://github.com/Esri/wind-js

https://github.com/cambecc/earth

@danwild also has this project which could help with downloading new data files.

https://github.com/danwild/wind-js-server

Usage

If you want to run it locally just download or clone the repo and run

npm install

then

npm start

The reload server will spin up an instance on localhost:8080

There's no npm package so if you want to add it to your project there's two options.

  • Grab the ts file typescript/animatedEnvironmentLayer.ts and place it somewhere in your project so it will be compiled along with the rest of your project. You'll also need @types/arcgis-js-api and the dojo typings included.

  • Alternatively grab the already compiled ael/animatedEnvironmentLayer.js and reference it like the other javascript esri amd modules.

There's no @types package for dojo v11.x yet, but there is an npm package 'dojo-typings'. Even the dojo-typings package doesn't go as high as 1.12.x which arcgis now uses. Had to just include a reference to the dojo types in a custom index.d.ts file.

Notes

Doesn't work with 3d yet...will work on it as I'd like 3d support. I'm no expert with webgl though so it could be a while, if ever. Help is welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].