himawari.js - 從Himawari-8衛星下載地球的實時圖片
Getting Started
brew install imagemagick
brew install graphicsmagick
npm i himawariUsage
var himawari = require('himawari');
himawari({
/**
* The zoom level of the image. Can be 1-4 (default: 1)
* Each zoom level requires more images to be downloaded and therefore stitched
* together. Higher zoom yields a higher resolution image.
* @type {Number}
*/
zoom: 1,
/**
* The time of the picture desired. If you want to get the latest image, use 'latest'
* @type {String|Date}
*/
date: 'latest', // Or new Date() or a date string
/**
* The location to save the resulting image
* @type {String}
*/
outfile: '/path/to/output/earth.jpg',
/**
* A success callback if the image downloads successfully
* @type {Function}
*/
success: function () { process.exit(); },
/**
* A callback if the image cannot be downloaded or saved
* @type {Function}
* @param {Object} err An error object or information surrounding the issue
*/
error: function (err) { console.log(err); },
/**
* A callback that is fired every time a tile has been downloaded.
* @param {Object} info Information about the download such as filepath, part, and total images
*/
chunk: function (info) {
console.log(info.outfile + ': ' + info.part + '/' + info.total);
}
});Acknowledgement
Michael Pote created a Powershell Script that inspired this library.
Example Image
License
MIT
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!
