Coder Social home page Coder Social logo

call-for-code / fires-api-nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isc-rsingh/fires-api-nodejs

1.0 2.0 0.0 75 KB

Access global daily fire reports and store in Cloudant as GeoJSON

License: Apache License 2.0

JavaScript 100.00%

fires-api-nodejs's Introduction

NASA Active Fire Data API access for IBM Cloud

wildfire Photo by Michael Held on Unsplash

This project shows how to build a basic data access application that continuously runs in the background, processing VIIRS (I-Band 375 m) data from NASA by dowloading CSV files from the site, transforming each record into GeoJSON, and loading that into a Cloudant database.

From NASA FIRMS:

The Visible Infrared Imaging Radiometer Suite (VIIRS) 375 m (VNP14IMGTDL_NRT) active fire product is the latest product to be added to FIRMS. It provides data from the VIIRS sensor aboard the joint NASA/NOAA Suomi National Polar-orbiting Partnership (Suomi-NPP) satellite. The 375 m data complements Moderate Resolution Imaging Spectroradiometer (MODIS) fire detection; they both show good agreement in hotspot detection but the improved spatial resolution of the 375 m data provides a greater response over fires of relatively small areas and provides improved mapping of large fire perimeters. The 375 m data also has improved nighttime performance. Consequently, these data are well suited for use in support of fire management (e.g., near real-time alert systems), as well as other science applications requiring improved fire mapping fidelity. Recommended reading: VIIRS 375 m Active Fire Algorithm User Guide (updated July 2018).

Get an IBM Cloud account

If you haven't yet done it, sign up for IBM Cloud here.

Getting Started in IBM Cloud

Deploy this application to the IBM Cloud in one simple step.

Deploy to IBM Cloud

Click this button to deploy the NodeJS app and instantiate a Cloudant database service at the same time. You'll have a fire app that harvests data and persists it to a Cloudant database, where you can easily write queries to access the data.

Getting Started with a local development environment

To run this application on your local machine, first install Node.js.

  1. Install and configure the IBM Cloud Developer Tools

  2. Clone this repository

    $ git clone [email protected]:rajrsingh/fires-api-nodejs.git
    $ cd fires-api-nodejs
    
  3. Install the dependencies

    $ npm install
    
  4. Create a vcap-local.json file with your IBM Cloud app's VCAP environment variables

    • When running this app locally you can get your Cloudant credentials from IBM Cloud (VCAP_SERVICES in cf env output or the Environment Variables section for an app in the IBM Cloud console dashboard). Feel free to copy all the environment variables -- not just the Cloudant ones. The app will still find the right ones.
    • Once you have the credentials, paste them into a file called vcap-local.json. Alternately you could point to a local database here instead of a service on the IBM Cloud.
    • URL will be in this format: https://username:[email protected]
  5. Make edits

  • One thing you will want to do when testing is to have the NASA data harvesting run immediately instead of on a timer. To do this, uncomment the last line of the file so that it reads like this:

    callActiveFireData()
    
  1. Deploy the application with your code
    $ ibmcloud cf push
    

License

This code is licensed under Apache 2.0. Full license text is available in LICENSE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.