Last active
January 11, 2023 16:48
-
-
Save esutton/2a4c0aa26bf8fd57916fb3603cce47c8 to your computer and use it in GitHub Desktop.
NAD83 to WGS84 - Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gis.stackexchange.com/questions/304231/converting-nad83-epsg4269-to-wgs84-epsg4326-using-pyproj | |
# Output: | |
# (-80.00001, 40.00001) | |
# (-80.00001904501643, 40.00003299028925) | |
# (-80.00001618601023, 40.00001788467985) | |
# | |
# projections, datums, transformations, coordinates | |
from pyproj import Proj, transform | |
p2 = Proj(init='epsg:4326') | |
# no offsets | |
p1 = Proj(init='epsg:4269') | |
# method: coordinate frame | |
p1cf = Proj(proj='latlong', ellps='GRS80', datum='NAD83', towgs84='-0.9956,1.9013,0.5215,-0.025915,-0.009426,-0.0011599,-0.00062') | |
# method: position vector | |
p1pv = Proj(proj='latlong', ellps='GRS80', datum='NAD83', towgs84='-0.9956,1.9013,0.5215,0.025915,0.009426,0.0011599,-0.00062') | |
print(transform(p1, p2 , -80.00001, 40.00001)) | |
print(transform(p1cf, p2 , -80.00001, 40.00001)) | |
print(transform(p1pv, p2 , -80.00001, 40.00001)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment