grid-to-matrix
![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)
Takes a Point grid and returns a correspondent matrix of the property
values
Parameters
grid
[FeatureCollection<Point>] grid of pointsproperty
[string] the property name in grid
from which the matrix values will be pulled (optional, default elevation
)
Returns
Matrix [Array<Array<<number>>] of the grid
points property
values
Installation
npm
$ npm install grid-to-matrix
Quickstart
var pointGrid = require('@turf/point-grid');
var gridToMatrix = require('grid-to-matrix');
var extent = [-70.823364, -33.553984, -70.473175, -33.302986];
var cellSize = 3;
var grid = pointGrid(extent, cellSize);
for (var i = 0; i < grid.features.length; i++) {
grid.features[i].properties.elevation = (Math.random() * 60);
}
gridToMatrix(grid);