Library to enable easy use of the Orfeo ToolBox (OTB) in Python
Project description
pyotb: a pythonic extension of Orfeo Toolbox
pyotb wraps the Orfeo Toolbox (OTB) python bindings to make it more developer friendly.
Key features
- Easy use of OTB applications from python
- Simplify common sophisticated I/O features of OTB
- Lazy execution of in-memory pipelines with OTB streaming mechanism
- Interoperable with popular python libraries (numpy, rasterio)
- Extensible
Documentation hosted at pyotb.readthedocs.io.
Example
Building a simple pipeline with OTB applications
import pyotb
# RigidTransformResample application, with input parameters as dict
resampled = pyotb.RigidTransformResample({
"in": "https://some.remote.data/input.tif", # Note: no /vsicurl/...
"interpolator": "linear",
"transform.type.id.scaley": 0.5,
"transform.type.id.scalex": 0.5
})
# OpticalCalibration, with automatic input parameters resolution
calib = pyotb.OpticalCalibration(resampled)
# BandMath, with input parameters passed as kwargs
ndvi = pyotb.BandMath(calib, exp="ndvi(im1b1, im1b4)")
# Pythonic slicing using lazy computation (no memory used)
roi = ndvi[20:586, 9:572]
# Pipeline execution
# The actual computation happens here !
roi.write("output.tif", "float")
pyotb's objects also enable easy interoperability with numpy and rasterio:
# Numpy and RasterIO style attributes
print(roi.shape, roi.dtype, roi.transform)
print(roi.metadata)
# Other useful information
print(roi.get_infos())
print(roi.get_statistics())
array = roi.to_numpy()
array, profile = roi.to_rasterio()
Contributing
Contributions are welcome on Github or the source repository hosted on the Orfeo ToolBox GitLab.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyotb-2.0.0.dev8.tar.gz
(46.0 kB
view hashes)
Built Distribution
pyotb-2.0.0.dev8-py3-none-any.whl
(41.0 kB
view hashes)
Close
Hashes for pyotb-2.0.0.dev8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8550c328f6692c209f8e12d3cfadd71fd6faacdc3b71e717c07e2935b48a5c5 |
|
MD5 | 6b94cf9140e0503cef84609783cc4135 |
|
BLAKE2b-256 | 18af7cd3bd2cb95c75c211ce6eadf69629f6fe766d7f2785da906c7ecb4e02a3 |