itacart.boundary.crosses_antemeridian

itacart.boundary.crosses_antemeridian(geometry)[source]

Whether a geometry spans the 180th meridian.

Called by itacart.geometry.polyfill() before descent, so the caller gets AntemeridianError rather than a silently truncated cell set.

Asked of the geometry as given, not of any cell it may cover. A ring written with longitudes past 180 degrees – the natural way to describe an extension-zone footprint – does not cross: it lies on one side already. What crosses is a ring whose consecutive vertices jump more than half the globe, which is what wrapping into [-180, 180] does to a shape spanning the line.

Parameters:

geometry (BaseGeometry) – A Shapely geometry in EPSG:4326.

Return type:

bool

Returns:

True if the geometry crosses 180 degrees longitude.