Antimeridian Crossing LineString¶
A LineString crossing the antimeridian (180° longitude). Naive code draws it the wrong way around the globe and computes a ~40,000 km length.
| Property | Value |
|---|---|
| Case ID | antimeridian_crossing_line |
| Category | vector |
| Format | GeoJSON |
| Geometry type | LineString |
| CRS | EPSG:4326 |
| Location | Antimeridian, North Pacific — 179.50°E, 20.00°N → 179.50°W, 20.00°N (crosses the antimeridian — the box runs east from the first corner, over 180°) |
| Test tier | unit |
| Size class | tiny |
| Storage class | bundled |
| Redistributable | yes |
| Loader | geopandas |
| Status | validated |
Use this case¶
import pytest
@pytest.mark.geocase_case("antimeridian_crossing_line")
def test_antimeridian_crossing_line(geocase_case) -> None:
data = geocase_case.load()
assert data is not None
Use GeoCase in your tests¶
Install the complete set of vector, raster, and NetCDF dependencies:
What this case checks¶
Expose code that naively interpolates across the Prime Meridian (0°) instead of correctly crossing the Antimeridian (±180°).
Risk types covered¶
extent/antimeridianmeasurement/distance_errorscaling/incorrect_rendering
Expected behavior¶
| Assertion | Expected |
|---|---|
expect_loadable |
yes |
expect_valid_geometry |
yes |
expect_crs |
yes |
expected_epsg |
4326 |
expected_geometry_types |
LineString |
Notes¶
Purpose¶
Tests handling of lines that cross the 180° longitude line (antimeridian/International Date Line).
The Problem¶
A line from (179.5°, 20°) to (-179.5°, 20°) should travel 1 degree east across the Pacific.
However, naive implementations that simply interpolate between coordinates will draw a line 359 degrees west around the entire globe, passing through the Atlantic, Africa, and Asia.
Expected Behavior¶
- Geodesic calculations: Should compute the short (~111 km) distance across the Pacific
- Rendering: Should draw the short path, not wrap around the globe
- Bounding box: Should recognize the span crosses the antimeridian
Detection¶
A line crosses the antimeridian if: 1. Adjacent coordinates have longitude signs that differ (one positive, one negative) 2. The absolute difference in longitude > 180°
Real-World Occurrence¶
- Flight paths across the Pacific (Tokyo → Los Angeles)
- Shipping routes
- Satellite ground tracks
- Any global dataset that doesn't stop at the dateline
Required capabilities¶
loadgeometry-validationantimeridian-handling
Files¶
- Primary:
geometry.geojson - Notes:
notes.md
Source and license¶
- Source: geocase-curated
- License: MIT
Tags¶
antimeridian dateline edge_case linestring vector
Related cases¶
- Dateline Points Pair --
dateline_points_pair - Wrapped Longitude Point --
wrapped_longitude_point - Classic Antimeridian Polygon --
classic_antimeridian_polygon - Dateline crossing polygon --
dateline_crossing_polygon - Nearby Points Cluster --
nearby_points_cluster