itacart.geometry.densify_orthodromic

itacart.geometry.densify_orthodromic(polygon, max_segment_m=1000.0)[source]

Insert intermediate vertices along geodesics.

Applied to the exterior ring and every hole, with n_segments = floor(d_geo / max_segment_m) + 1 and points equally spaced in geodesic distance.

Needed because a straight line on the sinusoidal plane is not a geodesic on the ellipsoid; without densification a long edge would fill the wrong cells in between.

Holes are densified too. The origin drops them, which is silent: the filled cell set comes back plausible and includes the hole.

Provenance: itacart_core/densification.py.

Parameters:
  • polygon (Polygon) – A Shapely polygon in EPSG:4326.

  • max_segment_m (float, default: 1000.0) – Longest segment to leave undensified, in metres.

Return type:

Polygon

Returns:

A densified polygon in EPSG –

Raises: