Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions docs/source/user_guide/attrs_contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,26 @@ write.
- EPSG code of the horizontal CRS, when one can be resolved.
* - ``crs_wkt``
- str
- WKT2 string of the horizontal CRS. Always present on read when
any CRS information is available, and treated as the canonical
CRS representation when both ``crs`` and ``crs_wkt`` are set.
- WKT string of the horizontal CRS. Present on read when any CRS
information is available, and treated as the canonical CRS
representation when both ``crs`` and ``crs_wkt`` are set. The
dialect depends on the source: paths that synthesise a WKT from
an EPSG code via pyproj emit WKT2; paths that read a WKT
verbatim from the file (e.g. a VRT ``SRS`` tag) carry whatever
dialect was stored.
* - ``transform``
- tuple
- ``(origin_x, pixel_width, 0, origin_y, 0, pixel_height)``
affine transform tuple matching the GDAL ordering. Omitted for
files with no ``ModelTransformation`` / ``ModelPixelScale`` /
``ModelTiepoint`` tags.
- ``(pixel_width, 0.0, origin_x, 0.0, pixel_height, origin_y)``
affine transform tuple matching the rasterio ``Affine`` ordering.
Omitted for files with no ``ModelTransformation`` /
``ModelPixelScale`` / ``ModelTiepoint`` tags.
* - ``nodata``
- scalar
- Numeric NoData sentinel. Emitted by readers when the file
carries a ``GDAL_NODATA`` tag, and consumed by writers as the
primary nodata source.
primary nodata source. The read-side precedence chain is
``nodata``, then ``nodatavals``, then ``_FillValue``; see
``_resolve_nodata_attr``.
* - ``raster_type``
- str
- ``'point'`` when the file declares ``RasterPixelIsPoint``;
Expand Down Expand Up @@ -176,11 +182,13 @@ must not assume a specific pass-through key survives a round-trip.
- Raw ``ColorMap`` TIFF tag (tag id 320) values.
* - ``colormap_rgba``
- array
- Decoded RGBA colormap, when one is present.
- Decoded RGBA colormap. Emitted only when the file's photometric
interpretation is ``Photometric == 3`` (palette).
* - ``cmap``
- ``matplotlib.colors.ListedColormap``
- Matplotlib colormap built from ``colormap_rgba``. Present only
when matplotlib is importable.
when matplotlib is importable and the same ``Photometric == 3``
gate is satisfied.


Round-trip invariants
Expand Down
3 changes: 3 additions & 0 deletions xrspatial/geotiff/tests/test_attrs_contract_aliases_1984.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
from xrspatial.geotiff._attrs import _resolve_nodata_attr


# Arbitrary float-castable sentinel that is distinct from any data value
# used below. The value itself does not matter; the tests assert it
# survives the alias resolver and the round-trip.
_SENTINEL = -9999.0


Expand Down
Loading