Repository navigation
Conversation
Python (python/, the terrio-py crate, published as terrio on PyPI): PyO3 and NumPy, abi3 wheels for Python 3.10+. terrio.open, open_raster (lazy window and overview reads of local and remote GeoTIFFs), open_vector, open_bytes, info, list_layers, drivers; Raster with read() into native-dtype arrays, from_array, write and to_bytes; VectorDataset and Layer with to_geojson, to_wkb, columns, to_geopandas and to_crs; convert, translate, warp, mosaic, rasterize, polygonize, transform_points and write_vector/write_raster with the CLI options as keyword arguments. Errors raise terrio.TerrioError subclasses that are also OSError or ValueError. pytest suite with synthetic tests and real-data tests comparing arrays with osgeo.gdal. npm (js/, the terrio-js crate): wasm-bindgen bindings opening datasets from bytes, reading bands as typed arrays, layers as GeoJSON, writing to bytes, and transforming coordinates. Tested in Node. terrio::memory opens datasets from bytes and writes them to bytes: through a temporary directory and the file drivers in native builds, with in-memory codecs (GeoTIFF/COG, ASCII grid, GeoJSON, FlatGeobuf, KML, KMZ, GML, GPX, TopoJSON, zip archives) in WebAssembly. LazyRaster reads GeoTIFFs held in memory and wraps rasters in memory. CI builds and tests wheels on Linux, macOS and Windows, runs the Python tests against GDAL on real data, and builds and tests the npm package. A release workflow publishes wheels to PyPI with trusted publishing.
|
opengeos is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.
ℹ️ Recent review info
📝 Walkthrough
A rabbit checks the byte stream’s course, Comment |
- Skip a pull request only when gh says the number names none; stop
with an error when gh is missing, unauthenticated or offline, so a
failure does not print an empty draft.
- Check each item of a list on its own, so a first item that only
references an issue ("Closes #12") is skipped.
- Stop with a message asking for --since or a full clone with tags when
no v* tag precedes --until, or when git cannot list the range; say in
the docs that the script needs full history and tags.
- Match the whole release title, "Release X.Y.Z", in the script and
the workflow.
* ci: write the changelog in the release pull request only
Every feature pull request added its entry at the top of the changelog's
Unreleased section, so each merge left the other open pull requests in
conflict on the same lines.
Feature pull requests now leave CHANGELOG.md alone and open their
description with a changelog-style paragraph. The release pull request
drafts its section from those with scripts/draft_changelog.py, which
reads the pull requests merged since the latest tag. A Changelog
workflow fails a pull request that edits the file unless its title
starts with Release. AGENTS.md and docs/contributing.md document the
rule.
* Address review feedback
- Remove fenced code blocks before splitting a description into
paragraphs, so a block with a blank line is not split into an entry.
- Skip only wholly bold paragraphs, keeping an opening like
"**Breaking:** ...".
- Remove heading lines before splitting, so prose right below a
heading is kept.
- Match release pull requests as "Release X.Y.Z" in the script and the
workflow, not any title starting with "Release ".
- Name the workflow's job "Changelog", the check name the docs use.
- Warn and skip a number gh cannot read instead of aborting the draft.
- Default --since to the last tag before --until, not before HEAD.
- Document merging the drafted entries into the existing Unreleased
ones at release.
* Address Claude review feedback
- Skip a pull request only when gh says the number names none; stop
with an error when gh is missing, unauthenticated or offline, so a
failure does not print an empty draft.
- Check each item of a list on its own, so a first item that only
references an issue ("Closes #12") is skipped.
- Stop with a message asking for --since or a full clone with tags when
no v* tag precedes --until, or when git cannot list the range; say in
the docs that the script needs full history and tags.
- Match the whole release title, "Release X.Y.Z", in the script and
the workflow.
* Address Claude review feedback
- Remove only ATX headings ("#" to "######" and a space), so a line
such as "#123 fixes the crash" stays in the description.
- Split a paragraph at its list items wherever they start, so an intro
line directly above a list is separated from the items, and skip a
lead-in that ends with a colon.
* Address Claude review feedback
- Match release titles with [0-9] and fullmatch, exactly as the
Changelog workflow's ^Release [0-9]+.[0-9]+.[0-9]+$ does.
- Reword the module docstring's range description, say that only
numbers naming no pull request are skipped, and wrap it and the
--since option to 100 columns.
Roadmap 0.5 bindings: a Python package (PyO3 + NumPy,
python/) and an npm package (wasm-bindgen,js/), plus a small core addition,terrio::memory, to open datasets from bytes and write them to bytes.Python (
terrioon PyPI)abi3 wheels for Python ≥ 3.10, built with maturin; the only runtime dependency is NumPy. Rust doc comments are Google-style Python docstrings.
Operations take the CLI options as keyword arguments, accept paths or in-memory objects (
Raster,Layer,VectorDataset, GeoJSON, anything with__geo_interface__), return the result and also write it when a destination is given. The GIL is released during I/O and processing.Errors:
terrio.TerrioErrorbase;TerrioIOError(OSError),NotFoundError(FileNotFoundError), andInvalidArgumentError,CRSError,UnsupportedError,InvalidDataError(allValueError).npm (
terrio, name available)Built with
wasm-packforweb(the npm package, 1.1 MB packed) andnodejs(tests). Nothing is published.Core changes (kept small)
crates/terrio/src/memory.rs:open_bytes,open_raster_bytes,open_raster_lazy_bytes,open_vector_bytes,write_raster_bytes,write_vector_bytes. Native builds go through a temporary directory and the file drivers, so every format behaves exactly as from files (multi-file outputs such as shapefiles come back as a zip). WebAssembly builds use in-memory codecs: read GeoTIFF/COG, ASCII grid, GeoJSON, TopoJSON, FlatGeobuf, KML, KMZ, GML, GPX and zip archives of these; write GeoTIFF/COG (with the mergedgtiff_writeencoder, lossless compressions), ASCII grid and the same vector formats. The API is generic (bytes + file name), so the vector/raster drivers can add byte readers behind it later.cog.rs:LazyRaster::from_tiff_bytes,LazyRaster::dataset(),impl From<RasterDataset> for LazyRaster, and an in-memorySource.crs.rs:SpatialRef::to_crs_info,from_layerandapply_to_layermade public;dataset.rs:fix_layerispub(crate);vfs.rs:MAIN_DATASET_EXTENSIONSavailable in wasm.python(terrio-py,publish = false, libtest = falsesince the extension links to Python only when loaded) andjs(terrio-js). Both build and lint in the plain workspace.CI
python (ubuntu/macos/windows): maturin-action wheel build, install, pytest; wheels uploaded as artifacts.real data vs GDAL: builds the wheel in the GDAL environment and runs the Python suite withTERRIO_TEST_DATA, comparing arrays withosgeo.gdal.wasm: builds the npm package (nodejs and web targets), runsnode --test js/tests/, uploads the package.release.yml: wheels (manylinux x86_64/aarch64, musllinux, macOS x86_64/arm64, Windows) + sdist onv*tags, published with PyPI trusted publishing (needs apypienvironment and a trusted publisher on the PyPI project; not triggered).python/.Test results (local)
cargo fmt,cargo clippy --workspace --all-targets -D warnings(also forwasm32-unknown-unknownonterrioandterrio-js),cargo test --workspace(withTERRIO_TEST_DATA): pass.uvx pre-commit run --all-files: pass.from_array/read, windows, writes, bytes, vector formats, convert/translate/warp/mosaic/rasterize/polygonize, errors, geopandas round trip).TERRIO_TEST_REMOTE=1): 81 passed, 3 xfailed. Arrays are identical togdal.Band.ReadAsArray(shape, dtype, values) for 23 rasters (GeoTIFF/COG, Landsat, SRTM, NLCD, ECOSTRESS, OPERA, USGS 3DEP, ASCII grid, HFA, ENVI, JP2, BIL, ERS, Surfer, RST, SAGA, NetCDF, Zarr v3); lazy random windows and every overview match GDAL on 11 GeoTIFFs; a remote USGS COG window and overview match GDAL's/vsicurl/;open_bytesmatches; rasters written by terrio read identically in GDAL;translatematchesgdal.Translateexactly;warpto EPSG:3857 has GDAL's size and geotransform and >99.9% identical pixels;rasterizematchesgdal.Rasterize; vector feature counts, fields, extents and geometry areas/lengths match OGR for GeoPackage, GeoJSON, GeoParquet, zipped shapefile;transform_pointsmatchesosrto 1 mm..aux.xml) for srtm_sub, dem, cog, landsat and nlcd GeoTIFFs; GeoJSON/KML/GML/GPX real files read from bytes.Known gaps
countries.fgb/UScounties.fgband overflows on large files in 32-bit wasm; its GeoJSON reader mis-decodes non-ASCII text (Côte d'Ivoire).memory::codeccan route to them.to_arrow),.pyitype stubs, npm publishing workflow. The PyPI project already has a 0.0.1 placeholder, so the first real release needs a version bump.Summary by CodeRabbit