This Python code provides a custom QGIS plugin widget that allows users to interact with time-series images from Sentinel. It includes functionalities like filtering images by date, zooming to a specific point, and a time-lapse feature that plays through the images in time order. Additionally, it includes a Layer Grid view to display small previews of all layers in a grid.
- Filter Sentinel's images by date range
- Time-lapse playback through the images
- Zoom to a specific point
- Layer Grid for a quick overview
- Play, Stop, and Remove Layers buttons
- Make sure you have QGIS installed on your system (Download).
- Install the lib
satsearch
to search images Sentinel
satsearch
is a Python library for discovering public satellite imagery. This README provides step-by-step instructions for installing satsearch
within the Python environment used by QGIS on Windows.
- Command Prompt with administrative rights
-
Locate the Python executable associated with your QGIS installation. The path often resembles:
C:\Program Files\QGIS XXX\apps\Python39\
Note: Replace
XXX
with your specific QGIS version number.
- Navigate to the start menu, search for "Command Prompt", right-click on it and select "Run as administrator".
-
In the Command Prompt, execute the following command to install
satsearch
using pip. Replacepath_to_qgis_python
with the actual path you found in Step 1.C:\path_to_qgis_python\python.exe -m pip install satsearch
This will install
satsearch
into the Python environment used by QGIS.
-
Verify the installation by executing:
C:\path_to_qgis_python\python.exe -m pip show satsearch
This should display information about the installed package, including its version.
-
You can now use
satsearch
in your QGIS Python scripts as shown below:from satsearch import Search
- If you encounter permissions or access rights errors, ensure that you are running the Command Prompt as an administrator.
- If
pip
is not found, it may need to be installed in your QGIS Python environment. Installation methods can vary based on your QGIS version.
When you cannot install the satsearch
and satstac
packages directly into your QGIS Python environment using package managers like pip
, you can manually add these libraries. This involves downloading the directories from a specific GitHub repository and then copying them to the appropriate location within the QGIS Python environment.
- You need administrative rights to copy files into
C:\Program Files\QGIS XXX\apps\Python39\Lib
. - Internet access to download
satsearch
andsatstac
directories from the GitHub repository.
- Go to the GitHub repository at https://github.com/tharlestsa/qgis-sie.
- Download the repository to your local machine, either by using the 'Download ZIP' option or by cloning the repository using Git.
Unzip the downloaded repository and navigate to the location where the satsearch
and satstac
folders are stored.
- Open File Explorer and navigate to the Python environment folder inside your QGIS installation, usually located at
C:\Program Files\QGIS XXX\apps\Python39\Lib
. - Here,
XXX
refers to the version of QGIS you have installed.
- Right-click on the
satsearch
folder and chooseCopy
. - Navigate back to the
C:\Program Files\QGIS XXX\apps\Python39\Lib
directory. - Right-click in the folder and choose
Paste
to copy thesatsearch
folder here.
Repeat these steps for the satstac
folder.
If prompted, confirm that you have the administrative rights to copy files into this directory.
To ensure that the libraries are correctly installed, you can open the QGIS Python console and try importing satsearch
and satstac
by typing the following commands:
import satsearch
import satstac
- Open QGIS.
- Open the Python Console (
Plugins -> Python Console
or pressCtrl+Alt+P
). - Go to the
Show Editor
tab. - Copy-paste the script
sie.py
into the editor and run it.
- Open the widget from your QGIS interface.
- Use the date filters to set a start and end date for the mosaics.
- Optionally, enter coordinates to zoom to a specific point.
- Use the Play button to start a time-lapse through the mosaics.
- Use the Stop button to stop the time-lapse.
- Use the Grid button to view a grid of all layers.
- Use the Remove Layers button to remove all the current layers from the project.
This project is open source and available under the MIT License.
This plugin makes use of data and software services from several organizations and platforms. We are grateful for their support and the valuable resources they provide.
QGIS: This plugin would not have been possible without the robust and open-source capabilities of QGIS. Special thanks to the QGIS development community for providing the software and resources that make advanced geospatial analysis accessible. More information about QGIS can be found on their official website.
- Copernicus Sentinel: The Sentinel satellite data used in this project is part of the Copernicus program by the European Space Agency. For more information, visit Copernicus Open Access Hub.
- Earth Search: We use the Earth Search API by Element 84 for querying Sentinel data. Their STAC-compliant API provides easy and fast access to satellite imagery. For more information, check their API documentation at Earth Search API.
- titiler: This project uses titiler for dynamic tiling of geospatial data. Developed by Development Seed, titiler provides a high-performance, customizable solution for serving raster data. View the source code and documentation on their GitHub repository.