Getting Started with eo-learn in Python for Earth Observation Data Analysis
- Anvita Shrivastava
- 11 hours ago
- 4 min read
For many uses, such as agriculture, environmental monitoring, urban planning, etc., there is a huge demand for EO (Earth Observation) data. However, EO data are generally difficult to process easily, so there are tools that can help users better manage how to handle/process EO data (satellite imagery) and analyse EO data (satellite imagery) more effectively.
One of the most usable libraries for this is EO-learn. EO-learn is built in Python and provides users with a comprehensive framework for creating machine learning workflows that use EO data from satellites such as Sentinel-1 and Sentinel-2.

What exactly is eo-learn?
eo-learn is a free and publicly available Python library expressly made to ease the use of working with data from Earth observation sources. The main purpose of eo-learn is to provide users (both developers and researchers) with an easy-to-use interface for creating reusable workflows for downloading, preparing, analyzing, and visualizing data from satellites.
Instead of spending your time building very complex code to process images, eo-learn allows you to quickly build a workflow composed of modular tasks.
Some examples of what eo-learn can do:
Preprocessing of satellite imagery
Removal of cloud cover from images
Analysis of time series of satellite images
Extracting features from satellite imagery
Connecting with machine learning workflows
Visualizing satellite imagery
The modular format of eo-learn allows users to easily change their workflows depending on the requirements of the remote sensing process they are using.
Why Use eo-learn?
eo-learn has gained significant attention from GIS specialists and data analysts because of various factors.
Modular Workflow Structure
As all of the process steps are written as stand-alone tasks, the constructed workflows can be reused and easily maintained.
Integrates Well with Python.
eo-learn integrates well with many popular Python libraries, including:
Optimised For Sentinel Data
The eo-learn library is designed to work with multiple datasets of Earth Observation (EO) data; however, it has been designed specifically for working with data received from Sentinel satellites.
Machine Learning Ready
Another benefit of using EO-learn is that extracted satellite features can easily be directly integrated into machine learning and deep learning models.
Installing eo-learn
Before installing eo-learn, ensure you have Python 3.9 or later installed.
Install eo-learn using pip:
pip install eo-learnOr install individual packages if needed:
pip install eo-learn-core
pip install eo-learn-features
pip install eo-learn-geometry
pip install eo-learn-io
pip install eo-learn-mask
pip install eo-learn-visualizationVerify the installation:
import eolearn
print("eo-learn installed successfully!")The eo-learn Architecture, Understanding
The core concepts are:
EOPatch
The EOPatch (Earth Observation Patch) is the primary data container used in eo-learn.
The EOPatch contains:
Satellite images
Masks
Labels
Vector data
Time series data
Metadata
Most importantly, the EOPatch can be considered to be a structured object with all of the information that pertains to a geographic location.
Example usage would be:
from eolearn.core import EOPatch
patch = EOPatch()
EOTask
The EOTask (Earth Observation Task) represents a single processing task.
Examples of EOTasks are:
Loading imagery into the EOPatch
Calculating vegetation indices
Cloud masking
Feature extraction
Saving results to the EOPatch
EOWorkflow
An EOWorkflow (Earth Observation Workflow) is created by chaining multiple EOTasks, allowing you to automate complex Earth Observation processes.
A typical EOWorkflow would be:
Downloading Data
↓
Cloud Masking
↓
Feature Extraction
↓
Calculating NDVI
↓
Training a Machine Learning Model
↓
Exporting Results
Building Your First eo-learn Environment
Here is an example of how to create an EOPatch.
from eolearn.core import EOPatch
patch = EOPatch()
print(patch)
EOPatch()
Though this is a basic object, it will be the base object for storing and processing satellite data.
Reading Satellite Data
eo-learn integrates well with Sentinel Hub and other earth observation data providers.
A typical workflow creates an EOPatch to hold satellite data, then processes it.
Example pseudocode:
DownloadTask
↓
CloudMaskTask
↓
CalculateNDVITask
↓
SaveTask
Since each task works independently, workflows can be created in a modular fashion.
Calculating NDVI
One of the more common indices for measuring the health of vegetation is called NDVI, or Normalized Difference Vegetation Index.
The NDVI calculation formula is:
NDVI = (NIR – Red)/(NIR + Red).
NDVI is used in a variety of applications to monitor vegetation health, including:
Precision agriculture
Monitoring crops
Forestry
Environmental research
eo-learn also provides you with some useful utilities for extending the capabilities of eo-learn by creating your own features based on NDVI.
Visualizing Earth Observation Data
Visualization is essential for interpreting satellite imagery.
You can use Matplotlib to display processed images.
Example:
import matplotlib.pyplot as plt
plt.imshow(image)
plt.title("Satellite Image")
plt.show()For more advanced visualization, eo-learn also supports interactive plotting tools.
With eo-learn, you can access a powerful, modular system for analysing Earth observation (EO) satellite imagery data in Python, which simplifies your workflow in using Python to analyse satellite imagery data for various uses—crop monitoring, land cover classification, or creating machine learning models for remote sensing.
As EO datasets are exploding in size and complexity, learning how to use EO-learn will help you maximise your productivity and allow you to create complex geospatial analytics solutions using fewer lines of code.
You can get started by playing around with EOPatches, using the included tasks, and building up to an end-to-end workflow for your remote sensing projects.
To learn more about eo-learn and its geospatial capabilities, click here.
For more information or any questions regarding the LizardTech suite of products, please don't hesitate to contact us at:
Email: info@geowgs84.com
USA (HQ): (720) 702–4849
(A GeoWGS84 Corp Company)
