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) + 1and 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:
- Return type:
- Returns:
A densified polygon in EPSG –
- Raises:
DensificationError – If a segment cannot be densified.
TypeError – If the argument is not a Shapely polygon.