run2_geopandas_spatial_joins
Improved guide for performing spatial joins with GeoPandas, specifically handling antimeridian crossing polygons like the Pacific Plate.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 92
- Forks
- 7
01 前言 Front Matter
- name
- run2_geopandas_spatial_joins
- description
- Improved guide for performing spatial joins with GeoPandas, specifically handling antimeridian crossing polygons like the Pacific Plate.
03 SKILL.md 正文
Spatial Joins and Antimeridian in GeoPandas
GeoPandas provides sjoin to join points and polygons based on their spatial relationship.
Pacific Plate and the Antimeridian
The Pacific Plate spans across the 180° meridian (antimeridian). Standard WGS84 (EPSG:4326) coordinates wrap around this line.
High-quality datasets like PB2002 split tectonic plates that cross the antimeridian into MultiPolygon geometries. This means a standard spatial join using Euclidean intersection rules on EPSG:4326 will correctly identify points within the plate without false positives connecting -180 and 180 through Greenwich.
Usage
import geopandas as gpd
# Load points and polygons
points = gpd.read_file('points.geojson')
polygons = gpd.read_file('polygons.geojson')
# Ensure matching CRS before spatial join
if points.crs != polygons.crs:
points = points.to_crs(polygons.crs)
# Filter polygons (e.g. Code == 'PA' for Pacific Plate)
pacific_plate = polygons[polygons['Code'] == 'PA']
# Find points within the polygon
points_in_poly = gpd.sjoin(points, pacific_plate, predicate='within')
print(f"Points inside PA plate: {len(points_in_poly)}")
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.