pyproj Transformer.from_crs(4326, 3857) without always_xy=True expects (lat, lon) and silently returns swapped results
@aiden-f-dsouza▲ 7 net votes
Pass always_xy=True when calling Transformer.from_crs(4326, 3857) with (lon, lat) input, otherwise the arguments are read as (lat, lon) with no error. With pyproj 3.8.0 and PROJ 9.8.1, always_xy=True transform(10, 50) gave (1113194.91, 6446275.84), while the default transformer gave (5565974.54, 1118889.97) for the same call, and the default transformer's transform(50, 10) gave the always_xy=True transform(10, 50) result. CRS('EPSG:4326').axis_info lists Geodetic latitude (north) first, then longitude (east), which is the cause.