GeoNet Node Package Documentation - v1.1.7
    Preparing search index...

    Class GeoNet

    Main class for interacting with the GeoNet API and related utilities. Provides access to all GeoNet services through a unified interface.

    This class acts as a central interface for all GeoNet API services and related utilities, thus providing a simplified way to access earthquake, volcano and network data, among others, from GeoNet.

    import { GeoNet } from "geonet";
    const geonet = new GeoNet();

    // Get recent earthquakes
    const quakes = await geonet.getQuakes(...);

    1.0.0

    Index
    • Generates a colour code for a given MMI, which corresponds to the marker colour on GeoNet maps.

      Parameters

      • mmi: MMI

        The New Zealand Modified Mercalli Intensity of the quake.

      Returns string

      • The hex code colour for the earthquake based on the MMI.
    • Generates a link to the GeoNet quake map URL for a given set of coordinates and MMI.

      Parameters

      • coordinates: [number, number]

        The coordinates of the quake. Position 0 is the longitude, and position 1 is the latitude.

      • mmi: MMI

        The New Zealand Modified Mercalli Intensity of the quake.

      Returns string

      • The URL string for the quake map.
    • Fetches a simple JSON feed of GeoNet's news.

      Parameters

      • Optionalpage: number

        The page number of the news feed to fetch. If empty, the first page is returned.

      Returns Promise<NewsFeedResponse>

      • A promise that resolves to the simple JSON news feed data.
    • Fetches quake data for a given public ID.

      Parameters

      • publicID: string

        The public ID of the earthquake.

      Returns Promise<QuakeResponse>

      • A promise that resolves to the quake data.
    • Fetches location history data for a given public ID. Not all quakes have a location history.

      Parameters

      • publicID: string

        The public ID for the earthquake.

      Returns Promise<QuakeHistoryResponse>

      • A promise that resolves to the quake history data. The features array may be empty!
    • Fetches all quakes that have occurred over the past 365 days.

      Parameters

      • mmi: MMI

        The MMI to filter quakes by.

      Returns Promise<QuakesResponse>

      • A promise that resolves to the quakes data.
    • Fetches strong intensity data for a given public ID.

      Parameters

      • publicID: string

        The public ID for the earthquake.

      Returns Promise<StrongResponse>

      • A promise that resolves to the strong intensity data.