Skip to content

pyotb is a library that enables easy use of the Orfeo Tool Box (OTB) in Python

License

Notifications You must be signed in to change notification settings

orfeotoolbox/pyotb

Repository files navigation

pyotb: Orfeo ToolBox for Python

latest release pipeline status coverage report read the docs status

pyotb wraps the Orfeo Toolbox in a pythonic, developer friendly fashion.

Key features

  • Easy use of Orfeo ToolBox (OTB) applications from python
  • Simplify common sophisticated I/O features of OTB
  • Lazy execution of operations thanks to OTB streaming mechanism
  • Interoperable with popular python libraries (numpy and rasterio)
  • Extensible

Documentation hosted at pyotb.readthedocs.io.

Example

Building a simple pipeline with OTB applications

import pyotb

# RigidTransformResample, with input parameters as dict
resampled = pyotb.RigidTransformResample({
    "in": "https://myserver.ia/input.tif",  # Note: no /vsicurl/
    "interpolator": "linear", 
    "transform.type.id.scaley": 0.5,
    "transform.type.id.scalex": 0.5
})

# OpticalCalibration, with input parameters as args
calib = pyotb.OpticalCalibration(resampled)

# BandMath, with input parameters as kwargs
ndvi = pyotb.BandMath(calib, exp="ndvi(im1b1, im1b4)")

# Pythonic slicing
roi = ndvi[20:586, 9:572]

# Pipeline execution. The actual computation happens here!
roi.write("output.tif", "float")

About

pyotb is a library that enables easy use of the Orfeo Tool Box (OTB) in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages