import json
import geopandas as gpd
from shapely.geometry import Point
def load_earthquake_data(filepath):
"""
Load earthquake data from GeoJSON and convert to GeoDataFrame.
Args:
filepath: Path to earthquakes_2024.json
Returns:
GeoDataFrame with earthquake points and attributes
"""
with open(filepath, 'r') as f:
data = json.load(f)
earthquakes = []
for feature in data['features']:
props = feature['properties']
coords = feature['geometry']['coordinates']
# Validate required fields
required = ['id', 'time', 'mag', 'place']
if not all(k in props for k in required):
continue
earthquakes.append({
'id': props['id'],
'time': props['time'],
'magnitude': props['mag'],
'place': props['place'],
'geometry': Point(coords[0], coords[1])
})
gdf = gpd.GeoDataFrame(earthquakes, crs='EPSG:4326')
return gdf
Load and Validate Earthquake Data
Load earthquake data from GeoJSON format and validate that it contains required fields (id, time, magnitude, latitude, longitude, place). Use this skill when initializing the analysis to ensure data integrity before processing.
Load and Validate Earthquake Data by cxcscmu · ed9b332
npx get-skill add cxcscmu/load-and-validate-earthquake-data File contents
---name: load-and-validate-earthquake-datadescription: Load earthquake data from GeoJSON format and validate that it contains required fields (id, time, magnitude, latitude, longitude, place). Use this skill when initializing the analysis to ensure data integrity before processing.metadata: source: https://skillmd.com/skills/cxcscmu/load-and-validate-earthquake-data---```pythonimport jsonimport geopandas as gpdfrom shapely.geometry import Pointdef load_earthquake_data(filepath): """ Load earthquake data from GeoJSON and convert to GeoDataFrame. Args: filepath: Path to earthquakes_2024.json Returns: GeoDataFrame with earthquake points and attributes """ with open(filepath, 'r') as f: data = json.load(f) earthquakes = [] for feature in data['features']: props = feature['properties'] coords = feature['geometry']['coordinates'] # Validate required fields required = ['id', 'time', 'mag', 'place'] if not all(k in props for k in required): continue earthquakes.append({ 'id': props['id'], 'time': props['time'], 'magnitude': props['mag'], 'place': props['place'], 'geometry': Point(coords[0], coords[1]) }) gdf = gpd.GeoDataFrame(earthquakes, crs='EPSG:4326') return gdf```
cxcscmu/SkillLearnBench commit ed9b332547
Frequently asked questions
Run npx get-skill add cxcscmu/load-and-validate-earthquake-data in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Load earthquake data from GeoJSON format and validate that it contains required fields (id, time, magnitude, latitude, longitude, place). Use this skill when initializing the analysis to ensure data integrity before processing. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
cxcscmu (@cxcscmu) published this skill. Their other Agent Skills are listed on their SkillMD profile.