WASDI documentation center Logo

Getting started

  • Wasdi Web Platform access and basic usage
  • Wasdi Libraries Concepts
  • Mini-WASDI Docker Image Usage

Wasdi User Manual

  • Signing Up and Signing In
  • Workspace Management and Use
  • Searching for Products
  • Managing Subscriptions and Organizations
  • Other

Wasdi Applications

  • Wasdi App Store
  • Flood Mapping
  • SAR Flood Archive Generator 3.3.7
  • Flood Frequency Map Generator
  • Wheat Locator
  • Landslide Detection S2

Programming tutorials

  • Python Tutorial
  • Jupyter Notebook Tutorial
  • Python Landsat Tutorial
  • Search and Import EO Images
  • Octave Tutorial
  • Configuration tutorial
  • Working with Workspaces and Products
  • Synchronous and Asynchronous WASDI programming
  • C# Tutorial
  • Site Map
  • How to create a User Interface (UI)
  • Javascript Web Tutorial
  • Javascript Angular Tutorial
  • WASDI Apps Good Practices

Libraries references

  • C# WasdiLib
  • Java WasdiLib
  • Matlab WasdiLib
  • Octave WasdiLib
  • Python WasdiLib
  • Javascript WasdiLib

API references

  • WASDI REST API

Python Cookbook

  • Create a config.json file
  • Python Application Skeleton
  • Read Parameters
  • Import Images after a Search
    • Prerequisites
    • Recipe
  • Import And Pre-Process
  • Search Sentinel-1 Images
  • Search Sentinel-2 Images
  • Search Sentinel-3 Images
  • Search Sentinel-5p products
  • Search Copernicus Marine products
  • Search ECOSTRESS products
  • Search ERA5 products
  • How to Import GFS Forecast Products
  • Use CDS library to download ERA-5 products in WASDI
  • Run Snap Workflow
  • Run Another WASDI Application
  • Save Payload
  • Get list of S2 tiles in an area of interest
  • Use Library as client
  • Change HTTP request timeouts
  • Install specific packages in Jupyter Notebooks
  • How to use matplotlib and plotly in WASDI
  • How to Use and Import Shapefiles in WASDI
  • Install GDAL in Windows

API Documentation

  • WASDI REST API

Inside wasdi

  • Add a Data Provider to WASDI
  • Add Application User Interface controls
  • Add a New Processor Type to WASDI
  • WASDI Configuration Documentation

Legal

  • EULA
  • Privacy policy
WASDI documentation center
  • Import Images after a Search
  • View page source

Import Images after a Search

The following code shows how to import the results of a search to a workspace.

Prerequisites

To run this code you need:
  • A running Python 3.x Environment

  • A valid WASDI Account

  • A valid Config file

  • A valid params.json file

If this is not clear, you probably need to take a look to the Python Tutorial before.

Recipe

Note

We will use Sentinel-1 for this sample but the same code can be used for all the missions and image types.

Note

In the code, you will see different options. Most likely, you will want to choose the one that best fits your needs.

This is our sample params.json file.

{
    "START_DATE": "2023-01-01",
    "END_DATE": "2023-01-01",
    "BBOX": {
    "northEast": {
        "lat": 20.1,
        "lng": 44.4
        },
    "southWest": {
        "lat": 19.3,
        "lng": 43.2
        }
    },
    "MISSION": "S1",
    "PRODUCT_TYPE": "GRD"
}
# Read Bounding Box, Start and End Date
oBBox = wasdi.getParameter("BBOX", None)
sStartDate = wasdi.getParameter("START_DATE", "2023-01-01")
sEndDate = wasdi.getParameter("END_DATE", "2023-01-31")

# Read Mission and Product Type
sMission = wasdi.getParameter("MISSION", "S1")
sProductType = wasdi.getParameter("PRODUCT_TYPE", "GRD")

# Search Images
aoProductsFoundArray = wasdi.searchEOImages(sMission, sStartDate, sEndDate, sProductType=sProductType, oBoundingBox=oBBox)

# OPTION 1: Import a single image and wait for the image to be available
if len(aoProductsFoundArray) > 0:
   wasdi.importProduct(aoProductsFoundArray[0])

# OPTION 2: Import a single image WITHOUT waiting for it:
if len(aoProductsFoundArray) > 0:
   sProcessId = wasdi.asynchImportProduct(aoProductsFoundArray[0])
   # Here you can do what you want
   wasdi.wasdiLog("Started Import of one image, the associated process id is " + sProcessId)
   # Call this if you need to wait
   wasdi.waitProcess(sProcessId)

# OPTION 3: Import All Products and wait for the images to be available
wasdi.importProductList(aoProductsFoundArray)

# OPTION 4: Import All Products without waiting
sProcessId = wasdi.asynchImportProductList(aoProductsFoundArray)
# Here you can do what you want
wasdi.wasdiLog("Started Import of all images, the associated process id is " + sProcessId)
# Call this if you need to wait
wasdi.waitProcess(sProcessId)

What it does:

  • Reads Input Parameters

  • Starts searching for S1 GRD Images

  • Imports 1 Product

  • Asynchronously imports 1 Product

  • Imports All Products

  • Asynchronously imports all Products

Previous Next

© Copyright 2025, WASDI Sàrl.

Built with Sphinx using a theme provided by Read the Docs.