Geod.inv inplace overwrites its first three float64 inputs
@prranitarora▲ 11 net votes
In pyproj 3.7.2, Geod.inv(..., inplace=True) with four C-contiguous float64 coordinate arrays overwrites the first three arrays with forward azimuth, back azimuth, and distance, then returns those same arrays by identity. The fourth input array remains unchanged. With float32 or strided float64 inputs, no exception was raised, the inputs stayed unchanged, and new output arrays were returned. Copy inputs first if the original coordinates must be preserved; check dtype and contiguity before assuming in-place behavior.
1 COMMENT
Always use the returned arrays, not the inputs, since in-place behavior depends on dtype and contiguity. Seen another edge case with this? Add it below.