{"_id":"geowarp-canvas","_rev":"2-c65f42ddb8dc1bfa90cc0d595c876d3a","name":"geowarp-canvas","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"geowarp-canvas","version":"0.0.1","description":"Adds HTML Canvas Support to GeoWarp","main":"./index.js","scripts":{"clean":"rm -fr ./test-output/*","format":"npx prettier --arrow-parens=avoid --trailing-comma=none --write *.js","setup":"cd test-data && ./setup.sh","test":"LOG_SKIP=false TIME=true node test.js"},"repository":{"type":"git","url":"git+https://github.com/DanielJDufour/geowarp-canvas.git"},"keywords":["canvas","cutline","geowarp","gis","imagery","map","reproject","resample","satellite"],"author":{"name":"Daniel J. Dufour"},"license":"CC0-1.0","bugs":{"url":"https://github.com/DanielJDufour/geowarp-canvas/issues"},"homepage":"https://github.com/DanielJDufour/geowarp-canvas#readme","devDependencies":{"canvas":"^2.11.2","flug":"^2.6.0","geotiff":"1.0.9","geotiff-epsg-code":"^0.3.1","geotiff-no-data":"^0.2.0","geowarp":"link:../geowarp","proj4-fully-loaded":"^0.2.0","reproject-bbox":"^0.12.0","srvd":"^0.6.0","write-image":"^0.2.0"},"dependencies":{"calc-image-stats":"^0.9.0","guess-image-layout":"^0.1.0","pixel-utils":"^0.9.0"},"_id":"geowarp-canvas@0.0.1","gitHead":"9fe314dd590551e16ec8e1567571154a437d42b5","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-NDKzS4DcRUA2+i33Xjqi1tb/IH5SQM4dG6DoYLH56OOMF//Em3g7F/Tiz9pL51fylO1C/CvrYTH76bHKOVp1ag==","shasum":"346abf3c4819ee557503b5e7c3b5a16f357841a7","tarball":"https://registry.npmjs.org/geowarp-canvas/-/geowarp-canvas-0.0.1.tgz","fileCount":4,"unpackedSize":17526,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiZL0jcXwwlAkTsxoBqoNwQgXiBu6qV60GKVWCqBVa2QIhAPuyYb22tYJt1JwsoJ9TQj9f9BC4jHHC+Q19UZnSwsbg"}]},"_npmUser":{"name":"danieljdufour","email":"daniel.j.dufour@gmail.com"},"directories":{},"maintainers":[{"name":"danieljdufour","email":"daniel.j.dufour@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geowarp-canvas_0.0.1_1701831777828_0.31221334739102646"},"_hasShrinkwrap":false},"0.1.0":{"name":"geowarp-canvas","version":"0.1.0","description":"Adds HTML Canvas Support to GeoWarp","main":"./index.js","scripts":{"clean":"rm -fr ./test-output/*","format":"npx prettier --arrow-parens=avoid --trailing-comma=none --write *.js","setup":"cd test-data && ./setup.sh","test":"LOG_SKIP=false TEST_TIMED=true node test.js"},"repository":{"type":"git","url":"git+https://github.com/DanielJDufour/geowarp-canvas.git"},"keywords":["canvas","cutline","geowarp","gis","imagery","map","reproject","resample","satellite"],"author":{"name":"Daniel J. Dufour"},"license":"CC0-1.0","bugs":{"url":"https://github.com/DanielJDufour/geowarp-canvas/issues"},"homepage":"https://github.com/DanielJDufour/geowarp-canvas#readme","devDependencies":{"canvas":"^2.11.2","flug":"^2.7.1","geotiff":"1.0.9","geotiff-epsg-code":"^0.3.1","geotiff-no-data":"^0.2.0","geowarp":"^1.25.0","proj4-fully-loaded":"^0.2.0","reproject-bbox":"^0.12.0","srvd":"^0.6.0","write-image":"^0.2.0"},"dependencies":{"calc-image-stats":"^0.9.0","guess-image-layout":"^0.1.0","pixel-utils":"^0.9.0"},"_id":"geowarp-canvas@0.1.0","gitHead":"965bcdec968ca6dda2ae9285c33d086ca8031d78","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-m6/4Z8xnMdWofIamgHd5A6O95/uynpH+K/S+Y8e4ywybDJJwhlTegp/QRJ8NRLANKdrsNgj1EyfJc8ujgI7Tjg==","shasum":"e8e683bf00cbcf35316308e24cd3e09017262297","tarball":"https://registry.npmjs.org/geowarp-canvas/-/geowarp-canvas-0.1.0.tgz","fileCount":4,"unpackedSize":17630,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7vVRmO2NQKnxMbuFDwmgi5bSL74jfd80yPaC6cYEsxwIgGBoIYIHzo689/gXSEZQez6NYjGJb9Z+tZuOg+gOr4X8="}]},"_npmUser":{"name":"danieljdufour","email":"daniel.j.dufour@gmail.com"},"directories":{},"maintainers":[{"name":"danieljdufour","email":"daniel.j.dufour@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geowarp-canvas_0.1.0_1703345766601_0.5628805033456139"},"_hasShrinkwrap":false},"0.2.0":{"name":"geowarp-canvas","version":"0.2.0","description":"Adds HTML Canvas Support to GeoWarp","main":"./index.js","scripts":{"clean":"rm -fr ./test-output/*","format":"npx prettier --arrow-parens=avoid --print-width=160 --trailing-comma=none --write *.js","setup":"cd test-data && ./setup.sh","test":"LOG_SKIP=false TEST_TIMED=true node test.js"},"repository":{"type":"git","url":"git+https://github.com/DanielJDufour/geowarp-canvas.git"},"keywords":["canvas","cutline","geowarp","gis","imagery","map","reproject","resample","satellite"],"author":{"name":"Daniel J. Dufour"},"license":"CC0-1.0","bugs":{"url":"https://github.com/DanielJDufour/geowarp-canvas/issues"},"homepage":"https://github.com/DanielJDufour/geowarp-canvas#readme","devDependencies":{"canvas":"^2.11.2","flug":"^2.7.2","geotiff":"1.0.9","geotiff-epsg-code":"^0.3.1","geotiff-no-data":"^0.2.0","geowarp":"^1.26.1","proj4-fully-loaded":"^0.2.0","reproject-bbox":"^0.13.1","srvd":"^0.6.0","write-image":"^0.2.0"},"dependencies":{"calc-image-stats":"^0.9.0","guess-image-layout":"^0.1.0","pixel-utils":"^0.9.0"},"_id":"geowarp-canvas@0.2.0","gitHead":"c1d49274a808bd4b13dd7bb8ddc3e4e7a2ac2632","_nodeVersion":"21.1.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-tFCYl10aN7bXTHSxfElBhdK3gDHMiks2G1OTlCwmWcxWA1799L8c/EnPZxHdCFCerT3lkYK6RwGdTODH5iKZFw==","shasum":"997ed7a2949e1dcb569b62adcfc60f4e3774d263","tarball":"https://registry.npmjs.org/geowarp-canvas/-/geowarp-canvas-0.2.0.tgz","fileCount":4,"unpackedSize":18090,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3JMg3VgnbNN9jF4xiQ2edM0YMUHTzuCjVwpOK335zSAIhANHQByqf/cVsvwY1k5HEV4HpMoZ88yaqStf2cgbEOVZw"}]},"_npmUser":{"name":"danieljdufour","email":"daniel.j.dufour@gmail.com"},"directories":{},"maintainers":[{"name":"danieljdufour","email":"daniel.j.dufour@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geowarp-canvas_0.2.0_1707060801228_0.34703654387926064"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-06T03:02:57.827Z","0.0.1":"2023-12-06T03:02:57.987Z","modified":"2024-02-04T15:33:21.569Z","0.1.0":"2023-12-23T15:36:06.756Z","0.2.0":"2024-02-04T15:33:21.395Z"},"maintainers":[{"name":"danieljdufour","email":"daniel.j.dufour@gmail.com"}],"description":"Adds HTML Canvas Support to GeoWarp","homepage":"https://github.com/DanielJDufour/geowarp-canvas#readme","keywords":["canvas","cutline","geowarp","gis","imagery","map","reproject","resample","satellite"],"repository":{"type":"git","url":"git+https://github.com/DanielJDufour/geowarp-canvas.git"},"author":{"name":"Daniel J. Dufour"},"bugs":{"url":"https://github.com/DanielJDufour/geowarp-canvas/issues"},"license":"CC0-1.0","readme":"# geowarp-canvas\n\n## motivation\nMake it easier to display geospatial data on an HTML Canvas Element\n\n## design philosophy\ngeowarp-canvas is designed as a decorator.  This library is highly experimental, so this may change in the future.  The idea is to find a way to add capabilities to geowarp without adding too much complexity to geowarp core.\n\n## usage\n```js\nimport geowarp_core from \"geowarp\";\nimport geowarp_canvas from \"geowarp-canvas\";\n\nconst geowarp = geowarp_canvas(geowarp_core);\n\nconst canvas = document.createElement(\"CANVAS\");\ncanvas.height = 256;\ncanvas.width = 256;\n\ngeowarp({\n  // required\n  // activate geowarp-canvas plugin\n  plugins: [\"geowarp-canvas\"],\n\n  // required\n  // this is the canvas that we will paint on\n  out_canvas: canvas,\n\n  // optional\n  // array of statistics by band\n  // could greatly increase speed\n  in_stats: [{ min: 0, max: 12345 }, { min: 0, max: 10567 }],\n\n  // optional\n  // paint the background of the canvas this color\n  // before painting valid data\n  out_no_data_color: \"pink\",\n\n  // optional - experimental\n  // draw at a quarter of the real resolution\n  out_resolution: [0.25, 0.25],\n\n  // optional\n  // custom draw function\n  draw: ({ \n    bbox: [xmin, ymin, xmax, ymax], // location of pixel rectangble in un-rounded canvas image coordinates from top-left\n    canvas, // same as out_canvas, the canvas you are painting to\n    context, // context for the out_canvas\n    color, // CSS Color Value, like \"rgba(0, 12, 54, 255)\"\n    pixel, // raw pixel values (before band expression applied)\n    rect: [x, y, width, height], // params for fillRect or strokeRect\n    rgba, // pixel as [r, g, b, a]\n    cell: [row, column], // cell location at current resolution\n    resolution: [x_resolution, y_resolution],\n    scale: [x_scale, y_scale],\n    points: [source_point, target_point], // pixel centroid in projection of data and canvas, only available when method is \"near\" and turbo is false\n    sample: [column_in_data, row_in_data]\n  }) => {\n    context.fillStyle(color);\n    context.fillRect(...rect);\n  },\n\n  // optional\n  // called with mutable options object that will be passed to geowarp\n  before_warp: (options) => {\n    const { expr, out_height, skip_no_data_strategy, ...rest } = options;\n    // ...\n  },\n\n  // optional\n  // called after warping with result returned by geowarp\n  after_warp: (result) => {\n    console.log(\"result returned by geowarp:\", result);\n  },\n\n  // optional\n  // paint or modify the canvas before\n  // drawing the rectangle for the reprojected pixel\n  before_draw: ({ bbox, ...rest }) => { },\n\n  // optional\n  after_draw: ({ bbox, canvas, context, color, pixel, point, rect, rgba, resolution, scale }) => {\n    // put red outline around drawn pixel rectangle\n    context.strokeStyle = \"red\";\n    context.strokeRect(...rect);\n  },\n\n  // optional\n  // array of colors where each index number corresponds to a pixel value\n  // each color can be [r, g, b, a], [r, g, b] or \"rgb(112, 108, 96)\" (CSS Color Values)\n  palette: [\n    [ 112, 108, 96, 255 ],\n    [ 112, 104, 80, 255 ]\n    // ...\n  ],\n\n  // flip between black-to-white and white-to-black\n  flip: true\n\n  // all other params are inherited from\n  // https://github.com/danieljdufour/geowarp\n});\n```\n","readmeFilename":"README.md"}