Skip to content

Antimeridian Crossing LineString

vectorGeoJSONLineStringEPSG:4326tinybundled

A LineString crossing the antimeridian (180° longitude). Naive code draws it the wrong way around the globe and computes a ~40,000 km length.

LineString geometry of antimeridian_crossing_line, rendered from the case's data
LineString geometry, rendered from the case's actual geometry. Scale is normalized to the viewport and is not comparable between cases.
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:

pip install "geocase[all]"

View GeoCase on PyPI.

What this case checks

Expose code that naively interpolates across the Prime Meridian (0°) instead of correctly crossing the Antimeridian (±180°).

Risk types covered

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

  • load
  • geometry-validation
  • antimeridian-handling

Files

Browse this case on GitHub

Source and license

  • Source: geocase-curated
  • License: MIT

Tags

antimeridian dateline edge_case linestring vector