Socket
Book a DemoInstallSign in
Socket

raster-streamlines

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raster-streamlines

Generates stramlines as a GeoJSON from a raster field

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
5
150%
Maintainers
1
Weekly downloads
 
Created
Source

raster-streamlines

Convert a vectorial raster field into streamlines. The output is in a convenient GeoJSON format compatible with d3js mapping.

INSTALL

To use with npm, just type

npm install raster-streamlines

USAGE

To create the streamlines, a vectorial field is needed:

var srteamlines = require("raster-streamlines");
var properties = srteamlines.streamlines(u, v, geotransform, density, flip);
  • u is the speed in the x coordinates, where positive numbers go from right to left, as in the wind conventions
  • v is the speed in the x coordinates, where positive numbers go from lower to upper, as in the wind conventions
  • u and v must have the same dimensions, obviously
  • geotransform is a six elements array, as defined in the gdal library. It's an optional parameter, the array position coordinates are used if the array is not given
  • density is an optional parameter that changes the number of streamlines. When is 1 (default), the number is aprox. 60. If lower than 1, the lines will be fewer
  • flip is an optional parameter to change the v speed direction if set to true

When using directly in HTML, use the rastertools as the namespace

rastertools.streamlines(u, v, geotransform, flip);

EXAMPLE

See this block for a real world usage.

Keywords

raster

FAQs

Package last updated on 02 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.