npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ibis-gis

v1.0.13

Published

Node hurricane GIS shapefile converter

Downloads

32

Readme

Ibis 🌀

According to legend, the ibis is the last sign of wildlife to take shelter before a hurricane hits and the first to reappear once the storm has passed.

This one gets hurricane GIS data from the National Hurricane Center in GeoJSON format.

Requires Node 14 or higher

Why?

The NHC provides an easy-to-access RSS feed of its GIS products that are updated regularly during an active storm. This tool allows for automating the fetching process in addition to converting the .shp ZIP files into an array of GeoJSON FeatureCollections.

Ibis attempts to be as unopinionated as possible. It doesn't change any properties or names of the GIS data. It does not format times or time zones. It only assumes you want a specific shapefile.

It uses asynchronous functions to limit how often it has to download new files. You can frequently check shapefiles for updated data without downloading the file every time!

Install

npm

npm install ibis-gis

Yarn

yarn add ibis-gis

Usage

import Ibis from 'ibis-gis';

async function getForecast() {
  const ibis = new Ibis();

  const forecast = await ibis.get.forecast();

  const data = await forecast.fetchGIS();
}

API

Ibis

Parameters

  • options <Object>
    • options.name <String>: Get data for specific storm by name if it exists. Case insensitive.
    • options.basin <String>: Specify basin feed. Possible values: at, ep, cp for Atlantic, Eastern Pacific or Central Pacific, respectively. (Optional, default 'at')
    • options.exampleData <Boolean>: Fetch data from the example RSS feed for testing. (Optional, default false)

If no options are passed, it will fetch all active storms in the Atlantic basin.

Example

import Ibis from 'ibis-gis';

async function getBestTrack() {
  // Example storm, known name
  const ibis = new Ibis({
    name: 'Andrea',
    exampleData: true,
  });

  const bestTrack = await ibis.get.bestTrack();
  /** returns 
   * {
      name: [String],
      date: [String],
      fetchGIS: [Function]
    }
  */

  const date = await bestTrack.date;
  // 'Thu, 06 Jun 2013 02:32:31 GMT'
}

get

Gets shapefile matching the selected method of the first (or only) storm.

All methods are asynchronous.

Methods

  • forecast(): Forecast Track, Cone of Uncertainty, Watches/Warnings.
  • bestTrack(): Track, Points, and Wind Swath.
  • windField(): Initial and Forecast Surface Winds.
  • stormSurge(): Probabilistic Storm Surge 5ft

Returns Promise<Object>:

{
  name: <String> - Storm name for the shapefile,
  date: <String> - Last published date for the shapefile
  fileName: <String> - URL of the file from the RSS feed
  fetchGIS: <Function> @returns GeoJSON array of FeatureCollections
}

fetchGIS

Asynchronously fetches ZIP file from RSS feed and converts GeoJSON.

Returns Promise<Object>: Array of FeatureCollections with fileName and pubData.

Example

async function myFunc() {
  // Active storm, Atlantic basin
  const ibis = new Ibis();

  const stormSurge = await ibis.get.stormSurge();

  const jsonData = await bestTrack.stormSurge();
  /** returns
   * { 
   *  type: 'FeatureCollection',
   *  features: [ [Object], [Object], ...],
   *  fileName: 'al012013_2013060706_gt5',
   *  pubDate: 'Thu, 06 Jun 2013 02:49:27 GMT' 
     }
  */
}

getAll

The same methods as get. Useful when more than one active storms are found. Methods will return an array containing objects for each storm.

Will also return metaData in the array containing storm summary objects.

Example

async function myFunc() {
  // More than one active storm, East Pacific basin
  const ibis = new Ibis();

  const windField = await ibis.getAll.windField();

  const stormName = await windField[0].name; // 'Larry'

  const metaData = windField.metaData 
  /* 
  [
    {
      'nhc:center': '13.5, -34.2',
      'nhc:type': 'Hurricane',
      'nhc:name': 'Larry',
      'nhc:wallet': 'AT2',
      'nhc:atcf': 'AL122021',
      'nhc:datetime': '11:00 AM AST Thu Sep 2',
      'nhc:movement': 'W at 17 mph',
      'nhc:pressure': '985 mb',
      'nhc:wind': '80 mph',
      'nhc:headline': '...LARRY IS LARGER AND A BIT STRONGER... ...STEADY TO RAPID INTENSIFICATION LIKELY IN THE COMING DAYS...'
    }
  ]
  */
}

fetch

Custom fetch function. Ideal for fetching NHC URLs that may not be in the RSS feed. This is a convenience method for fetchGIS() with a {pubdate: null}.

Returns Promise<Object>: GeoJSON shapefile.

Example

async function init() {
  const ibis = new Ibis();

  const forecast = await ibis.fetch(
    'https://www.nhc.noaa.gov/gis/forecast/archive/al122021_5day_latest.zip'
  );
  /* returns
  [{
    type: 'FeatureCollection',
    features: [ [Object] ],
    fileName: 'al122021-008_5day_lin',
    pubDate: null
  }, ...] 
  */
}