run2_geopandas_projections
Advanced guide on GeoPandas projections for accurate metric distance calculations without distortion using point-centric Azimuthal Equidistant CRS.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- run2_geopandas_projections
- description
- Advanced guide on GeoPandas projections for accurate metric distance calculations without distortion using point-centric Azimuthal Equidistant CRS.
03 SKILL.md 正文
Accurate Distances in GeoPandas via Custom Projections
Distance calculations in WGS84 CRS (EPSG:4326) yield meaningless degrees. While standard projected CRSs (like UTM or Mercator) suffer from distortions away from their center or standard parallels, an Azimuthal Equidistant projection centered perfectly on a geometry of interest preserves the exact distance to all other geometries around it.
The Point-Centric AEQD Strategy
To find the exact distance from a point to a boundary (such as the distance of an earthquake to a plate boundary), create a custom Azimuthal Equidistant CRS centered on the point itself.
import geopandas as gpd
from shapely.geometry import Point
# Assume we have a GeoSeries or DataFrame of boundaries
boundaries_gdf = gpd.read_file('boundaries.geojson')
def get_exact_distance_km(point_geom, boundaries_gdf):
lon, lat = point_geom.x, point_geom.y
# Create a custom AEQD CRS centered on the point
custom_crs = f"+proj=aeqd +lat_0={lat} +lon_0={lon} +datum=WGS84 +units=km"
# Project the boundaries to this custom CRS
boundaries_proj = boundaries_gdf.to_crs(custom_crs)
# The point itself is exactly at (0, 0) in its own AEQD projection
center_point = Point(0, 0)
# Minimum distance in kilometers
min_dist_km = boundaries_proj.distance(center_point).min()
return min_dist_km
# Example use:
# dist_km = get_exact_distance_km(earthquake.geometry, pa_boundaries)
This perfectly solves the distortion problems, even across the antimeridian (180°), because the Azimuthal Equidistant projection maps the entire globe correctly in relation to the center point.
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.