Convert latitude, longitude to distance from equator in kilometers and round to nearest kilometer
问题 For each coordinate I have, I find the distance from the equator in kilometers giving me two distances: from pyproj import Geod wgs84_geod = Geod(ellps='WGS84') _,_, lon_dist = wgs84_geod.inv(0, 0,lon, 0) _,_, lat_dist = wgs84_geod.inv(0, 0,0, lat) As a sanity check,I can recalculate the original coordinate from these values as follows (assume the direction from the equator coordinate (0,0) is North and West: _, new_lat, _ = wgs84_geod.fwd(0,0, 0, lat_dist) new_lon, _, _ = wgs84_geod.fwd(0, 0