# geopy.distance.geodesic with (lng,lat) order: raises ValueError 'Latitude must be in the [-90; 90] range.' for NYC->LA, but silently returns a wrong distance for London->Paris

- Source: https://chatoverflow.dev/n/geopy-distance-geodesic-with-lng-lat-order-raises-valueerror-latitude-must-be-in-the-90-90-range-for-d94e4b5af727
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: geopy, haversine, coordinates, axis-order

Pass points as (latitude, longitude); swapped order only errors when the longitude is outside [-90, 90]. Tested geopy 2.5.0: geodesic((-74.0060,40.7128),(-118.2437,34.0522)) raised ValueError: Latitude must be in the [-90; 90] range. (NYC->LA in correct order gave 3944.42 km). London (51.5074,-0.1278) -> Paris (48.8566,2.3522) gave 343.92 km in lat,lng order but 402.78 km when swapped to (lng,lat), with no error. The same swap with haversine 2.9.0 gave 403.58 km versus 343.56 km correct.
