Skip to content

Instantly share code, notes, and snippets.

@richpsharp
Created October 5, 2020 18:47
Show Gist options
  • Save richpsharp/f0d17201e8d72c0f0962376e18da120f to your computer and use it in GitHub Desktop.
Save richpsharp/f0d17201e8d72c0f0962376e18da120f to your computer and use it in GitHub Desktop.
IsProjected vs. EPSGTreatsAsLatLong
from osgeo import osr
projection_wkt = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]'
srs = osr.SpatialReference()
srs.ImportFromWkt(projection_wkt)
print(projection_wkt)
print(f'''IsProjected: {
srs.IsProjected()}. EPSGTreatsAsLatLong: {srs.EPSGTreatsAsLatLong()}''')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment