{"id":13425858,"url":"https://github.com/stebogit/matrix-to-grid","last_synced_at":"2025-09-05T21:45:38.144Z","repository":{"id":57292561,"uuid":"88331216","full_name":"stebogit/matrix-to-grid","owner":"stebogit","description":"Takes a matrix of numbers and returns a point grid with the correspondent 'property' values","archived":false,"fork":false,"pushed_at":"2017-10-07T06:58:17.000Z","size":130,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-08T13:32:44.106Z","etag":null,"topics":["geojson","grid","matrix","points","turfjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stebogit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-15T07:21:09.000Z","updated_at":"2023-11-04T18:26:05.000Z","dependencies_parsed_at":"2022-08-27T16:50:59.542Z","dependency_job_id":null,"html_url":"https://github.com/stebogit/matrix-to-grid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stebogit%2Fmatrix-to-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stebogit%2Fmatrix-to-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stebogit%2Fmatrix-to-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stebogit%2Fmatrix-to-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stebogit","download_url":"https://codeload.github.com/stebogit/matrix-to-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441939,"owners_count":21104106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geojson","grid","matrix","points","turfjs"],"created_at":"2024-07-31T00:01:20.615Z","updated_at":"2025-04-11T16:39:58.373Z","avatar_url":"https://github.com/stebogit.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# matrix-to-grid\n\u003c!-- [![Build Status](https://travis-ci.org/stebogit/matrix-to-grid.svg?branch=master)](https://travis-ci.org/stebogit/matrix-to-grid) --\u003e\n[![Build Status](https://travis-ci.org/stebogit/matrix-to-grid.svg?branch=master)](https://travis-ci.org/stebogit/matrix-to-grid)\n[![npm version](https://badge.fury.io/js/matrix-to-grid.svg)](https://badge.fury.io/js/matrix-to-grid)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/stebogit/matrix-to-grid/blob/master/LICENSE)\n\nTakes a matrix of the values and returns a [Point](http://geojson.org/geojson-spec.html#point) grid mapping the values of the matrix as `property`\n\n**Parameters**\n\n- `matrix` \\[**[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003cArray\u003c\u003c[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)\u003e\u003e**] of numbers\n\n- `origin` \\[**[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)\u003e | [Feature](http://geojson.org/geojson-spec.html#feature-objects)\u0026lt;[Point](http://geojson.org/geojson-spec.html#point)\u003e**] position of the first bottom-left (South-West) point of the grid\n\n-   `cellSize` \\[**[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**] the distance across each cell\n\n- `options` \\[**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**] optional parameters:\n\n    - `zProperty` \\[**[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**] the name of the property of the points which will represent the correspondent matrix value (optional, default `elevation`)\n    \n    - `properties` \\[**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**] GeoJSON properties passed to all the points (optional, default `{}`)\n    \n    - `units` \\[**[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**] miles or kilometers (optional, default `kilometers`)\n\n**Returns**\n\nReturns a \\[**[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)\u0026lt;[Point](http://geojson.org/geojson-spec.html#point)\u003e**] grid of points having each the correspondend p`property` value of the matrix\n\n\n### Installation\n\n**npm**\n\n```sh\n$ npm install matrix-to-grid\n```\n\n**browser (ES5)**\n\n```html\n\u003cscript src=\"https://unpkg.com/matrix-to-grid/matrix-to-grid.min.js\"\u003e\u003c/script\u003e\n```\n\n### Quickstart\n\n```javascript\n  var matrixToGrid = require('matrix-to-grid');\n  var matrix = [\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  var origin = [-70.823364, -33.553984];\n  matrixToGrid(matrix, origin, 10);\n  // = pointGrid\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstebogit%2Fmatrix-to-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstebogit%2Fmatrix-to-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstebogit%2Fmatrix-to-grid/lists"}