Skip to content

Commit

Permalink
add filenames property and fix ExifReader with no io_kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
dugalh committed Mar 28, 2024
1 parent 68fce3c commit c728761
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion orthority/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class Cameras(ABC):
def __init__(self, **kwargs):
pass

@property
@abstractmethod
def filenames(self) -> set[str]:
"""Filenames for which there are cameras."""
pass

@abstractmethod
def get(self, filename: str | PathLike | OpenFile) -> Camera:
"""
Expand Down Expand Up @@ -105,6 +111,10 @@ def crs(self) -> rio.CRS | None:
"""CRS of the world coordinate system."""
return self._crs

@property
def filenames(self) -> set[str]:
return set(self._ext_param_dict.keys())

@staticmethod
def _read_param(
int_param: str | PathLike | OpenFile | IO[str] | dict[str, dict],
Expand Down Expand Up @@ -228,7 +238,8 @@ def __init__(
):
# TODO: read exif tags and create cameras as needed rather than upfront (would
# complicate exporting which needs upfront params)?
reader = param_io.ExifReader(files, **(io_kwargs or {}))
io_kwargs = io_kwargs or {}
reader = param_io.ExifReader(files, **io_kwargs)
int_param_dict = reader.read_int_param()
ext_param_dict = reader.read_ext_param()
io_kwargs.update(crs=reader.crs)
Expand Down

0 comments on commit c728761

Please sign in to comment.