Earthquake plate calculation

From XuShuwenn/RedAct · View interactive version

Earthquake plate calculation is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Find the earthquake furthest from the Pacific plate boundary within the Pacific plate using GeoPandas and distance calculations.

How to use this skill

Skill file

Earthquake Pacific Plate Distance Analysis

When to Use

Input Files

Output Format

JSON at /root/answer.json:

{
  "id": "earthquake_id",
  "place": "location description",
  "time": "",
  "magnitude": ,
  "latitude": ,
  "longitude": ,
  "distance_km":
}

Execution Protocol

Execution Protocol

Key Steps

  1. Load earthquake data with GeoPandas
  1. Inspect the earthquake, plate, and boundary schemas first (geometry types, column/property names, CRS, feature counts, and a few sample values) before writing filters or output extraction logic
  2. Load plate polygons, inspect available identifier/name columns, and explicitly confirm the authoritative Pacific plate identifier/code from the data itself; prefer a stable shared code field only if inspection shows it is correct, and keep visible evidence of the exact matching row(s) used
  3. If antimeridian handling is needed, normalize Pacific-spanning geometries consistently across points, polygons, and boundaries before spatial filtering or distance work
  4. Use the confirmed Pacific plate polygon only for containment: filter earthquakes within that polygon before any ranking or distance calculation
  5. Load plate boundary lines separately, inspect boundary identifier/side fields, and select only the verified Pacific-boundary segments using the same confirmed Pacific identifier (for example rows where PlateA or PlateB matches the verified Pacific code); verify the selected features plausibly trace that same plate boundary, then combine them into one validated geometry before nearest-distance calculations
  6. Calculate each in-plate earthquake's minimum distance to the verified Pacific plate boundary lines, not the polygon exterior as a shortcut. Keep containment/topology checks in EPSG:4326, then reproject both the filtered earthquakes and verified boundary geometry to a meter-based CRS for the main full-set distance pass; never measure directly in EPSG:4326 degrees
  7. Because this is a Pacific-wide / antimeridian-spanning problem, geodesically validate the winner and nearby top candidates before finalizing, and do not let sampled vertices, midpoint shortcuts, or other approximations determine the winner
  8. Compute the final exact distance metric for the full filtered in-plate set, then take the argmax of the validated distances
  9. Round distance_km to 2 decimal places
  10. Prefer a small reproducible script for the full workflow (load, inspect columns, isolate Pacific polygon/boundaries, filter earthquakes, compute distances, write /root/answer.json) instead of ad hoc interactive steps when the analysis has multiple geospatial transforms

Validation

Validation

Tips

Final Check

Final Check

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.