Skip to content

Commit

Permalink
make the crs info function private
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Oct 22, 2024
1 parent 0bb7f0b commit 43b36f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 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: CRS) -> Optional[Tuple[str, str, str]]:
def _CRS_authority_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 @@ -811,8 +811,8 @@ def CRS_to_info(crs: CRS) -> Optional[Tuple[str, str, str]]:

def CRS_to_uri(crs: CRS) -> Optional[str]:
"""Convert CRS to URI."""
if crs_info := CRS_to_info(crs):
authority, version, code = crs_info
if info := _CRS_authority_info(crs):
authority, version, code = info

return f"http://www.opengis.net/def/crs/{authority}/{version}/{code}"

Expand All @@ -821,8 +821,8 @@ def CRS_to_uri(crs: CRS) -> Optional[str]:

def CRS_to_urn(crs: CRS) -> Optional[str]:
"""Convert CRS to URN."""
if crs_info := CRS_to_info(crs):
authority, version, code = crs_info
if info := _CRS_authority_info(crs):
authority, version, code = info
if version == "0":
version = ""

Expand Down

0 comments on commit 43b36f6

Please sign in to comment.