Run1 spatial distance to boundary
Calculate the shortest distance between points (earthquakes) and a complex line geometry (plate boundaries).From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run1_spatial-distance-to-boundaryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.0 KB, 198 tokens by cl100k_base, as published. Nobody here has run it
To find the distance from points to a boundary:
- Isolate the boundary geometry. This can be the boundary of a plate polygon (
plate_gdf.geometry.boundary) or a separate LineString dataset. - If the boundary consists of multiple segments, use
.union_all()(in GeoPandas 1.0+) or.unary_unionto create a single geometry object for comparison. - Use the
.distance()method on the points GeoDataFrame against the unified boundary geometry. - To find the point furthest from the boundary, use
.loc[gdf['distance_col'].idxmax()].
# Create a single geometry representing the boundary
boundary_geom = boundaries_gdf.union_all()
# Calculate distance for each row
gdf['dist_to_boundary'] = gdf.geometry.distance(boundary_geom)
# Find the record with the maximum distance
furthest_record = gdf.loc[gdf['dist_to_boundary'].idxmax()]
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.