Skip to content

Instantly share code, notes, and snippets.

View john-science's full-sized avatar

John Stilley john-science

View GitHub Profile
@john-science
john-science / proj4_2_wkt.py
Last active May 11, 2021 06:26
Converting Proj4 String to Well-Known Text
from osgeo.osr import SpatialReference
"""
A quick script to get the Well-Known Text from a proj4 string.
"""
# build a spatial reference
sr = SpatialReference()
# enter the proj4 string
valid_code = sr.ImportFromProj4('+proj=lcc +lat_1=25 +lat_2=25 +lat_0=25.0 +lon_0=-95.0 +R=6371229.0')