New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

georaster

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

georaster

Wrapper around Georeferenced Rasters like GeoTIFF, NetCDF, JPG, and PNG that provides a standard interface

  • 0.3.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1K
decreased by-27.68%
Maintainers
1
Weekly downloads
 
Created
Source

georaster

Wrapper around Georeferenced Rasters like GeoTIFF, NetCDF, JPG, and PNG that provides a standard interface. You can also create your own georaster from simple JavaScript objects.

load from url on front-end

const parse_georaster = require("georaster");
fetch(url)
  .then(response => response.arrayBuffer() )
  .then(parse_georaster)
  .then(georaster => {
      console.log("georaster:", georaster);
  });

load from file on back-end

const parse_georaster = require("georaster");
fs.readFile("data/GeogToWGS84GeoKey5.tif", (error, data) => {
    parse_georaster(data).then(georaster => {
      console.log("georaster:", georaster);
    })
});

load from simple object on front-end

const parse_georaster = require("georaster");
const values = [ [ [0, 1, 2], [0, 0, 0], [2, 1, 1] ] ];
const no_data_value = 3;
const projection = 4326;
const xmin = -40;
const ymax = 14;
const pixelWidth = 0.00001;
const pixelHeight = 0.00001;
const metadata = { no_data_value, projection, xmin, ymax, pixelWidth, pixelHeight };
const georaster = parse_georaster(values, metadata);

properties

namedescription
maxsarray with max value for each band
minsarray with min value for each band
rangesarray with difference between max and min value for each band
no_data_valueno data value
pixelWidthwidth of pixel in dimension of coordinate reference system
pixelHeightheight of pixel in dimension of coordinate reference system
projectionequal to EPSG code, like 4326
valuestwo dimensional array of pixel values
widthnumber of pixels wide raster is
xmaxxmax in crs, which is often in longitude
xminxmin in crs, which is often in longitude
yminymin in crs, which is often in latitude
ymaxymax in crs, which is often in latitude

Keywords

FAQs

Package last updated on 19 Jun 2018

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc