Skip to content

Commit

Permalink
added proj translation to WKT (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrss authored Jul 9, 2022
1 parent 2027a88 commit 62eff29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion stackstac/raster_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Tuple, Union

import affine
import pyproj

IntFloat = Union[int, float]
Bbox = Tuple[IntFloat, IntFloat, IntFloat, IntFloat]
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion stackstac/rio_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 62eff29

Please sign in to comment.