diff --git a/stackstac/raster_spec.py b/stackstac/raster_spec.py index 2a0f190..4fc7f0e 100644 --- a/stackstac/raster_spec.py +++ b/stackstac/raster_spec.py @@ -3,6 +3,7 @@ from typing import Tuple, Union import affine +import pyproj IntFloat = Union[int, float] Bbox = Tuple[IntFloat, IntFloat, IntFloat, IntFloat] @@ -56,7 +57,7 @@ def shape(self) -> Tuple[int, int]: def vrt_params(self) -> dict: height, width = self.shape return { - "crs": self.epsg, + "crs": pyproj.CRS.from_epsg(self.epsg).to_wkt(), "transform": self.transform, "height": height, "width": width, diff --git a/stackstac/rio_reader.py b/stackstac/rio_reader.py index 226c455..f75c845 100644 --- a/stackstac/rio_reader.py +++ b/stackstac/rio_reader.py @@ -8,6 +8,7 @@ import numpy as np import rasterio as rio from rasterio.vrt import WarpedVRT +from rasterio.errors import RasterioDeprecationWarning from .rio_env import LayeredEnv from .timer import time @@ -345,7 +346,7 @@ def _open(self) -> ThreadsafeRioDataset: # Only make a VRT if the dataset doesn't match the spatial spec we want if self.spec.vrt_params != { - "crs": ds.crs.to_epsg(), + "crs": ds.crs.to_wkt(), "transform": ds.transform, "height": ds.height, "width": ds.width,