mfuery / Eature

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eature

Visualize events recorded by NASA's Earth Observatory Natural Event Tracker (EONET)

StepZen

We are using StepZen to unify multiple REST APIs into a single GraphQL interface for our app to query.

Dev Setup

npm install -g stepzen

Dev Commands

yarn start

Starts React frontend

stepzen start

Launches local stepzen graphiql explorer and backend data sources

Dev Tips

If NASA imagery api gives you:

{ "msg": "No imagery for specified date.", "service_version": "v5000" }

for URL

https://api.nasa.gov/planetary/earth/imagery?lon=-101.05&lat=-74.95&date=2017-09-23&dim=0.2&api_key=DEMO_KEY

The issue is... maybe try dim=0.5 ?

TypeError: Object(...) is not a function

Make sure you're importing useQuery from "@apollo/client"! Or, you're importing a hook from the wrong module!

StepZen's graphiql UI won't load in browser

Make sure your config.yaml file is there.

Production Deployment

Netlify works.

Make sure you add your .env variables to the environment in their web UI.

API Data Structures

Example NASA EONET api results

Super Typhoon Surigae

Notice that the geometry array is a time series.

{
  "id": "EONET_5300",
  "title": "Super Typhoon Surigae",
  "description": null,
  "link": "https://eonet.sci.gsfc.nasa.gov/api/v3/events/EONET_5300",
  "closed": null,
  "categories": [
    {
      "id": "severeStorms",
      "title": "Severe Storms"
    }
  ],
  "sources": [
    {
      "id": "GDACS",
      "url": "https://www.gdacs.org/Cyclones/report.aspx?eventid=1000778&eventtype=TC"
    },
    {
      "id": "JTWC",
      "url": "https://www.metoc.navy.mil/jtwc/products/wp0221.tcw"
    }
  ],
  "geometry": [
    {
      "magnitudeValue": 35.0,
      "magnitudeUnit": "kts",
      "date": "2021-04-14T00:00:00Z",
      "type": "Point",
      "coordinates": [137.7, 8.5]
    },

    {
      "magnitudeValue": 35.0,
      "magnitudeUnit": "kts",
      "date": "2021-04-14T06:00:00Z",
      "type": "Point",
      "coordinates": [137.4, 8.9]
    },

     ...<more geometries>

Example URLs for Before & During satellite images given a date, lat, lon

About


Languages

Language:JavaScript 89.1%Language:HTML 7.0%Language:CSS 3.9%