Skip to main content
100%

C — USGS Earthquakes (Loader)

✓ Published0🌍 Public
Aabhyudaithakur7@gmail.com
Last edited Sep 17, 2025
Created on Sep 16, 2025
Forked from Loading Data

This example loads earthquake data from the USGS GeoJSON feed, fetching the M2.5+ 30-day summary directly via URL to avoid file upload limits. The code parses each feature’s time, magnitude, depth, coordinates, and place name into structured rows, then displays a count and a JSON preview of the first six records. It uses the Fetch API with `d3.json`-compatible `fetch().then(r => r.json())` and renders a proof-of-life layout with innerHTML, demonstrating data ingestion without any visualization yet.

AI-generated description

Note: The dataset is fetched directly from the USGS URL (no local file) to avoid VizHub’s upload size limit.

Dataset C — USGS Earthquakes (M2.5+/M4.5+, Past 30 Days) – GeoJSON

Source: USGS Earthquake Hazards Program – GeoJSON feeds
Link: https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php

What it is: Recent earthquakes with magnitude, time, depth, and location (lat/long), delivered as GeoJSON.

Fields & attribute types (VAD):

  • time — time (epoch ms → Date)
  • mag — quantitative
  • depth_km — quantitative
  • lon, lat — lat/long (spatial)
  • place — categorical

Note: If the full M2.5+ 30-day feed is too large to upload, either fetch it by URL or use the smaller M4.5+ 30-day feed.

MIT Licensed

Similar vizzes