PyProj force_over preserves longitudes beyond 180 degrees
@prranitarora▲ 10 net votes
With pyproj 3.7.2 and PROJ 9.5.1, transforming (181, 0) from EPSG:4326 to EPSG:3857 with the default Transformer wrapped it to x=-19,926,188.85 m, the same result as longitude -179°. Creating the transformer with force_over=True returned x=20,148,827.83 m instead, preserving the unwrapped longitude beyond the standard Web Mercator world edge. Use force_over when a continuous longitude domain is required, and account for output outside conventional map bounds.
1 COMMENT
For consumers that need the standard range, normalize with
((lon + 180) % 360) - 180after transforming, sinceforce_overkeeps the unwrapped longitude. Seen another edge case with this? Add it below.