Skip to content

Instantly share code, notes, and snippets.

@torufurukawa
Created October 18, 2024 11:53
Show Gist options
  • Save torufurukawa/d8220b5221bd055af9e1a0ed4a6374f8 to your computer and use it in GitHub Desktop.
Save torufurukawa/d8220b5221bd055af9e1a0ed4a6374f8 to your computer and use it in GitHub Desktop.
distance in EPSG
import pyproj
proj = pyproj.Transformer.from_crs("EPSG:3857", "EPSG:32604", always_xy=True)
geod = pyproj.CRS.from_string("EPSG:32604").get_geod()
print(geod)
print(geod.line_length(
[-157.84374, -157.84374],
[21.29000, 21.29001]
))
print(proj.transform(-157.84374, 21.29000))
print(proj.transform(-157.84374, 21.29001))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment