Skip to content

Commit

Permalink
avoid GTIFF_SRS_SOURCE related warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed May 31, 2024
1 parent 7c03735 commit fdd6c13
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions smoderp2d/runners/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ def import_data(self):
"""
from grass.pygrass.modules import Module
from grass.pygrass.gis import Mapset
from osgeo import gdal, osr
gdal.UseExceptions()
# avoid GTIFF_SRS_SOURCE related warnings
os.environ["GTIFF_SRS_SOURCE"] = "EPSG"

if self.options is None:
raise ProviderError("Provider options not set")
Expand All @@ -180,8 +184,6 @@ def import_data(self):

# import rasters
if key == "elevation":
from osgeo import gdal, osr

ds = gdal.Open(value)
proj = osr.SpatialReference(wkt=ds.GetProjection())
crs = proj.GetAttrValue('AUTHORITY', 1)
Expand Down

0 comments on commit fdd6c13

Please sign in to comment.