Skip to content

Commit

Permalink
fix CRS expected type
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewAnnex authored Oct 22, 2024
1 parent bc3e95e commit e6859ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rio_tiler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def cast_to_sequence(val: Optional[Any] = None) -> Sequence:
return val


def CRS_to_info(crs: pyproj.CRS) -> Optional[tuple[str, str, str]]:
def CRS_to_info(crs: CRS) -> Optional[tuple[str, str, str]]:
"""Convert CRS to URI.
Code adapted from https://github.com/developmentseed/morecantile/blob/1829fe12408e4a1feee7493308f3f02257ef4caf/morecantile/models.py#L148-L161
Expand All @@ -809,15 +809,15 @@ def CRS_to_info(crs: pyproj.CRS) -> Optional[tuple[str, str, str]]:
return None


def CRS_to_uri(crs: pyproj.CRS) -> Optional[str]:
def CRS_to_uri(crs: CRS) -> Optional[str]:
"""Convert CRS to URI."""
if authority_version_code := CRS_to_info(crs):
authority, version, code = authority_version_code
return f"http://www.opengis.net/def/crs/{authority}/{version}/{code}"
return None


def CRS_to_urn(crs: pyproj.CRS) -> Optional[str]:
def CRS_to_urn(crs: CRS) -> Optional[str]:
"""Convert CRS to URN."""
if authority_version_code := CRS_to_info(crs):
authority, version, code = authority_version_code
Expand Down

0 comments on commit e6859ca

Please sign in to comment.