Package Exports
- matrix-to-grid
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (matrix-to-grid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
matrix-to-grid
Takes a matrix of the values and returns a Point grid mapping the values of the matrix as property
Parameters
origin
[Array<number> | Feature<Point>] position of the first bottom-left (South-West) point of the gridcellSize
[number] the distance across each celloptions
[Object] optional parameters:
Returns
Returns a [FeatureCollection<Point>] grid of points having each the correspondend pproperty
value of the matrix
Installation
npm
$ npm install matrix-to-grid
browser (ES5)
<script src="https://unpkg.com/matrix-to-grid/matrix-to-grid.min.js"></script>
Quickstart
var matrixToGrid = require('matrix-to-grid');
var matrix = [
[ 1, 13, 20, 9, 10, 13, 18],
[34, 8, 0, 4, 5, 8, 13],
[10, 5, 2, 1, 2, 5, 24],
[ 0, 4, 56, 19, 0, 4, 9],
[10, 5, 2, 12, 2, 5, 10],
[57, 8, 5, 4, 5, 0, 57],
[ 3, 13, 0, 9, 5, 13, 35],
[18, 13, 10, 9, 78, 13, 18]
];
var origin = [-70.823364, -33.553984];
matrixToGrid(matrix, origin, 10);
// = pointGrid