{"name":"grid-to-matrix","version":"1.2.0","description":"Takes a GeoJSON pointGrid and returns a correspondent matrix array of 'property' values of the points","main":"index.js","types":"index.d.ts","files":["index.js","index.d.ts","dist"],"scripts":{"prepublish":"npm run test && npm run build","pretest":"npm run lint","test":"node test.js","bench":"node bench.js","lint":"eslint index.js","build":"npm run rollup && npm run uglify","rollup":"rollup -c rollup.config.js","uglify":"uglifyjs dist/grid-to-matrix.js -c -m > dist/grid-to-matrix.min.js"},"repository":{"type":"git","url":"git+https://github.com/stebogit/grid-to-matrix.git"},"keywords":["geojson","grid","points","array","matrix"],"author":{"name":"Stefano Borghi","email":"stefano.borghi@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/stebogit/grid-to-matrix/issues"},"devDependencies":{"@turf/truncate":"^4.1.0","benchmark":"^2.1.3","eslint":"^2.0.0","eslint-config-mourner":"^2.0.0","load-json-file":"^2.0.0","rollup":"^0.41.5","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-json":"^2.1.0","rollup-plugin-node-builtins":"^2.1.0","rollup-plugin-node-globals":"^1.1.0","rollup-plugin-node-resolve":"^2.0.0","tape":"^3.5.0","typescript":"^2.2.1","uglifyjs":"^2.4.10","write-json-file":"^2.0.0"},"dependencies":{"@turf/meta":"^4.1.0","@turf/invariant":"^4.1.0","@turf/helpers":"^4.1.0"},"gitHead":"a7008ac873805651f3d9bf17309e65d0983f256a","homepage":"https://github.com/stebogit/grid-to-matrix#readme","_id":"grid-to-matrix@1.2.0","_shasum":"b016df4d76f996e6b74663eab9ceb913546657e9","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"stebogit","email":"stefano.borghi@gmail.com"},"dist":{"shasum":"b016df4d76f996e6b74663eab9ceb913546657e9","tarball":"http://registry-npm.ywwl.com/grid-to-matrix/download/grid-to-matrix-1.2.0.tgz","integrity":"sha512-kk7Z61HfvexDS8KxVnxU7XFiwgvRRoSKLYosUhe9Nl8eGkPgMHke7daavhNqonNgQsxpCRx9klbnlNSmGE3MPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBgPfYH3Ti2MCkPXzjonbSDq9dhbXte1VFugSbud1XyeAiAUxmj4DcEgMd16TvZ1IPQYYJeLM8Xle51rrIHsv0w7lA=="}],"size":8566,"noattachment":false,"key":"/grid-to-matrix/-/grid-to-matrix-1.2.0.tgz"},"maintainers":[{"name":"stebogit","email":"stefano.borghi@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/grid-to-matrix-1.2.0.tgz_1494209601245_0.9746004631742835"},"directories":{},"readme":"# grid-to-matrix\n\n[![Build Status](https://travis-ci.org/stebogit/grid-to-matrix.svg?branch=master)](https://travis-ci.org/stebogit/grid-to-matrix)\n[![npm version](https://badge.fury.io/js/grid-to-matrix.svg)](https://badge.fury.io/js/grid-to-matrix)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/stebogit/grid-to-matrix/blob/master/LICENSE)\n\nTakes a [Point](http://geojson.org/geojson-spec.html#point) grid and returns a correspondent matrix of the `property` values\n\n**Parameters**\n\n- `grid` \\[**[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)&lt;[Point](http://geojson.org/geojson-spec.html#point)>**] grid of points\n- `options.zProperty` \\[**[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**] the property name in `grid` from which the matrix values will be pulled (optional, default `elevation`)\n- `options.flip` \\[**[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**] returns the matrix upside-down (optional, default `false`)\n- `options.flags` \\[**[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**] , adding a `matrixPosition` array field ([`row`, `column`]) to its properties, the grid points with coordinates on the matrix (optional, default `false`)\n\n**Returns**\n\nMatrix \\[**[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<Array<<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>>**] of the `grid` points `property` values\n\n### Installation\n\n**npm**\n\n```sh\n$ npm install grid-to-matrix\n```\n\n**browser (ES5)**\n\n```html\n<script src=\"https://unpkg.com/grid-to-matrix/grid-to-matrix.min.js\"></script>\n```\n\n### Quickstart\n\n```javascript\n  var pointGrid = require('@turf/point-grid');\n  var gridToMatrix = require('grid-to-matrix');\n\n  var extent = [-70.823364, -33.553984, -70.473175, -33.302986];\n  var cellSize = 3;\n  var grid = pointGrid(extent, cellSize);\n  // add a random elevation property to each point between 0 and 60\n  for (var i = 0; i < grid.features.length; i++) {\n    grid.features[i].properties.elevation = (Math.random() * 60);\n  }\n\n  gridToMatrix(grid);\n  // =[\n  //    [ 1, 13, 20,  9, 10, 13, 18],\n  //    [34,  8,  0,  4,  5,  8, 13],\n  //    [10,  5,  2,  1,  2,  5, 24],\n  //    [ 0,  4, 56, 19,  0,  4,  9],\n  //    [10,  5,  2, 12,  2,  5, 10],\n  //    [57,  8,  5,  4,  5,  0, 57],\n  //    [ 3, 13,  0,  9,  5, 13, 35],\n  //    [18, 13, 10,  9, 78, 13, 18]\n  //  ]\n```\n","publish_time":1494209601475,"_cnpm_publish_time":1494209601475,"dist-tags":{"latest":"1.4.0"}}