Avatar for the weiji14 user
weiji14
cog3pio
BlogDocsChangelog

:sparkles: Read GeoTIFF files from remote urls via object_store

#5Merged
Comparing
object_store
(
5c412da
) with
main
(
0c37e32
)
CodSpeed Performance Gauge
-38%
Improvements
0
Regressions
1
Untouched
0
New
1
Dropped
0
Ignored
0

Benchmarks

New

test_read_geotiff_remote
python/tests/test_io_geotiff.py::test_read_geotiff_remote
CodSpeed Performance Gauge
N/A
N/A
48.9 ms

Passed

test_read_geotiff_localRegression
python/tests/test_io_geotiff.py::test_read_geotiff_local
CodSpeed Performance Gauge
-38%
156.3 µs
251.6 µs

Commits

Click on a commit to change the comparison range
Base
main
0c37e32
-38%
:necktie: Handle local filepaths by prepending with file:// Handle the RelativeUrlWithoutBase parsing error raised when local filepaths are given without `file://` in front. Also moved the parse url logic out of the async block.
f9607f3
10 months ago
by weiji14
0%
:green_heart: Build wheels on manylinux_2_28 Resolve `warning: ring@0.17.8: #error "ARM assembler must define __ARM_ARCH"` on aarch64. Xref https://github.com/PyO3/maturin-action/issues/222
315282f
10 months ago
by weiji14
0%
:wrench: Try using ghcr.io/rust-cross/manylinux_2_28-cross docker image Getting an error like `/usr/bin/python3: No module named pip` when using the quay.io/pypa/manylinux_2_28_x86_64:latest docker image, so trying with ghcr.io/rust-cross/manylinux_2_28-cross instead. Note that the aarch64/armv7/s390x/ppc64le targets use this rust-cross image by default.
c477eba
10 months ago
by weiji14
0%
:wastebasket: Remove x86 (i686) build target on linux Don't compile on i686 since manylinux_2_28 doesn't support it according to https://github.com/rust-cross/manylinux-cross/blob/1c46d3b27a55eff53d675bf515d6361d7cc1abde/README.md?plain=1#L25-L35 and https://github.com/pypa/manylinux/blob/dbe0aa5c374c5b69769253d2a77820b08fe80a7d/README.rst?plain=1#L46. Note that x86 is an alias of i686 (see https://github.com/PyO3/maturin-action/blob/60d11847b29f81ca5375519a8eb33cc336ba4bfa/src/index.ts#L119).
a133a74
10 months ago
by weiji14
0%
:recycle: Use Url::from_file_path to add file:// to filepath Use built-in function at https://docs.rs/url/2.5.0/url/struct.Url.html#method.from_file_path to add the file:// prefix instead of the DIY method at f9607f3e2f3b8ae8fb6665ac5aa5fd2a53b0c302. Hoping that this would handle Windows paths too. Also changed .expect to .map_err to raise PyValueError instead of panicking.
3c8a604
10 months ago
by weiji14
0%
:memo: Document installation and usage in main README.md Add instructions on how to install cog3pio in Rust or Python (need to pull development version from git for now), and sample code to read a GeoTIFF file from a http url. Included some tips on pinning the specific commit hash, and mentioned that the current crate/library only supports reading single-band float32 GeoTIFF files. Also checked the box that reading from remote storage is implemented.
15b0dbc
10 months ago
by weiji14
+1%
:recycle: Refactor to remove unwrap statements and better error handling Gracefully handle errors when retrieving the GeoTIFF data in the async block, using turbofish operator as suggested by https://rust-lang.github.io/async-book/07_workarounds/02_err_in_async_blocks.html. Fixed some errors missing the format! macro, and added unit tests to catch parsing and decoding errors. In the read_geotiff function, changed the function to return a TiffError instead of ShapeError, so that ? can be used in the decoding portions.
33f4a73
10 months ago
by weiji14
-1%
:memo: Copy example usage to crate-level docs as doctest Copy the Rust code from 15b0dbcbdffcbabcad0be6f4b93339ad4b07e2d9 to src/lib.rs as a doctest. Need to change `crate-type = ["rlib"]` in Cargo.toml so that `cargo test --doc` works, but will configure that in CI later.
5c412da
10 months ago
by weiji14
Home Terms PrivacyDocs