himawari.js - 从Himawari-8卫星下载地球的实时图片

jopen 9年前

Getting Started

brew install imagemagick  brew install graphicsmagick  npm i himawari

Usage

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

项目地址: https://github.com/jakiestfu/himawari.js