|
| 1 | +import logging |
| 2 | +import os |
| 3 | +from collections.abc import Iterable, Sequence |
| 4 | +from types import TracebackType |
| 5 | +from typing import Any, Final, Self |
| 6 | +from typing_extensions import deprecated |
| 7 | + |
| 8 | +from rasterio._affine_types import Affine |
| 9 | +from rasterio._path import _ParsedPath, _UnparsedPath |
| 10 | +from rasterio._typing import Colormap, CRSInput, _OpenOption |
| 11 | +from rasterio.control import GroundControlPoint |
| 12 | +from rasterio.coords import BoundingBox |
| 13 | +from rasterio.crs import CRS |
| 14 | +from rasterio.enums import ColorInterp, Compression, Interleaving, MaskFlags, PhotometricInterp |
| 15 | +from rasterio.profiles import Profile |
| 16 | +from rasterio.rpc import RPC |
| 17 | +from rasterio.windows import Window |
| 18 | + |
| 19 | +log: Final[logging.Logger] |
| 20 | + |
| 21 | +def get_dataset_driver(path: str) -> str: ... |
| 22 | +def driver_supports_mode(drivername: str, creation_mode: str) -> bool: ... |
| 23 | +def driver_can_create(drivername: str) -> bool: ... |
| 24 | +def driver_can_create_copy(drivername: str) -> bool: ... |
| 25 | +def tastes_like_gdal(seq: Affine | Sequence[float]) -> bool: ... |
| 26 | +def _raster_driver_extensions() -> dict[str, str]: ... |
| 27 | +def _can_create_osr(crs: CRSInput) -> bool: ... |
| 28 | +def _transform( |
| 29 | + src_crs: CRSInput, dst_crs: CRSInput, xs: Sequence[float], ys: Sequence[float], zs: Sequence[float] | None |
| 30 | +) -> tuple[list[float], list[float], list[float]]: ... |
| 31 | + |
| 32 | +class DatasetBase: |
| 33 | + name: str |
| 34 | + mode: str |
| 35 | + options: dict[str, Any] |
| 36 | + width: int |
| 37 | + height: int |
| 38 | + shape: tuple[int, int] |
| 39 | + driver: str |
| 40 | + |
| 41 | + def __init__( |
| 42 | + self, |
| 43 | + path: str | os.PathLike[str] | _ParsedPath | _UnparsedPath | None = None, |
| 44 | + driver: str | Sequence[str] | None = None, |
| 45 | + sharing: bool = False, |
| 46 | + thread_safe: bool = False, |
| 47 | + **kwargs: _OpenOption, |
| 48 | + ) -> None: ... |
| 49 | + def __enter__(self) -> Self: ... |
| 50 | + def __exit__( |
| 51 | + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None |
| 52 | + ) -> None: ... |
| 53 | + def read_crs(self) -> CRS | None: ... |
| 54 | + def read_transform(self) -> list[float]: ... |
| 55 | + def start(self) -> None: ... |
| 56 | + def stop(self) -> None: ... |
| 57 | + def close(self) -> None: ... |
| 58 | + @property |
| 59 | + def closed(self) -> bool: ... |
| 60 | + @property |
| 61 | + def count(self) -> int: ... |
| 62 | + @property |
| 63 | + def indexes(self) -> tuple[int, ...]: ... |
| 64 | + @property |
| 65 | + def dtypes(self) -> tuple[str, ...]: ... |
| 66 | + @property |
| 67 | + def block_shapes(self) -> tuple[tuple[int, int], ...]: ... |
| 68 | + def get_nodatavals(self) -> tuple[float | None, ...]: ... |
| 69 | + @property |
| 70 | + def nodatavals(self) -> tuple[float | None, ...]: ... |
| 71 | + |
| 72 | + @property |
| 73 | + def nodata(self) -> float | None: ... |
| 74 | + @nodata.setter |
| 75 | + def nodata(self, value: float | None) -> None: ... |
| 76 | + |
| 77 | + @property |
| 78 | + def mask_flag_enums(self) -> tuple[list[MaskFlags], ...]: ... |
| 79 | + |
| 80 | + @property |
| 81 | + def crs(self) -> CRS: ... |
| 82 | + @crs.setter |
| 83 | + def crs(self, value: CRSInput) -> None: ... |
| 84 | + |
| 85 | + @property |
| 86 | + def descriptions(self) -> tuple[str | None, ...]: ... |
| 87 | + @descriptions.setter |
| 88 | + def descriptions(self, value: Sequence[str | None]) -> None: ... |
| 89 | + |
| 90 | + def write_transform(self, transform: Sequence[float]) -> None: ... |
| 91 | + |
| 92 | + @property |
| 93 | + def transform(self) -> Affine: ... |
| 94 | + @transform.setter |
| 95 | + def transform(self, value: Affine) -> None: ... |
| 96 | + |
| 97 | + @property |
| 98 | + def offsets(self) -> tuple[float, ...]: ... |
| 99 | + @offsets.setter |
| 100 | + def offsets(self, value: Sequence[float]) -> None: ... |
| 101 | + |
| 102 | + @property |
| 103 | + def scales(self) -> tuple[float, ...]: ... |
| 104 | + @scales.setter |
| 105 | + def scales(self, value: Sequence[float]) -> None: ... |
| 106 | + |
| 107 | + @property |
| 108 | + def units(self) -> tuple[str | None, ...]: ... |
| 109 | + @units.setter |
| 110 | + def units(self, value: Sequence[str | None]) -> None: ... |
| 111 | + |
| 112 | + def block_window(self, bidx: int, i: int, j: int) -> Window: ... |
| 113 | + def block_size(self, bidx: int, i: int, j: int) -> int: ... |
| 114 | + def block_windows(self, bidx: int = 0) -> Iterable[tuple[tuple[int, int], Window]]: ... |
| 115 | + @property |
| 116 | + def bounds(self) -> BoundingBox: ... |
| 117 | + @property |
| 118 | + def res(self) -> tuple[float, float]: ... |
| 119 | + @property |
| 120 | + def meta(self) -> dict[str, Any]: ... |
| 121 | + @property |
| 122 | + def compression(self) -> Compression | None: ... |
| 123 | + @property |
| 124 | + def interleaving(self) -> Interleaving | None: ... |
| 125 | + @property |
| 126 | + def photometric(self) -> PhotometricInterp | None: ... |
| 127 | + @property |
| 128 | + @deprecated("DatasetBase.is_tiled will be removed in a future rasterio release; inspect block_shapes / profile directly.") |
| 129 | + def is_tiled(self) -> bool: ... |
| 130 | + @property |
| 131 | + def profile(self) -> Profile: ... |
| 132 | + def lnglat(self) -> tuple[float, float]: ... |
| 133 | + def get_transform(self) -> list[float]: ... |
| 134 | + @property |
| 135 | + def subdatasets(self) -> list[str]: ... |
| 136 | + def tag_namespaces(self, bidx: int = 0) -> list[str]: ... |
| 137 | + def tags(self, bidx: int = 0, ns: str | None = None) -> dict[str, str]: ... |
| 138 | + def get_tag_item(self, ns: str, dm: str | None = None, bidx: int = 0, ovr: int | None = None) -> str | None: ... |
| 139 | + |
| 140 | + @property |
| 141 | + def colorinterp(self) -> tuple[ColorInterp, ...]: ... |
| 142 | + @colorinterp.setter |
| 143 | + def colorinterp(self, value: Sequence[ColorInterp]) -> None: ... |
| 144 | + |
| 145 | + def colormap(self, bidx: int) -> Colormap: ... |
| 146 | + def overviews(self, bidx: int) -> list[int]: ... |
| 147 | + def checksum(self, bidx: int, window: Window | None = None) -> int: ... |
| 148 | + def get_gcps(self) -> tuple[list[GroundControlPoint], CRS]: ... |
| 149 | + |
| 150 | + @property |
| 151 | + def gcps(self) -> tuple[list[GroundControlPoint], CRS]: ... |
| 152 | + @gcps.setter |
| 153 | + def gcps(self, value: tuple[Sequence[GroundControlPoint], CRSInput]) -> None: ... |
| 154 | + |
| 155 | + @property |
| 156 | + def rpcs(self) -> RPC | None: ... |
| 157 | + @rpcs.setter |
| 158 | + def rpcs(self, value: RPC | None) -> None: ... |
| 159 | + |
| 160 | + @property |
| 161 | + def files(self) -> list[str]: ... |
| 162 | + |
| 163 | +_GDAL_AT_LEAST_3_10: Final[bool] |
| 164 | + |
| 165 | +complex64: Final[str] |
| 166 | +complex128: Final[str] |
| 167 | +complex_int16: Final[str] |
| 168 | +float32: Final[str] |
| 169 | +float64: Final[str] |
| 170 | +int16: Final[str] |
| 171 | + |
| 172 | +def _parse_path(path: str) -> _ParsedPath | _UnparsedPath: ... |
0 commit comments