
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
leaflet-raster
Advanced tools
A simple plugin for powerful raster functions.
This plugin makes it easy to add powerful raster processing to your Leaflet map, running directly in the browser. Examples can be hill shading, vegetation index analysis (NDVI for example) and much more.
The plugin by itself is very small and does very little. Its purpose is to function as the glue between Leaflet and powerful libraries like GeoTIFF.js and raster-blaster.
A small example using both GeoTIFF.js and raster-blaster:
import RasterLayer from 'leaflet-raster'
import GeoTIFF from 'geotiff'
import Pipeline from 'raster-blaster/src/pipeline'
import * as PipelineSteps from 'raster-blaster/src/pipeline-steps'
import WebGlRenderer from 'raster-blaster/src/webgl/webgl-renderer'
const pipeline = new Pipeline([
// VARI vegetation index
new PipelineSteps.GrayScale('($g - $r) / ($g + $r - $b)'),
// Stretch histogram to between index 0.2 to 0.8
new PipelineSteps.SmoothstepContrast(0.2, 0.8)
// Map grayscale to color scale Red-Yellow-Green
new PipelineSteps.ColorMap('RdYlGn'),
// Copy alpha band directly to alpha channel
new PipelineSteps.BandsToChannels('a')
],
{
bands: 'rgba',
dataType: 'Uint8'
})
const renderer = new WebGlRenderer()
const renderFn = (canvas, getRasters) => renderer.render(canvas, pipeline, getRasters)
GeoTIFF.fromUrl('data/ortho.tiff')
.then(tiff => {
const rasterFn = (nwSe, size) => tiff.readRasters({
bbox: [nwSe[0].lng, nwSe[1].lat, nwSe[1].lng, nwSe[0].lat],
width: size.x,
height: size.y
})
// RasterLayer ties the raster function (GeoTIFF.js) and
// render function (raster-blaster) together
const geotiffLayer = new RasterLayer(tiff, rasterFn, renderFn)
L.map('map', {
maxZoom: 26,
layers: [geotiffLayer]
})
.fitBounds([[57.3066538, 12.3338591], [57.3089762, 12.3387167]])
FAQs
Leaflet Raster ==============
The npm package leaflet-raster receives a total of 2 weekly downloads. As such, leaflet-raster popularity was classified as not popular.
We found that leaflet-raster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.