From cf8978241bcd39ef6119a35e0df6d42d899ada9c Mon Sep 17 00:00:00 2001 From: "Gregory H. Halverson" Date: Tue, 24 Nov 2026 12:31:47 -0800 Subject: [PATCH] updating README with citation, history, known issues --- README.md | 58 ++- makefile | 141 +++++- ...deprecation resolution development plan.md | 310 ------------ notes/2026-11-24 rasters known issues.md | 109 ++++ .../2026-11-24 rasters repository history.md | 160 ++++++ readme_update.md | 467 ++++++++++++++++++ 6 files changed, 900 insertions(+), 345 deletions(-) delete mode 100644 notes/2026-11-16 deprecation resolution development plan.md create mode 100644 notes/2026-11-24 rasters known issues.md create mode 100644 notes/2026-11-24 rasters repository history.md create mode 100644 readme_update.md diff --git a/README.md b/README.md index 5fb5512..497ec45 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,22 @@ This Python software package provides a comprehensive solution for handling grid [Gregory H. Halverson](https://github.com/gregory-halverson-jpl) (they/them)
[gregory.h.halverson@jpl.nasa.gov](mailto:gregory.h.halverson@jpl.nasa.gov)
-NASA Jet Propulsion Laboratory 329G +NASA Jet Propulsion Laboratory 321H + +## Citing this Package + +If you use `rasters` in your research or software pipelines, please cite it using the following BibTeX entry: + +```bibtex +@software{halverson_rasters_2026, + author = {Halverson, Gregory H.}, + title = {rasters: Object-Oriented Gridded and Swath Raster Processing Toolkit for Python}, + year = {2026}, + version = {1.21.0}, + publisher = {GitHub}, + url = {https://github.com/python-rasters/rasters} +} +``` The software addresses several challenges in the field. It makes swath remote sensing datasets more accessible and easier to work with. It also associates coordinate reference systems with vector geometries, simplifying transformations between projections. @@ -37,7 +52,7 @@ This software improves over the rasterio package by encapsulating rasters as obj This software solves the problem of swath remote sensing datasets being inaccessible and difficult to work with. This software solves the problem of vector geometries in python not having coordinate reference systems associated with them. The software is inspired by and intended to be a python equivalent for the raster package in R and the Rasters.jl package in Julia. -### Does your work relate to current or future NASA (include reimbursable) work that has value to the conduct of aeronautical and space activities?  If so, please explain: +### Does your work relate to current or future NASA (include reimbursable) work that has value to the conduct of aeronautical and space activities? If so, please explain: This software package was developed as part of a research grant by the NASA Research Opportunities in Space and Earth Sciences (ROSES) program. This software was designed for use by the Ecosystem Spaceborne Thermal Radiometer Experiment on Space Station (ECOSTRESS) mission as a precursor for the Surface Biology and Geology (SBG) mission, but it may be useful generally for remote sensing and GIS projects in python. @@ -63,7 +78,7 @@ This software is written entirely in python and intended to be distributed using This software has been deployed for ECOSTRESS and ET-Toolbox. -### Please identify the customer(s) and sponsors(s) outside of your section that requested and are using your software.  +### Please identify the customer(s) and sponsors(s) outside of your section that requested and are using your software. This package is being released according to the SPD-41 open-science requirements of NASA-funded ROSES projects. @@ -417,9 +432,36 @@ masked_raster = raster.mask(mask) # Fill masked values with another raster filled = raster.fill(fill_raster) ``` - -## Changelog - -### 1.1.0 -The `KDTree` class can now save to file with the `.save` method and load from file with the `KDTree.load` class method. +## History + +* **`v1.0.2` – `v1.2.0` (June – September 2024):** Launched as a single-file package (`rasters/rasters.py`) adapted from ECOSTRESS workflows at NASA JPL. Refactored vector geometry classes (`Point`, `MultiPoint`, `Polygon`, `MultiPolygon`) from Shapely inheritance to composition with explicit CRS tracking, added `msgpack` serialization (`KDTree.save()` and `KDTree.load()`), added `.wkt` representations, and switched swath point lookup to `scipy.spatial.cKDTree`. +* **`v1.3.0` – `v1.4.6` (September 2024 – February 2025):** Split the monolith into dedicated single-responsibility modules (`CRS.py`, `bbox.py`, `point.py`, `polygon.py`, `kdtree.py`, `raster.py`, `raster_grid.py`, `raster_geolocation.py`, etc.), dropped the deprecated `pygeos` dependency in favor of `shapely` 2.x, added point extraction via `Raster.open(..., geometry=Point)`, added grid shifting (`RasterGrid.shift_xy()`, `shift_distance()`), and resolved macOS `pykdtree` build issues (`pykdtree>=1.3.11`). +* **`v1.5.0` – `v1.16.1` (April – November 2025):** Added `linear_downscale()` and `bias_correct()`, configurable resampling in `mosaic()`, `MultiPoint` extraction in `Raster.open()`, `RasterGeolocation.window()` and `.subset()`, square-bracket geometry indexing (`grid[polygon]`, `geolocation[window]`), `GeoSeries` to `MultiPoint` wrapping, `Point.lat`/`Point.lon` properties, `RasterGrid` bounds properties (`xmin`, `xmax`, `ymin`, `ymax`), and multi-raster mosaicking/masking fixes. +* **`v1.17.0` – `v1.21.0` (January – November 2026):** Expanded module docstrings and documentation, added `BBox.boundary_latlon`, expanded CI test coverage across Python `3.11`–`3.14`, fixed `BBox` handling in `wrap_geometry()`, and resolved deprecation warnings under Shapely 2.2+ (`shapely.transform()`), `affine` 2.4+ (`@` matrix multiplication), and NumPy 2.0+ (`__array_wrap__`). + +## Known Issues + +The following known issues are tracked in the [GitHub issue tracker](https://github.com/python-rasters/rasters/issues) as of `v1.21.0`: + +* **Vector & Geometry Edge Cases:** + * Calling `Polygon()` or `MultiPolygon()` with no arguments raises an `IndexError` instead of initializing an empty geometry ([#74](https://github.com/python-rasters/rasters/issues/74)). + * `RasterGeometry.point` returns a `ValueError` instance rather than raising it when the geometry is not a single cell ([#78](https://github.com/python-rasters/rasters/issues/78)). + * `BBox.round` truncates coordinates to whole integers without supporting an `ndigits` precision argument ([#85](https://github.com/python-rasters/rasters/issues/85)). + * `rasters/local_UTM_proj4_from_lat_lon.py` is an orphaned stub file with an empty function definition superseded by `rasters/local_UTM_proj4.py` ([#71](https://github.com/python-rasters/rasters/issues/71)). +* **Raster Indexing, Slicing & Grid Operations:** + * `Raster.__setitem__()` fails on slice and tuple-slice assignments (`raster[0:5] = 0`, `raster[0:5, 0:5] = 0`) ([#75](https://github.com/python-rasters/rasters/issues/75)). + * Single-dimension indexing (`raster[0]` or `raster[0:5]`) raises a `TypeError` in `Raster._key()` ([#76](https://github.com/python-rasters/rasters/issues/76)). + * `Raster._slice()` mutates array view shapes in-place (`result.shape = new_shape`), failing on non-contiguous slices ([#82](https://github.com/python-rasters/rasters/issues/82)). + * `RasterGrid.resolution()` raises a `TypeError` when passed a scalar `float` instead of a tuple ([#77](https://github.com/python-rasters/rasters/issues/77)). + * `Raster.origin` delegates to a nonexistent `self.geometry.origin` attribute ([#79](https://github.com/python-rasters/rasters/issues/79)). + * `Raster.rescale()` resizes the data array to the original `(self.rows, self.cols)` shape instead of the target `(geometry.rows, geometry.cols)` shape ([#83](https://github.com/python-rasters/rasters/issues/83)). +* **MultiRaster, Mosaicking & Reprojection:** + * `MultiRaster.contain()` / `MultiRaster.__init__()` nests `metadata` under a `"metadata"` key instead of unpacking it ([#80](https://github.com/python-rasters/rasters/issues/80)). + * `Raster.to_grid()` raises a `TypeError` on boolean rasters when `nodata` is `None` ([#81](https://github.com/python-rasters/rasters/issues/81)). + * `mosaic()` fails on generator/iterator inputs and evaluates `geometry.shape` before resolving default geometry from `images[0]` ([#84](https://github.com/python-rasters/rasters/issues/84)). +* **File I/O, Testing & Warnings:** + * `Raster.from_geotiff()` calls a nonexistent `cls.from_file()` method and rejects `.tiff` extensions due to operator precedence ([#72](https://github.com/python-rasters/rasters/issues/72)). + * `Raster.to_COG()` invokes `gdal_translate` via `os.system()` without checking exit status and uses naive `.replace(".tif", ".temp.tif")` path substitution ([#87](https://github.com/python-rasters/rasters/issues/87)). + * `RasterGeometry` uses `warnings.filterwarnings('ignore')` followed by `warnings.resetwarnings()` instead of `with warnings.catch_warnings()`, clearing external warning filters ([#86](https://github.com/python-rasters/rasters/issues/86)). + * `tests/test_write_geotiff.py` is currently an empty placeholder without GeoTIFF write tests ([#73](https://github.com/python-rasters/rasters/issues/73)). \ No newline at end of file diff --git a/makefile b/makefile index b285129..c904d12 100644 --- a/makefile +++ b/makefile @@ -1,45 +1,132 @@ -# Python version for environment creation -PYTHON_VERSION ?= 3.14 +# Define the package name, module name, environment name, and Python version +PACKAGE_NAME = rasters +MODULE_NAME = $(subst -,_,$(PACKAGE_NAME)) +ENVIRONMENT_NAME = $(PACKAGE_NAME) +PYTHON_VERSION = $(if $(PYTHON),$(PYTHON),3.13) -.PHONY: clean test build twine-upload dist environment install uninstall reinstall test +# Allow passing extra flags via command line: make ARGS="-k test_name" +ARGS ?= -clean: +# Include a Makefile.local to override things, if found +-include Makefile.local + +.DEFAULT_GOAL := help + +.PHONY: help clean test build wheel sdist twine-upload dist \ + install uninstall reinstall environment remove-environment \ + repomix generate-history show-issues + +help: ## Show available targets + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-28s\033[0m %s\n", $$1, $$2}' + +##@ Cleanup & Environment +clean: ## Remove build artifacts, caches, coverage files, and logs rm -rf *.o *.out *.log rm -rf build/ rm -rf dist/ rm -rf *.egg-info rm -rf .pytest_cache + rm -rf htmlcov/ .coverage + rm -rf $(PACKAGE_NAME)-repomix.xml repomix-output.xml release_diffs.patch find . -type d -name "__pycache__" -exec rm -rf {} + + find . -type f -name "*.py[co]" -delete -test: - pytest +environment: ## Create a new Conda/Mamba environment (override with PYTHON=3.12) + mamba create -y -n $(ENVIRONMENT_NAME) -c conda-forge python=$(PYTHON_VERSION) jupyter -build: - python -m build +remove-environment: ## Remove the Conda/Mamba environment + mamba env remove -y -n $(ENVIRONMENT_NAME) -twine-upload: - twine upload dist/* +install: ## Install the package in editable mode with development dependencies + pip install -e .[dev] -dist: - make clean - make build - make twine-upload +uninstall: ## Uninstall the package + pip uninstall -y $(PACKAGE_NAME) -environment: - mamba create -y -n rasters python=$(PYTHON_VERSION) jupyter +reinstall: ## Reinstall the package (uninstall and then install) + $(MAKE) uninstall + $(MAKE) install -remove-environment: - mamba env remove -y -n rasters +##@ Testing & Verification +test: ## Run Python unit tests using pytest + pytest -vv $(ARGS) -install: - pip install -e .[dev] +##@ Packaging & Release +wheel: ## Build the Python wheel + python -m build --wheel + +sdist: ## Build the Python source distribution + python -m build --sdist + +build: ## Build the Python wheel and source distribution + python -m build + +twine-upload: ## Upload the built package to PyPI using Twine + twine upload dist/* + +dist: ## Clean, build, and upload the package to PyPI + $(MAKE) clean + $(MAKE) build + $(MAKE) twine-upload -uninstall: - pip uninstall -y rasters +##@ Utilities +repomix: ## Pack repository context for LLM review + npx repomix -o $(PACKAGE_NAME)-repomix.xml --ignore "**/*.tif,**/*.tiff,**/*.png,**/*.jpg,**/*.jpeg,**/*.aux.xml,**/*.csv,**/*.pdf,**/*.svg,**/*.ipynb,*-repomix*.xml,repomix-output.xml,release_diffs.patch" --copy -reinstall: - make uninstall - make install +generate-history: ## Generate release commit history patch + fish -c ' \ + git fetch --tags --quiet; \ + set first_commit (git rev-list --max-parents=0 HEAD | head -n 1); \ + set releases (gh release list --limit 1000 --json tagName,createdAt --jq "sort_by(.createdAt) | .[].tagName"); \ + begin; \ + echo "========================================"; \ + echo "REPOSITORY RELEASE TIMELINE"; \ + echo "========================================"; \ + gh release list --limit 1000; \ + echo ""; \ + if test (count $$releases) -ge 1; \ + set first_rel $$releases[1]; \ + echo "========================================"; \ + echo "INITIAL COMMIT ($$first_commit) -> FIRST RELEASE ($$first_rel)"; \ + echo "========================================"; \ + git log --reverse --stat -p $$first_rel -- "*.py" "pyproject.toml"; \ + echo ""; \ + end; \ + if test (count $$releases) -ge 2; \ + for i in (seq 2 (count $$releases)); \ + set prev_idx (math $$i - 1); \ + set prev $$releases[$$prev_idx]; \ + set curr $$releases[$$i]; \ + echo "========================================"; \ + echo "RELEASE COMMIT HISTORY: $$prev -> $$curr"; \ + echo "========================================"; \ + git log --reverse --stat -p $$prev..$$curr -- "*.py" "pyproject.toml"; \ + echo ""; \ + end; \ + end; \ + if test (count $$releases) -ge 1; \ + set latest_rel $$releases[-1]; \ + echo "========================================"; \ + echo "LATEST RELEASE ($$latest_rel) -> CURRENT WORKING TREE (HEAD + UNCOMMITTED)"; \ + echo "========================================"; \ + git log --reverse --stat -p $$latest_rel..HEAD -- "*.py" "pyproject.toml"; \ + echo ""; \ + git status -s -- "*.py" "pyproject.toml"; \ + echo ""; \ + git diff HEAD -- "*.py" "pyproject.toml"; \ + else; \ + echo "========================================"; \ + echo "INITIAL COMMIT ($$first_commit) -> CURRENT WORKING TREE"; \ + echo "========================================"; \ + git log --reverse --stat -p -- "*.py" "pyproject.toml"; \ + echo ""; \ + git status -s -- "*.py" "pyproject.toml"; \ + echo ""; \ + git diff HEAD -- "*.py" "pyproject.toml"; \ + end; \ + end > release_diffs.patch; \ + ' -repomix: - npx repomix --ignore "**/*.tif,**/*.png,**/*.jpeg,**/*.aux.xml,**/*.ipynb" \ No newline at end of file +show-issues: ## List open GitHub issues + gh issue list --state open --json number,title,body --template '{{range .}}## #{{.number}}: {{.title}}{{"\n\n"}}{{.body}}{{"\n\n---\n\n"}}{{end}}' \ No newline at end of file diff --git a/notes/2026-11-16 deprecation resolution development plan.md b/notes/2026-11-16 deprecation resolution development plan.md deleted file mode 100644 index 658461c..0000000 --- a/notes/2026-11-16 deprecation resolution development plan.md +++ /dev/null @@ -1,310 +0,0 @@ -# `rasters` Development Plan: Resolve Shapely, `affine`, and NumPy Deprecation Warnings - -**Date:** 2026-11-16 -**Target Repository:** `rasters` (`1.20.0` $\rightarrow$ `1.21.0`) -**Related GitHub Issues:** `#69`, `#47` -**Affected Files:** -- `rasters/vector_geometry.py` -- `rasters/raster_geometry.py` -- `rasters/raster_grid.py` -- `tests/test_vector_geometry.py` -- `pyproject.toml` - ---- - -## 1. Problem Summary - -Running `rasters` under modern Shapely (2.2+), `affine` (2.4+), and NumPy (2.0+) emits deprecation warnings across core geometry and raster operations: - -1. **Shapely `shapely.ops.transform()` (`#69`):** - Calling `VectorGeometry.to_crs()` or evaluating `RasterGeometry.crosses_antimeridian` emits: - ```text - DeprecationWarning: The 'shapely.ops.transform()' function is deprecated. Use 'shapely.transform()' or 'shapely.transform_coordseq()' instead. See [https://shapely.readthedocs.io/en/latest/manual.html#shapely.ops.transform](https://shapely.readthedocs.io/en/latest/manual.html#shapely.ops.transform) for more details. - ``` - Migrating to `shapely.transform()` eliminates the warning and passes `(N, 2)` / `(N, 3)` NumPy coordinate arrays to `pyproj.Transformer.transform` in a single vectorized call rather than vertex-by-vertex Python callbacks. - -2. **`affine` `*` Multiplication (`#69`):** - Composing or applying `affine.Affine` transforms with `*` in `RasterGrid` emits: - ```text - PendingDeprecationWarning: Use `@` matmul instead of `*` mul operator for matrix multiplication - ``` - -3. **NumPy 2.0 `__array_wrap__` (`#47`):** - NumPy 2.0 deprecated `__array_wrap__` implementations that do not accept `context` and `return_scalar` positionally. `Raster.__array_wrap__` in `rasters/raster.py` has already been updated to `def __array_wrap__(self, other, context=None, return_scalar=None, **kwargs)`, so regression tests are needed to verify zero warnings under NumPy 2.x and close `#47`. - ---- - -## 2. Root-Cause Audit - -1. **`rasters/vector_geometry.py` (`VectorGeometry.to_crs`):** - Uses `shapely.ops.transform(Transformer.from_crs(...).transform, self.geometry)` and does not short-circuit when `self.crs == crs`. -2. **`rasters/raster_geometry.py` (`RasterGeometry.crosses_antimeridian`):** - Imports `from shapely.ops import transform as shapely_transform` and calls `shapely_transform(to_polar, feature_shape)`. -3. **`rasters/raster_grid.py` (`Affine` matrix multiplication):** - Uses `*` instead of `@` on `Affine` objects in seven locations: - - `affine_center` (`self.affine * Affine.translation(0.5, 0.5)`) - - `boundary` (`self.affine_center * (x_indices, y_indices)`) - - `x_vector` (`self.affine_center * (...)`) - - `y_vector` (`self.affine_center * (...)`) - - `xy` (`self.affine_center * np.meshgrid(...)`) - - `index_point` (`~self.affine_center * (x, y)`) - - `shift_xy` (`self.affine * Affine.translation(...)`) -4. **`rasters/raster.py` (`Raster.__array_wrap__`):** - Already updated with `(self, other, context=None, return_scalar=None, **kwargs)`; needs explicit ufunc regression coverage. - ---- - -## 3. Development Plan - -### Step 1: Vectorize `VectorGeometry.to_crs()` with `shapely.transform()` (`rasters/vector_geometry.py`) -Add `import numpy as np`, short-circuit identity CRS transformations (`self.crs == crs`), and replace `shapely.ops.transform()` with `shapely.transform(..., include_z=self.geometry.has_z)`: - -```diff ---- a/rasters/vector_geometry.py -+++ b/rasters/vector_geometry.py -@@ -3,6 +3,7 @@ from __future__ import annotations - from typing import Union - - import geopandas as gpd -+import numpy as np - import shapely - from pyproj import Transformer - -@@ -66,9 +67,22 @@ class VectorGeometry(SpatialGeometry): - VectorGeometry: The projected geometry. - """ - crs = CRS(crs) -+ -+ if self.crs == crs: -+ return self -+ -+ transformer = Transformer.from_crs(self.crs, crs, always_xy=True) -+ -+ def _transform_coords(coords: np.ndarray) -> np.ndarray: -+ if coords.shape[0] == 0: -+ return coords -+ x, y = transformer.transform(coords[:, 0], coords[:, 1]) -+ if coords.shape[1] == 3: -+ return np.column_stack([x, y, coords[:, 2]]) -+ return np.column_stack([x, y]) -+ - result = self.contain( -- shapely.ops.transform(Transformer.from_crs(self.crs, crs, always_xy=True).transform, self.geometry), -+ shapely.transform(self.geometry, _transform_coords, include_z=self.geometry.has_z), - crs=crs) - return result -``` - -### Step 2: Update `RasterGeometry.crosses_antimeridian` (`rasters/raster_geometry.py`) -Remove `from shapely.ops import transform as shapely_transform` and update `crosses_antimeridian` to use `shapely.transform()`: - -```diff ---- a/rasters/raster_geometry.py -+++ b/rasters/raster_geometry.py -@@ -12,7 +12,6 @@ from pyproj import Transformer - from rasterio.windows import Window - from scipy.ndimage import shift - from shapely.geometry.base import BaseGeometry --from shapely.ops import transform as shapely_transform - from .local_UTM_proj4 import local_UTM_proj4 - - from .CRS import WGS84 -@@ -529,7 +528,10 @@ class RasterGeometry(SpatialGeometry): - - feature_shape = self.boundary_latlon.geometry - sign = 2. * (0.5 * (feature_shape.bounds[1] + feature_shape.bounds[3]) >= 0.) - 1. -- polar_shape = shapely_transform(to_polar, feature_shape) -+ polar_shape = shapely.transform( -+ feature_shape, -+ lambda coords: np.column_stack(to_polar(coords[:, 0], coords[:, 1])) -+ ) - - self._crosses_antimeridian = polar_shape.intersects(antimeridian_wedge) -``` - -### Step 3: Replace `Affine` `*` with `@` (`rasters/raster_grid.py`) -Update all `Affine` matrix multiplications and coordinate transformations in `RasterGrid` to use the `@` operator: - -```diff ---- a/rasters/raster_grid.py -+++ b/rasters/raster_grid.py -@@ -303,7 +303,7 @@ class RasterGrid(RasterGeometry): - Returns: - Affine: Affine transform object. - """ -- return self.affine * Affine.translation(0.5, 0.5) -+ return self.affine @ Affine.translation(0.5, 0.5) - - @property - def cell_width(self) -> float: -@@ -435,7 +435,7 @@ class RasterGrid(RasterGeometry): - ])) - - y_indices, x_indices = self.boundary_indices -- x_boundary, y_boundary = self.affine_center * (x_indices, y_indices) -+ x_boundary, y_boundary = self.affine_center @ (x_indices, y_indices) - points = np.c_[x_boundary, y_boundary] - boundary = Polygon(points, crs=self.crs) - -@@ -541,7 +541,7 @@ class RasterGrid(RasterGeometry): - Returns: - np.ndarray: Array of x-coordinates. - """ -- return (self.affine_center * (np.arange(self.cols), np.full(self.cols, 0, dtype=np.float32)))[0] -+ return (self.affine_center @ (np.arange(self.cols), np.full(self.cols, 0, dtype=np.float32)))[0] - - @property - def y_vector(self) -> np.ndarray: -@@ -551,7 +551,7 @@ class RasterGrid(RasterGeometry): - Returns: - np.ndarray: Array of y-coordinates. - """ -- return (self.affine_center * (np.full(self.rows, 0, dtype=np.float32), np.arange(self.rows)))[1] -+ return (self.affine_center @ (np.full(self.rows, 0, dtype=np.float32), np.arange(self.rows)))[1] - - @property - def xy(self) -> Tuple[np.ndarray, np.ndarray]: -@@ -561,7 +561,7 @@ class RasterGrid(RasterGeometry): - Returns: - Tuple[np.ndarray, np.ndarray]: Arrays of x and y coordinates. - """ -- return self.affine_center * np.meshgrid(np.arange(self.cols), np.arange(self.rows)) -+ return self.affine_center @ np.meshgrid(np.arange(self.cols), np.arange(self.rows)) - - def index_point(self, point: Point) -> Tuple[int, int]: - """ -@@ -576,7 +576,7 @@ class RasterGrid(RasterGeometry): - native_point = point.to_crs(self.crs) - x = native_point.x - y = native_point.y -- col, row = ~self.affine_center * (x, y) -+ col, row = ~self.affine_center @ (x, y) - col = int(round(col)) - row = int(round(row)) - index = (row, col) -@@ -668,7 +668,7 @@ class RasterGrid(RasterGeometry): - Returns: - RasterGrid: A new RasterGrid with the shift applied. - """ -- new_affine = self.affine * Affine.translation(x_shift / self.cell_size, y_shift / self.cell_size) -+ new_affine = self.affine @ Affine.translation(x_shift / self.cell_size, y_shift / self.cell_size) - grid = RasterGrid.from_affine(new_affine, self.rows, self.cols, self.crs) - - return grid -``` - -### Step 4: Add Regression Tests (`tests/test_vector_geometry.py`) -Create `tests/test_vector_geometry.py` to cover: -- `Point.to_crs()` (2D and 3D Z-preservation), `Polygon.to_crs()`, and empty `MultiPoint.to_crs()` (`#69` Shapely deprecation) -- `RasterGrid.crosses_antimeridian`, `RasterGrid.xy`, `RasterGrid.boundary`, `RasterGrid.index_point()`, and `RasterGrid.shift_xy()` (`#69` Shapely & `affine` `@` deprecations) -- NumPy ufuncs (`np.cos(raster)`, `np.sin(raster)`) on `Raster` (`#47` `__array_wrap__` deprecation) - -```python -import warnings -import numpy as np -from rasters import Point, MultiPoint, Polygon, Raster, RasterGrid, WGS84 - - -def _assert_no_deprecations(caught): - deprecations = [ - w for w in caught - if issubclass(w.category, (DeprecationWarning, PendingDeprecationWarning)) - ] - assert len(deprecations) == 0, [str(w.message) for w in deprecations] - - -def test_point_to_crs_no_deprecation_warning(): - point = Point(-118.5, 34.5, crs=WGS84) - - with warnings.catch_warnings(record=True) as caught: - warnings.simplefilter("always") - projected = point.to_crs("EPSG:32611") - - _assert_no_deprecations(caught) - assert projected.crs.to_epsg() == 32611 - - -def test_point_3d_to_crs_preserves_z(): - point = Point(-118.5, 34.5, 100.0, crs=WGS84) - projected = point.to_crs("EPSG:32611") - - assert projected.geometry.has_z - assert np.isclose(projected.geometry.z, 100.0) - - -def test_polygon_to_crs_no_deprecation_warning(): - polygon = Polygon( - [(-119.0, 34.0), (-118.0, 34.0), (-118.0, 35.0), (-119.0, 35.0), (-119.0, 34.0)], - crs=WGS84, - ) - - with warnings.catch_warnings(record=True) as caught: - warnings.simplefilter("always") - projected = polygon.to_crs("EPSG:32611") - - _assert_no_deprecations(caught) - assert projected.crs.to_epsg() == 32611 - - -def test_empty_multipoint_to_crs_no_deprecation_warning(): - mp = MultiPoint(crs=WGS84) - - with warnings.catch_warnings(record=True) as caught: - warnings.simplefilter("always") - projected = mp.to_crs("EPSG:32611") - - _assert_no_deprecations(caught) - assert projected.geometry.is_empty - assert projected.crs.to_epsg() == 32611 - - -def test_raster_grid_operations_no_deprecation_warning(): - grid = RasterGrid.from_bbox( - xmin=-119.0, ymin=34.0, xmax=-118.0, ymax=35.0, cell_size=0.1, crs=WGS84 - ) - - with warnings.catch_warnings(record=True) as caught: - warnings.simplefilter("always") - crosses = grid.crosses_antimeridian - _ = grid.xy - _ = grid.x_vector - _ = grid.y_vector - _ = grid.boundary - _ = grid.index_point(Point(-118.5, 34.5, crs=WGS84)) - _ = grid.shift_xy(0.1, -0.1) - - _assert_no_deprecations(caught) - assert crosses is False - - -def test_raster_numpy_ufunc_no_deprecation_warning(): - grid = RasterGrid.from_bbox( - xmin=-119.0, ymin=34.0, xmax=-118.0, ymax=35.0, cell_size=0.5, crs=WGS84 - ) - raster = Raster(np.linspace(0, np.pi, 4).reshape(2, 2), geometry=grid) - - with warnings.catch_warnings(record=True) as caught: - warnings.simplefilter("always") - result = np.cos(raster) + np.sin(raster) - - _assert_no_deprecations(caught) - assert isinstance(result, Raster) - assert result.shape == (2, 2) -``` - ---- - -## 4. Verification & Release Plan - -1. **Run test suite with deprecation warnings escalated to errors:** - ```bash - pytest -W error::DeprecationWarning -W error::PendingDeprecationWarning - ``` -2. **Confirm `pyproject.toml` version and Python floor:** - - `version = "1.21.0"` - - `requires-python = ">=3.11"` -3. **Commit, tag, and publish release `v1.21.0`** to PyPI via the GitHub Release workflow, then close issues `#69` and `#47`: - ```bash - gh issue close 69 47 --comment "Resolved in v1.21.0." - ``` -````[cite: 2, 3] \ No newline at end of file diff --git a/notes/2026-11-24 rasters known issues.md b/notes/2026-11-24 rasters known issues.md new file mode 100644 index 0000000..83051ea --- /dev/null +++ b/notes/2026-11-24 rasters known issues.md @@ -0,0 +1,109 @@ +# `rasters` Known Issues & Codebase Audit (`v1.21.0`) + +This document catalogs bugs, dead code, edge-case runtime exceptions, and subtle logic flaws identified across the `rasters` repository (`v1.21.0`). + +--- + +## 1. Broken & Dead Code + +### 1.1 `SyntaxError` in `rasters/local_UTM_proj4_from_lat_lon.py` +* **Location:** `rasters/local_UTM_proj4_from_lat_lon.py:1` +* **Issue:** The file contains an empty function signature with no body (`def local_UTM_proj4_from_lat_lon(lat: float, lon: float) -> str:`), raising a `SyntaxError` if imported. +* **Context:** Superseded by `rasters/local_UTM_proj4.py` in `v1.10.0`. +* **Fix:** Delete `rasters/local_UTM_proj4_from_lat_lon.py`. + +### 1.2 Broken `Raster.from_geotiff()` Method +* **Location:** `rasters/raster.py` (`Raster.from_geotiff`) +* **Issues:** + 1. Calls `cls.from_file(filename, **kwargs)`, which does not exist on `Raster` (the method is `cls.open(...)`). + 2. Extension validation `if not filename.endswith(".tif") or filename.endswith(".tiff"):` has inverted operator precedence, causing valid `.tiff` filenames to raise `ValueError("invalid GeoTIFF filename")`. +* **Fix:** Check `not filename.lower().endswith((".tif", ".tiff"))` and delegate to `cls.open(filename, **kwargs)`. + +### 1.3 Empty Test File `tests/test_write_geotiff.py` +* **Location:** `tests/test_write_geotiff.py` +* **Issue:** Exists as a 0-byte file in the test suite with no tests implemented. +* **Fix:** Add unit tests covering `Raster.to_geotiff()`, `MultiRaster.to_geotiff()`, `Raster.to_COG()`, and `Raster.to_geopackage()`. + +--- + +## 2. Runtime Exceptions on Valid Edge-Case Inputs + +### 2.1 `IndexError` on Empty `Polygon()` and `MultiPolygon()` Constructors +* **Location:** `rasters/polygon.py` (`Polygon.__init__`), `rasters/multi_polygon.py` (`MultiPolygon.__init__`) +* **Issue:** Both constructors index `args[0]` directly without checking `if len(args) > 0:`. Calling `Polygon()` or `MultiPolygon()` with no arguments raises an `IndexError` instead of creating an empty geometry (unlike `Point()`, which checks `len(args) > 0`). +* **Fix:** Guard `args[0]` checks with `if len(args) > 0 and isinstance(args[0], ...)`. + +### 2.2 Slice & Tuple Assignment Bugs in `Raster.__setitem__()` +* **Location:** `rasters/raster.py` (`Raster.__setitem__`) +* **Issues:** + 1. `if isinstance(key, slice): self.array[slice] = value` indexes with the built-in `slice` class instead of the `key` variable, raising `IndexError: only integers, slices... are valid indices`. + 2. Tuple slice assignments (e.g., `raster[0:5, 0:5] = 0`) fall through to `self.array[np.array(key)] = value`, which fails when `key` contains `slice` objects. +* **Fix:** Assign via `self.array[key] = value` for `slice`, `int`, `tuple`, `Raster`, and `np.ndarray` keys. + +### 2.3 Single-Dimension Indexing Failure in `Raster._key()` +* **Location:** `rasters/raster.py` (`Raster._key`) +* **Issue:** Calling `raster[0]` or `raster[0:5]` (passing an `int` or `slice` instead of a 2-tuple) invokes `len(key)` without first wrapping `key = (key,)` as `RasterGeometry._key()` does, raising `TypeError: object of type 'int'/'slice' has no len()`. +* **Fix:** Normalize scalar/slice keys with `if isinstance(key, (int, slice)): key = (key,)`. + +### 2.4 `RasterGrid.resolution()` Fails on Scalar `float` +* **Location:** `rasters/raster_grid.py` (`RasterGrid.resolution`) +* **Issue:** Evaluates `if len(cell_size) == 1:`, which raises `TypeError: object of type 'float' has no len()` when passed a single float, contradicting its `Union[float, Tuple[float, float]]` type annotation. +* **Fix:** Check `isinstance(cell_size, (int, float, np.number))` before checking `len(cell_size)`. + +### 2.5 `RasterGeometry.point` Returns Exception Instead of Raising +* **Location:** `rasters/raster_geometry.py` (`RasterGeometry.point`) +* **Issue:** Executes `return ValueError("not a single point")` rather than raising the exception. +* **Fix:** Replace `return` with `raise`. + +### 2.6 Missing `origin` Attribute in `Raster.origin` +* **Location:** `rasters/raster.py` (`Raster.origin`) +* **Issue:** Delegates to `self.geometry.origin`, which is not defined on `RasterGeometry`, `RasterGrid`, or `RasterGeolocation` (only `x_origin` and `y_origin` exist). +* **Fix:** Either return `(self.x_origin, self.y_origin)` on `RasterGrid` or remove the broken property. + +--- + +## 3. Subtle Logic & Data-Handling Bugs + +### 3.1 `MultiRaster.contain()` Drops Top-Level `metadata` Keys +* **Location:** `rasters/multi_raster.py` (`MultiRaster.__init__`, `MultiRaster.contain`) +* **Issue:** `MultiRaster.contain()` passes `metadata=self.metadata` to `MultiRaster(...)`, and `MultiRaster.__init__` loops `for key, value in kwargs.items(): self._metadata[key] = value` without explicitly accepting `metadata: dict = None` like `Raster.__init__` does. This nests the entire metadata dictionary under `self._metadata["metadata"]`. +* **Fix:** Add `metadata: dict = None` handling to `MultiRaster.__init__` matching `Raster.__init__`. + +### 3.2 `TypeError` When Reprojecting Boolean `Raster` with `nodata=None` +* **Location:** `rasters/raster.py` (`Raster.to_grid`) +* **Issue:** When `self.dtype == "bool"` and `nodata is None`, `src_nodata = np.uint16(self.nodata)` attempts to cast `None` to `np.uint16`, raising `TypeError`. +* **Fix:** Default `src_nodata = 0` when `self.nodata is None` for boolean arrays. + +### 3.3 In-Place Shape Mutation on Non-Contiguous Slices in `Raster._slice()` +* **Location:** `rasters/raster.py` (`Raster._slice`) +* **Issue:** Mutates `result.shape = new_shape` in-place on the sliced array view, which can raise `AttributeError: Incompatible shape for in-place modification` on non-contiguous views. +* **Fix:** Use `result = result.reshape(new_shape)`. + +### 3.4 `Raster.rescale()` Resizes Array to Old Dimensions +* **Location:** `rasters/raster.py` (`Raster.rescale`) +* **Issue:** Computes the target `geometry = self.geometry.reproject(self.crs, target_cell_size)` with updated dimensions, but calls `skimage.transform.resize(self.array, (self.rows, self.cols), ...)` using the *original* rows and columns instead of `(geometry.rows, geometry.cols)`. +* **Fix:** Pass `(geometry.rows, geometry.cols)` as the target output shape. + +### 3.5 `mosaic()` Ordering & Iterator Handling Bugs +* **Location:** `rasters/mosaic.py` (`mosaic`) +* **Issues:** + 1. Accepts `Iterator[...]` in its type signature, but calls `len(images)` and `images[0]`, which fail on generators/iterators. + 2. Accesses `geometry.shape` before the `if geometry is None: geometry = images[0].geometry` fallback check, raising `AttributeError: 'NoneType' object has no attribute 'shape'` when `geometry` is omitted. +* **Fix:** Materialize `images = list(images)` up front and resolve `if geometry is None:` before initializing `mosaic`. + +### 3.6 `BBox.round` Truncates Coordinates to Whole Integers +* **Location:** `rasters/bbox.py` (`BBox.round`) +* **Issue:** Calls `round(self.x_min)` with no `ndigits` parameter, collapsing geographic bounding boxes (e.g., `-118.5, 34.5`) to coarse integer degrees (`-118, 34`). +* **Fix:** Support an optional `decimals: int = 0` method or document integer rounding behavior explicitly. + +### 3.7 Global Warning Filter Reset in `RasterGeometry` +* **Location:** `rasters/raster_geometry.py` (`latlon_matrices`, `grid_to_crs`) +* **Issue:** Calls `warnings.filterwarnings('ignore')` followed by `warnings.resetwarnings()` instead of `with warnings.catch_warnings():`, clearing user-configured warning filters (such as `pytest -W error`). +* **Fix:** Scope warning suppression inside `with warnings.catch_warnings():`. + +### 3.8 Unchecked `os.system` and Path Replacement in `Raster.to_COG()` +* **Location:** `rasters/raster.py` (`Raster.to_COG`) +* **Issues:** + 1. Uses `filename.replace(".tif", ".temp.tif")`, which corrupts paths if `.tif` appears in a parent directory name or if the file ends in `.tiff`. + 2. Executes `os.system(f'gdal_translate ...')` without checking the exit status or safely quoting arguments. +* **Fix:** Use `splitext(filename)[0] + ".temp.tif"` and `subprocess.run(..., check=True)`. \ No newline at end of file diff --git a/notes/2026-11-24 rasters repository history.md b/notes/2026-11-24 rasters repository history.md new file mode 100644 index 0000000..b0ac1a1 --- /dev/null +++ b/notes/2026-11-24 rasters repository history.md @@ -0,0 +1,160 @@ +# `rasters` Repository History (`v1.0.2` – `v1.21.0`) + +**Repository:** `python-rasters/rasters` +**Author:** Gregory H. Halverson (NASA Jet Propulsion Laboratory) +**Span:** June 13, 2024 (`v1.0.2`) – November 17, 2026 (`v1.21.0`) +**Total Releases:** 53 + +--- + +## 1. Executive Summary + +Across 53 releases over two and a half years, `rasters` evolved from a single 4,817-line monolithic module (`rasters/rasters.py`) adapted from ECOSTRESS workflows at NASA JPL into a modular, 29-module Python geospatial processing toolkit supporting Python 3.11 through 3.14. + +The repository's evolution spans four distinct architectural eras: + +1. **Monolithic Genesis (`v1.0.2` – `v1.2.0`):** Single-file architecture, pivot from Shapely multiple inheritance to composition, and `msgpack`-backed `KDTree` serialization. +2. **Modularization & Dependency Cleanup (`v1.3.0` – `v1.4.6`):** Decomposition into single-responsibility modules, removal of `pygeos`, point extraction, grid shifting, and macOS `pykdtree` compatibility. +3. **Analytical & Spatial Expansion (`v1.5.0` – `v1.16.1`):** Image downscaling/bias-correction, multi-raster mosaicking, swath subsetting, square-bracket geometry indexing, and `GeoSeries` integration. +4. **Stabilization & Modernization (`v1.17.0` – `v1.21.0`):** Full API docstrings and README documentation, Python 3.11–3.14 CI matrices, and elimination of Shapely 2.2+, `affine` 2.4+, and NumPy 2.0+ deprecation warnings. + +--- + +## 2. Architectural Eras + +### Era 1: Monolithic Genesis (`v1.0.2` – `v1.2.0`, Jun – Sep 2024) + +* **`v1.0.2` – `v1.0.4` (Jun 13–20, 2024):** + * Initial commit introduced `rasters/rasters.py` (4,817 lines) containing `CRS`, `SpatialGeometry`, `CoordinateArray`, `VectorGeometry`, `BBox`, `KDTree`, `RasterGeometry`, `RasterGeolocation`, `RasterGrid`, `Raster`, and `MultiRaster`. + * Packaged for PyPI (`pip install rasters`) and promoted `pykdtree` from an optional macOS dependency to a core dependency. +* **`v1.0.5` – `v1.0.6` (Jun 20, 2024):** + * Refactored vector classes (`Point`, `MultiPoint`, `Polygon`, `MultiPolygon`) from subclassing `shapely.geometry.*` directly to wrapping `self.geometry` via composition so CRS attributes persist across geometric operations. + * Switched default colormap constant (`DEFAULT_CMAP`) from `"viridis"` to `"jet"`. +* **`v1.1.0` (Jun 21, 2024):** + * Added `KDTree.to_dict()`, `KDTree.from_dict()`, `KDTree.save()`, and `KDTree.load()` using `msgpack` and `msgpack_numpy` to cache precomputed neighbor lookup arrays on disk. +* **`v1.1.1` – `v1.1.5` (Jul 19 – Aug 16, 2024):** + * Fixed binary integer raster rendering (`[0, 1]`) and `MultiRaster` plotting/reprojection. + * Added `.wkt` property and WKT `__repr__` output to `VectorGeometry`. + * Updated `RasterGeolocation.index_point()` to use `scipy.spatial.cKDTree`. +* **`v1.2.0` (Sep 19, 2024):** + * Restored `CoordinateArray` (temporarily removed in `v1.0.5`) to preserve compatibility with downstream ECOSTRESS pipelines, and configured `setuptools.build_meta` in `pyproject.toml`. + +--- + +### Era 2: Modularization & Dependency Cleanup (`v1.3.0` – `v1.4.6`, Sep 2024 – Feb 2025) + +* **`v1.3.0` (Sep 28, 2024):** + * **Major Architectural Refactor:** Split the 4,800-line `rasters/rasters.py` monolith into dedicated single-responsibility modules (`CRS.py`, `bbox.py`, `constants.py`, `coordinate_array.py`, `spatial_geometry.py`, `vector_geometry.py`, `point.py`, `multi_point.py`, `polygon.py`, `multi_polygon.py`, `wrap_geometry.py`, `kdtree.py`, `raster_geometry.py`, `raster_geolocation.py`, `raster_grid.py`, `raster.py`, `multi_raster.py`, `out_of_bounds_error.py`, `where.py`, `clip.py`, `mosaic.py`). + * Removed the deprecated `pygeos` dependency, migrating `RasterGeometry.pixel_outlines` to native `shapely.multipolygons()`. + * Replaced deprecated `scipy.ndimage.interpolation.shift` imports with `scipy.ndimage.shift`. +* **`v1.3.1` – `v1.3.6` (Oct 29 – Nov 9, 2024):** + * Resolved circular imports across newly split modules, extracted `center_aeqd.py` and `local_UTM_proj4.py`, and fixed a property recursion bug in `CRS._crs`. + * Added `Raster.open(..., geometry=Point)` and `Raster.to_point()` with `"nearest"` and Inverse Distance Weighting (`IDW`) sampling modes. + * Fixed `BBox.merge()` `ymax` calculation (`max` instead of `min`) and added `MultiVectorGeometry.__getitem__`. +* **`v1.4.0` – `v1.4.6` (Nov 22, 2024 – Feb 26, 2025):** + * Added `RasterGrid.shift_xy()` and `RasterGrid.shift_distance()` for sub-pixel and metric grid translations. + * Added `MultiRaster.contain()` to preserve 3D multi-band structure during reprojection and ufunc operations. + * Pinned `pykdtree>=1.3.11` to resolve macOS wheel compilation issues and standardized `requires-python = ">=3.10"`. + +--- + +### Era 3: Analytical & Spatial Expansion (`v1.5.0` – `v1.16.1`, Apr – Nov 2025) + +* **`v1.5.0` – `v1.6.0` (Apr 8 – May 28, 2025):** + * Added `linear_downscale()` and `bias_correct()` for coarse-to-fine thermal/optical image fusion (`v1.5.0`). + * Fixed `RasterGeometry.__repr__` JSON serialization for NumPy scalar types (`v1.5.1`). + * Fixed multi-band GeoTIFF writing in `Raster.to_file()` (`v1.5.3`) and added `MultiRaster.open()` (`multi = True`) plus configurable `resampling` options in `mosaic()` (`v1.5.4` – `v1.6.0`). + * Added `BBox.centroid`, keyword `Point(x=..., y=...)` initialization, and initial `MultiPoint` coordinate properties (`v1.6.0`). +* **`v1.7.0` – `v1.11.0` (Jul 3 – Aug 19, 2025):** + * Expanded `MultiPoint` to support `x`/`y` array initialization, 3D `z` coordinates, `to_crs()`, `latlon`, `lat`, and `lon`, formally deprecating `CoordinateArray` (`v1.7.0`). + * Added `MultiPoint` extraction in `Raster.open()` (`v1.7.0`) and `RasterGeometry` pass-through in `wrap_geometry()` (`v1.7.1`). + * Added `RasterGeolocation.window()` for swath spatial windowing (`v1.8.0`). + * Updated `Raster.__array_wrap__()` for NumPy 2.0 compatibility and migrated `__version__` to `importlib.metadata.version("rasters")` (`v1.9.0`). + * Fixed UTM zone clamping and suppressed pyproj PROJ4 conversion warnings in `local_UTM_proj4()` (`v1.10.0`). + * Standardized `transform_xy()` with geographic bounds clipping and added multi-band support to `KDTree.resample()` (`v1.11.0`). +* **`v1.12.0` – `v1.16.1` (Sep 11 – Nov 7, 2025):** + * Added `GeoSeries` of `Point` conversion and `None` pass-through in `wrap_geometry()` (`v1.12.0` – `v1.12.3`). + * Added `Point.lat` and `Point.lon` properties (`v1.13.0` – `v1.13.1`). + * Defaulted empty/blank CRS strings to `WGS84` in `CRS.__init__()` to fix NetCDF subdataset loading (`v1.13.2`). + * Added `xmin`, `xmax`, `ymin`, and `ymax` convenience properties to `RasterGrid` (`v1.14.0`). + * Added `RasterGeolocation.subset()`, `window(..., buffer=...)`, and square-bracket geometry indexing (`geometry[polygon]`, `geometry[window]`) on `RasterGeometry` (`v1.15.0`). + * Fixed 3D `MultiRaster` output in `where()` and `mosaic()` (`v1.15.1` – `v1.16.1`). + +--- + +### Era 4: Stabilization & Modernization (`v1.17.0` – `v1.21.0`, Jan – Nov 2026) + +* **`v1.17.0` – `v1.17.1` (Jan 13, 2026):** + * Updated `RasterGrid.from_bbox()` to accept `xmin`, `ymin`, `xmax`, `ymax` keyword arguments directly. + * Added comprehensive Google-style docstrings across `Raster`, `RasterGrid`, `RasterGeolocation`, and updated `README.md`. +* **`v1.18.0` – `v1.20.0` (Mar 5 – Jul 31, 2026):** + * Added `BBox.boundary_latlon` (`v1.18.0`) and expanded CI testing across Python 3.11–3.14. + * Fixed `BBox` handling in `wrap_geometry()` (`v1.19.0`). + * Added `geopandas.array.GeometryArray` clipping support to `clip()` and updated PyPI release workflows (`v1.20.0`). +* **`v1.21.0` (Nov 17, 2026):** + * Resolved remaining deprecation warnings under modern dependencies (GitHub issues `#69` and `#47`): + * Migrated `VectorGeometry.to_crs()` and `RasterGeometry.crosses_antimeridian` from `shapely.ops.transform()` to vectorized `shapely.transform()`. + * Replaced deprecated `affine.Affine` `*` multiplication with `@` matrix multiplication across `RasterGrid`. + * Added regression tests in `tests/test_vector_geometry.py` enforcing zero `DeprecationWarning` or `PendingDeprecationWarning` emissions. + +--- + +## 3. Complete Release Index + +| Tag | Release Date | Summary | +| :--- | :--- | :--- | +| `v1.21.0` | 2026-11-17 | Resolve Shapely, `affine`, and NumPy deprecation warnings (`#69`, `#47`) | +| `v1.20.0` | 2026-07-31 | Fix PyPI authentication, Python 3.11–3.14 support, `GeometryArray` support in `clip()` | +| `v1.19.0` | 2026-07-27 | Fix `BBox` pass-through handling in `wrap_geometry()` | +| `v1.18.0` | 2026-03-05 | Add `BBox.boundary_latlon`; CI matrix Python 3.10–3.14 | +| `v1.17.1` | 2026-01-13 | Fix top-level geometry imports in `raster_grid.py` | +| `v1.17.0` | 2026-01-13 | Add docstrings & `README.md` guide; support `xmin`/`ymin`/`xmax`/`ymax` in `RasterGrid.from_bbox()` | +| `v1.16.1` | 2025-11-07 | Fix shape check typo in `mosaic()` for `MultiRaster` inputs | +| `v1.16.0` | 2025-11-07 | Add `MultiRaster` support and optional `geometry` parameter to `mosaic()` | +| `v1.15.1` | 2025-11-06 | Fix `MultiRaster` masking by returning `MultiRaster` from `where()` for 3D arrays | +| `v1.15.0` | 2025-11-06 | Add `RasterGeolocation.subset()` and square-bracket geometry indexing on `RasterGeometry` | +| `v1.14.0` | 2025-10-24 | Add `xmin`, `xmax`, `ymin`, `ymax` bounds attributes to `RasterGrid` | +| `v1.13.2` | 2025-10-24 | Default empty/None CRS parameters to `WGS84` for NetCDF subdatasets | +| `v1.13.1` | 2025-10-24 | Optimize `Point.lat` and `Point.lon` when already in a geographic CRS | +| `v1.13.0` | 2025-10-24 | Add `lat` and `lon` properties to `Point` | +| `v1.12.3` | 2025-09-11 | Return `None` when `wrap_geometry(None)` is called | +| `v1.12.2` | 2025-09-11 | Fix missing `GeoSeries` import in `wrap_geometry.py` | +| `v1.12.0` | 2025-09-11 | Support `GeoSeries` of `Point` to `MultiPoint` conversion in `wrap_geometry()` | +| `v1.11.0` | 2025-08-19 | Add `transform_xy()` module and multi-band resampling support in `KDTree.resample()` | +| `v1.10.0` | 2025-08-19 | Fix UTM zone clamping and suppress PROJ4 conversion warnings in `local_UTM_proj4()` | +| `v1.9.0` | 2025-08-06 | Update `Raster.__array_wrap__` for NumPy 2.0; switch version metadata to `importlib.metadata` | +| `v1.8.0` | 2025-07-24 | Add `RasterGeolocation.window()` for swath spatial subsetting | +| `v1.7.1` | 2025-07-22 | Fix `wrap_geometry()` pass-through behavior for `RasterGeometry` inputs | +| `v1.7.0` | 2025-07-03 | Expand `MultiPoint` (`x`/`y` arrays, `to_crs`, `lat`/`lon`), deprecate `CoordinateArray`, support `MultiPoint` in `Raster.open()` | +| `v1.6.0` | 2025-05-28 | Add `resampling` parameter to `mosaic()`; add `BBox.centroid` and `MultiPoint` coordinate properties | +| `v1.5.5` | 2025-05-28 | Suppress runtime NaN warnings during `mosaic()` compositing | +| `v1.5.4` | 2025-05-28 | Support multi-band `MultiRaster.open()` and export `mosaic` in package namespace | +| `v1.5.3` | 2025-05-20 | Fix multi-band GeoTIFF writing in `Raster.to_file()` | +| `v1.5.2` | 2025-04-24 | Fix `KDTree` import in `raster.py` | +| `v1.5.1` | 2025-04-22 | Cast NumPy scalars to native Python `int`/`float` in `RasterGeometry.__repr__` JSON output | +| `v1.5.0` | 2025-04-08 | Add `linear_downscale()` and `bias_correct()` functions | +| `v1.4.6` | 2025-02-26 | Finalize `pyproject.toml` metadata for Python `>=3.10` | +| `v1.4.5` | 2025-02-26 | Set minimum Python version to `>=3.10` | +| `v1.4.4` | 2025-02-03 | Require `pykdtree>=1.3.11` to resolve macOS build issues | +| `v1.4.3` | 2025-01-03 | Add `MultiRaster.contain()` to fix `MultiRaster` reprojection | +| `v1.4.2` | 2024-11-22 | Fix `RasterGrid.shift_xy()` scaling by dividing shift by `cell_size` | +| `v1.4.1` | 2024-11-22 | Intermediate fix for `RasterGrid.shift_xy()` origin calculation | +| `v1.4.0` | 2024-11-22 | Add `RasterGrid.shift_xy()` and `RasterGrid.shift_distance()` | +| `v1.3.6` | 2024-11-09 | Fix `Raster` import inside `where()` | +| `v1.3.5` | 2024-11-06 | Return Python scalar via `.item()` in `Raster.to_point()` | +| `v1.3.4` | 2024-11-06 | Fix recursion bug in `CRS._crs`; add initial `Raster.to_point()` extraction | +| `v1.3.3` | 2024-10-31 | Add module docstrings, `center_aeqd()`, `local_UTM_proj4()`, and fix `BBox.merge()` `ymax` | +| `v1.3.2` | 2024-10-30 | Fix circular `RasterGeolocation` and `CRS` imports in `raster.py` | +| `v1.3.1` | 2024-10-29 | Fix `RasterGeometry` and `RasterGrid` imports and boundary index generation | +| `v1.3.0` | 2024-09-28 | Remove `pygeos` dependency and split monolithic `rasters.py` into modular files | +| `v1.2.0` | 2024-09-19 | Restore `CoordinateArray` class and configure `setuptools.build_meta` | +| `v1.1.5` | 2024-08-16 | Switch `RasterGeolocation.index_point()` to `scipy.spatial.cKDTree` | +| `v1.1.4` | 2024-08-16 | Add `.wkt` property and WKT `__repr__` to `VectorGeometry` | +| `v1.1.3` | 2024-08-15 | Fix destination array allocation for 3D multi-band rasters in `Raster.to_grid()` | +| `v1.1.2` | 2024-08-15 | Fix `plt.xticks(rotation=-90)` argument type in `MultiRaster.imshow()` | +| `v1.1.1` | 2024-07-19 | Fix binary `[0, 1]` integer raster colormap detection in `Raster.imshow()` | +| `v1.1.0` | 2024-06-21 | Add `KDTree.to_dict()`, `from_dict()`, `save()`, and `load()` via `msgpack` | +| `v1.0.6` | 2024-06-20 | Remove stray `import raster` from `rasters.py` | +| `v1.0.5` | 2024-06-20 | Refactor vector geometries (`Point`, `MultiPoint`, `Polygon`, `MultiPolygon`) to composition | +| `v1.0.4` | 2024-06-20 | Add PyPI packaging metadata and `pykdtree` dependency | +| `v1.0.2` | 2024-06-20 | Initial release of `rasters` package | \ No newline at end of file diff --git a/readme_update.md b/readme_update.md new file mode 100644 index 0000000..497ec45 --- /dev/null +++ b/readme_update.md @@ -0,0 +1,467 @@ +# `rasters` python package + +![CI](https://github.com/python-rasters/rasters/actions/workflows/ci.yml/badge.svg) + +This Python software package provides a comprehensive solution for handling gridded and swath raster data. It offers an object-oriented interface for ease of use, treating rasters, raster geometries, vector geometries, and K-D trees as objects. This allows for seamless map visualization in Jupyter notebooks and efficient resampling between swath and grid geometries. + +[Gregory H. Halverson](https://github.com/gregory-halverson-jpl) (they/them)
+[gregory.h.halverson@jpl.nasa.gov](mailto:gregory.h.halverson@jpl.nasa.gov)
+NASA Jet Propulsion Laboratory 321H + +## Citing this Package + +If you use `rasters` in your research or software pipelines, please cite it using the following BibTeX entry: + +```bibtex +@software{halverson_rasters_2026, + author = {Halverson, Gregory H.}, + title = {rasters: Object-Oriented Gridded and Swath Raster Processing Toolkit for Python}, + year = {2026}, + version = {1.21.0}, + publisher = {GitHub}, + url = {https://github.com/python-rasters/rasters} +} +``` + +The software addresses several challenges in the field. It makes swath remote sensing datasets more accessible and easier to work with. It also associates coordinate reference systems with vector geometries, simplifying transformations between projections. + +The software improves upon existing packages such as rasterio, shapely, pyresample, and GDAL by encapsulating functionalities into objects and providing a more user-friendly interface. It is inspired by and aims to be a Python equivalent for the raster package in R and the Rasters.jl package in Julia. + +Developed under a research grant by the NASA Research Opportunities in Space and Earth Sciences (ROSES) program at the Jet Propulsion Laboratory (JPL), the software was designed for use by the Ecosystem Spaceborne Thermal Radiometer Experiment on Space Station (ECOSTRESS) mission and the Surface Biology and Geology (SBG) mission. However, its utility extends to general remote sensing and GIS projects in Python. + +The software has potential commercial applications in remote sensing data analysis and pipeline construction. It meets the SPD-41 open-science requirements of NASA-funded ROSES projects by being published as an open-source software package. + +The advantage of this software package is that it brings together common geospatial operations in a single easy to use interface. It is useful for both remote sensing data analysis and building remote sensing data pipelines. It is anticipated to be of interest to those involved in remote sensing and GIS projects in Python. + +### This software accomplishes the following: + +This python package handles reading, writing, visualizing, and resampling of gridded and swath raster data. + +### What are the unique features of the software? +- object oriented interface for ease of use +- rasters and raster geometries as objects +- map visualization of raster objects in Jupyter notebooks +- ability to sample back and forth between swath and grid geometries +- vector geometries with associated coordinate reference system + +### What improvements have been made over existing similar software application? + +This software improves over the rasterio package by encapsulating rasters as objects that generate map visualizations when inspected in a Jupyter notebook. This software improves over the shapely package by associating coordinate reference systems with vector geometries, making it easier to transform between projections. This software improves over the pyresample package by encapsulating swath and grid geometries as objects and making it easy to resample between them. This software improves over GDAL with an object-oriented interface that can read and write a variety of raster file formats. + +### What problems are you trying to solve in the software? + +This software solves the problem of swath remote sensing datasets being inaccessible and difficult to work with. This software solves the problem of vector geometries in python not having coordinate reference systems associated with them. The software is inspired by and intended to be a python equivalent for the raster package in R and the Rasters.jl package in Julia. + +### Does your work relate to current or future NASA (include reimbursable) work that has value to the conduct of aeronautical and space activities? If so, please explain: + +This software package was developed as part of a research grant by the NASA Research Opportunities in Space and Earth Sciences (ROSES) program. This software was designed for use by the Ecosystem Spaceborne Thermal Radiometer Experiment on Space Station (ECOSTRESS) mission as a precursor for the Surface Biology and Geology (SBG) mission, but it may be useful generally for remote sensing and GIS projects in python. + +### What advantages does this software have over existing software? + +The advantage of this software package is that it brings together common geospatial operations in a single easy to use interface. + +Are there any known commercial applications? What are they? What else is currently on the market that is similar? + +This software is useful for both remote sensing data analysis and building remote sensing data pipelines. + +### Is anyone interested in the software? Who? Please list organization names and contact information. + +- NASA ROSES +- ECOSTRESS +- SBG + +### What are the current hardware and operating system requirements to run the software? (Platform, RAM requirement, special equipment, etc.) + +This software is written entirely in python and intended to be distributed using the pip package manager. + +### How has the software performed in tests? Describe further testing if planned. + +This software has been deployed for ECOSTRESS and ET-Toolbox. + +### Please identify the customer(s) and sponsors(s) outside of your section that requested and are using your software. + +This package is being released according to the SPD-41 open-science requirements of NASA-funded ROSES projects. + +## Installation + +The `rasters` package is available as a [pip package on PyPi](https://pypi.org/project/rasters/): + +``` +pip install rasters +``` + +## Examples + +Import the `Raster` class from the `rasters` package. + +```python +from rasters import Raster +``` + +Supply the filename to the `open` class method of the `Raster` class. Placing the variable for the `Raster` object at the end of a Jupyter notebook cell displays a map of the image. The default `cmap` used in the map is `viridis`. + +```python +raster = Raster.open("ECOv002_L2T_LSTE_33730_008_11SPS_20240617T205018_0712_01_LST.tif") +raster +``` + +![png](examples/Opening%20a%20GeoTIFF_3_0.png) + +## Usage + +### Working with Raster Objects + +The `Raster` class is the primary interface for working with raster data. It encapsulates both the data array and its georeferencing information. + +#### Opening and Creating Rasters + +```python +from rasters import Raster + +# Open a raster from file +raster = Raster.open("path/to/file.tif") + +# Create a raster from a numpy array and geometry +import numpy as np +from rasters import RasterGrid + +data = np.random.rand(100, 100) +geometry = RasterGrid.from_bbox( + xmin=-120, ymin=30, xmax=-110, ymax=40, + cell_size=0.1 +) +raster = Raster(data, geometry=geometry) +``` + +#### Raster Properties + +```python +# Access the data array +array = raster.array + +# Get dimensions +rows, cols = raster.shape +print(f"Raster size: {rows} rows x {cols} cols") + +# Get coordinate reference system +crs = raster.crs + +# Get bounding box +bbox = raster.bbox + +# Get cell size +cell_size = raster.cell_size +``` + +#### Raster Operations + +```python +# Arithmetic operations +raster_sum = raster1 + raster2 +raster_diff = raster1 - raster2 +raster_product = raster1 * raster2 +raster_quotient = raster1 / raster2 + +# Comparison operations +mask = raster > 0.5 + +# Reproject to different coordinate system +reprojected = raster.reproject(crs="EPSG:4326", target_cell_size=0.01) + +# Resample to a different geometry +resampled = raster.to_geometry(target_geometry, resampling="bilinear") + +# Sample at a point +from rasters import Point +point = Point(-115, 35, crs="EPSG:4326") +value = raster.to_point(point) +``` + +#### Saving Rasters + +```python +# Save as GeoTIFF +raster.to_geotiff("output.tif", compression="deflate") + +# Save as Cloud Optimized GeoTIFF (COG) +raster.to_COG("output_cog.tif") + +# Save as GeoPackage +raster.to_geopackage("output.gpkg") +``` + +#### Visualization + +```python +# Display in Jupyter notebook (automatic when last line in cell) +raster + +# Create a matplotlib figure +fig = raster.imshow( + title="My Raster", + cmap="viridis", + figsize=(10, 8) +) + +# Save as image +image = raster.to_pillow(cmap="jet") +image.save("preview.png") +``` + +### Working with RasterGrid + +The `RasterGrid` class represents gridded raster geometry with uniform cell spacing and north-oriented grids. + +#### Creating RasterGrid Objects + +```python +from rasters import RasterGrid + +# From bounding box and cell size +grid = RasterGrid.from_bbox( + xmin=-120, ymin=30, xmax=-110, ymax=40, + cell_size=0.001, + crs="EPSG:4326" +) + +# From bounding box and shape +grid = RasterGrid.from_bbox( + xmin=-120, ymin=30, xmax=-110, ymax=40, + shape=(1000, 1000), + crs="EPSG:4326" +) + +# From affine transform +from affine import Affine +affine = Affine(0.001, 0, -120, 0, -0.001, 40) +grid = RasterGrid.from_affine(affine, rows=1000, cols=1000, crs="EPSG:4326") + +# From coordinate vectors +x_vector = np.linspace(-120, -110, 1000) +y_vector = np.linspace(30, 40, 1000) +grid = RasterGrid.from_vectors(x_vector, y_vector, crs="EPSG:4326") + +# From a raster file +grid = RasterGrid.open("path/to/file.tif") +``` + +#### RasterGrid Properties + +```python +# Get grid dimensions +rows = grid.rows +cols = grid.cols + +# Get cell size +cell_width = grid.cell_width +cell_height = grid.cell_height + +# Get extent +xmin, ymin = grid.xmin, grid.ymin +xmax, ymax = grid.xmax, grid.ymax +width, height = grid.width, grid.height + +# Get coordinate arrays +x = grid.x # 2D array of x-coordinates +y = grid.y # 2D array of y-coordinates + +# Get coordinate vectors +x_vector = grid.x_vector # 1D array of x-coordinates +y_vector = grid.y_vector # 1D array of y-coordinates + +# Get affine transform +affine = grid.affine +``` + +#### RasterGrid Operations + +```python +# Subset to a region +from rasters import BBox +subset_bbox = BBox(-115, 32, -112, 38, crs="EPSG:4326") +subset_grid = grid.subset(subset_bbox) + +# Slice using indices +subset_grid = grid[100:200, 150:250] + +# Change resolution +rescaled_grid = grid.rescale(cell_size=0.002) + +# Buffer the grid +buffered_grid = grid.buffer(pixels=10) + +# Shift the grid +shifted_grid = grid.shift_xy(x_shift=100, y_shift=50) +``` + +### Working with RasterGeolocation + +The `RasterGeolocation` class represents swath raster geometry using 2D geolocation arrays, commonly used for satellite swath data. + +#### Creating RasterGeolocation Objects + +```python +from rasters import RasterGeolocation +import numpy as np + +# From x and y coordinate arrays +x_coords = np.random.uniform(-120, -110, (500, 500)) +y_coords = np.random.uniform(30, 40, (500, 500)) +geolocation = RasterGeolocation(x_coords, y_coords, crs="EPSG:4326") + +# From coordinate vectors (creates meshgrid) +x_vector = np.linspace(-120, -110, 500) +y_vector = np.linspace(30, 40, 500) +geolocation = RasterGeolocation.from_vectors(x_vector, y_vector, crs="EPSG:4326") +``` + +#### RasterGeolocation Properties + +```python +# Get dimensions +rows = geolocation.rows +cols = geolocation.cols + +# Get coordinate arrays +x = geolocation.x # 2D array of x-coordinates +y = geolocation.y # 2D array of y-coordinates + +# Get extent +xmin, ymin = geolocation.x_min, geolocation.y_min +xmax, ymax = geolocation.x_max, geolocation.y_max + +# Get cell size (estimated from median distances) +cell_size = geolocation.cell_size + +# Get boundary polygon +boundary = geolocation.boundary +``` + +#### RasterGeolocation Operations + +```python +# Index with geometry +from rasters import Polygon +polygon = Polygon([(-115, 32), (-112, 32), (-112, 38), (-115, 38)]) +mask = geolocation.index(polygon) + +# Generate a regular grid from geolocation +grid = geolocation.grid + +# Resize geolocation arrays +resized = geolocation.resize(dimensions=(250, 250)) + +# Subset to a region +subset = geolocation.subset(polygon) +``` + +### Working with Points and Vector Geometries + +```python +from rasters import Point, Polygon, BBox + +# Create a point +point = Point(-115.5, 35.2, crs="EPSG:4326") + +# Transform point to different CRS +utm_point = point.to_crs("EPSG:32611") + +# Create a polygon +polygon = Polygon([ + (-115, 32), + (-112, 32), + (-112, 38), + (-115, 38) +], crs="EPSG:4326") + +# Create a bounding box +bbox = BBox(xmin=-120, ymin=30, xmax=-110, ymax=40, crs="EPSG:4326") + +# Sample raster at point +value = raster.to_point(point) + +# Clip raster to polygon +clipped = raster.subset(polygon) +``` + +### Advanced Usage + +#### Merging Multiple Rasters + +```python +# Open multiple rasters +raster1 = Raster.open("tile1.tif") +raster2 = Raster.open("tile2.tif") +raster3 = Raster.open("tile3.tif") + +# Merge into a single raster +merged = Raster.merge([raster1, raster2, raster3]) +``` + +#### Resampling with KDTree + +```python +from rasters import KDTree + +# Create a KDTree for efficient resampling +kd_tree = KDTree( + source_geometry=source_raster.geometry, + target_geometry=target_grid, + radius_of_influence=1000 # meters +) + +# Resample using the KDTree +resampled = source_raster.resample(target_grid, kd_tree=kd_tree) + +# Save KDTree for reuse +kd_tree.save("kdtree.pkl") + +# Load KDTree +kd_tree = KDTree.load("kdtree.pkl") +``` + +#### Working with Masks + +```python +# Create a mask +mask = raster > 0.5 + +# Apply mask to raster +masked_raster = raster.mask(mask) + +# Fill masked values with another raster +filled = raster.fill(fill_raster) +``` + +## History + +* **`v1.0.2` – `v1.2.0` (June – September 2024):** Launched as a single-file package (`rasters/rasters.py`) adapted from ECOSTRESS workflows at NASA JPL. Refactored vector geometry classes (`Point`, `MultiPoint`, `Polygon`, `MultiPolygon`) from Shapely inheritance to composition with explicit CRS tracking, added `msgpack` serialization (`KDTree.save()` and `KDTree.load()`), added `.wkt` representations, and switched swath point lookup to `scipy.spatial.cKDTree`. +* **`v1.3.0` – `v1.4.6` (September 2024 – February 2025):** Split the monolith into dedicated single-responsibility modules (`CRS.py`, `bbox.py`, `point.py`, `polygon.py`, `kdtree.py`, `raster.py`, `raster_grid.py`, `raster_geolocation.py`, etc.), dropped the deprecated `pygeos` dependency in favor of `shapely` 2.x, added point extraction via `Raster.open(..., geometry=Point)`, added grid shifting (`RasterGrid.shift_xy()`, `shift_distance()`), and resolved macOS `pykdtree` build issues (`pykdtree>=1.3.11`). +* **`v1.5.0` – `v1.16.1` (April – November 2025):** Added `linear_downscale()` and `bias_correct()`, configurable resampling in `mosaic()`, `MultiPoint` extraction in `Raster.open()`, `RasterGeolocation.window()` and `.subset()`, square-bracket geometry indexing (`grid[polygon]`, `geolocation[window]`), `GeoSeries` to `MultiPoint` wrapping, `Point.lat`/`Point.lon` properties, `RasterGrid` bounds properties (`xmin`, `xmax`, `ymin`, `ymax`), and multi-raster mosaicking/masking fixes. +* **`v1.17.0` – `v1.21.0` (January – November 2026):** Expanded module docstrings and documentation, added `BBox.boundary_latlon`, expanded CI test coverage across Python `3.11`–`3.14`, fixed `BBox` handling in `wrap_geometry()`, and resolved deprecation warnings under Shapely 2.2+ (`shapely.transform()`), `affine` 2.4+ (`@` matrix multiplication), and NumPy 2.0+ (`__array_wrap__`). + +## Known Issues + +The following known issues are tracked in the [GitHub issue tracker](https://github.com/python-rasters/rasters/issues) as of `v1.21.0`: + +* **Vector & Geometry Edge Cases:** + * Calling `Polygon()` or `MultiPolygon()` with no arguments raises an `IndexError` instead of initializing an empty geometry ([#74](https://github.com/python-rasters/rasters/issues/74)). + * `RasterGeometry.point` returns a `ValueError` instance rather than raising it when the geometry is not a single cell ([#78](https://github.com/python-rasters/rasters/issues/78)). + * `BBox.round` truncates coordinates to whole integers without supporting an `ndigits` precision argument ([#85](https://github.com/python-rasters/rasters/issues/85)). + * `rasters/local_UTM_proj4_from_lat_lon.py` is an orphaned stub file with an empty function definition superseded by `rasters/local_UTM_proj4.py` ([#71](https://github.com/python-rasters/rasters/issues/71)). +* **Raster Indexing, Slicing & Grid Operations:** + * `Raster.__setitem__()` fails on slice and tuple-slice assignments (`raster[0:5] = 0`, `raster[0:5, 0:5] = 0`) ([#75](https://github.com/python-rasters/rasters/issues/75)). + * Single-dimension indexing (`raster[0]` or `raster[0:5]`) raises a `TypeError` in `Raster._key()` ([#76](https://github.com/python-rasters/rasters/issues/76)). + * `Raster._slice()` mutates array view shapes in-place (`result.shape = new_shape`), failing on non-contiguous slices ([#82](https://github.com/python-rasters/rasters/issues/82)). + * `RasterGrid.resolution()` raises a `TypeError` when passed a scalar `float` instead of a tuple ([#77](https://github.com/python-rasters/rasters/issues/77)). + * `Raster.origin` delegates to a nonexistent `self.geometry.origin` attribute ([#79](https://github.com/python-rasters/rasters/issues/79)). + * `Raster.rescale()` resizes the data array to the original `(self.rows, self.cols)` shape instead of the target `(geometry.rows, geometry.cols)` shape ([#83](https://github.com/python-rasters/rasters/issues/83)). +* **MultiRaster, Mosaicking & Reprojection:** + * `MultiRaster.contain()` / `MultiRaster.__init__()` nests `metadata` under a `"metadata"` key instead of unpacking it ([#80](https://github.com/python-rasters/rasters/issues/80)). + * `Raster.to_grid()` raises a `TypeError` on boolean rasters when `nodata` is `None` ([#81](https://github.com/python-rasters/rasters/issues/81)). + * `mosaic()` fails on generator/iterator inputs and evaluates `geometry.shape` before resolving default geometry from `images[0]` ([#84](https://github.com/python-rasters/rasters/issues/84)). +* **File I/O, Testing & Warnings:** + * `Raster.from_geotiff()` calls a nonexistent `cls.from_file()` method and rejects `.tiff` extensions due to operator precedence ([#72](https://github.com/python-rasters/rasters/issues/72)). + * `Raster.to_COG()` invokes `gdal_translate` via `os.system()` without checking exit status and uses naive `.replace(".tif", ".temp.tif")` path substitution ([#87](https://github.com/python-rasters/rasters/issues/87)). + * `RasterGeometry` uses `warnings.filterwarnings('ignore')` followed by `warnings.resetwarnings()` instead of `with warnings.catch_warnings()`, clearing external warning filters ([#86](https://github.com/python-rasters/rasters/issues/86)). + * `tests/test_write_geotiff.py` is currently an empty placeholder without GeoTIFF write tests ([#73](https://github.com/python-rasters/rasters/issues/73)). \ No newline at end of file