- Connecting to a STAC API: Learn how to establish a connection to a STAC API endpoint.
- Searching items and load them into WherobotsDB: See how to load STAC collections into WherobotsDB for further analysis.
- Applying Spatial and Temporal Filters: Learn to filter the data based on spatial and temporal criteria to focus on specific areas and time periods.
- Saving Data: Discover how to save the filtered data into various formats for further use.
Technical details
- STAC API Integration: Connect to any STAC-compliant API to fetch and process geospatial data.
- DataFrame support: Load STAC data directly into a Sedona DataFrame for further analysis and processing using Spark.
- Flexible input paths: Accepts both local file paths and remote URLs, providing versatility in data sourcing.
Potential use cases
- Geospatial data analysis: Perform complex spatial queries and analyses on large geospatial datasets.
- Environmental monitoring: Access and analyze satellite imagery and other remote sensing data for environmental studies.
- Urban planning: Utilize geospatial data to support urban development and infrastructure planning.
- Disaster response: Quickly access and process geospatial data to aid in disaster response and recovery efforts.
Find STAC service endpoints
By leveraging the STAC data source, users can efficiently manage and analyze vast amounts of geospatial data, unlocking new insights and applications across various domains.Load a STAC collection from an HTTP/HTTPS endpoint:
This code below uses Apache Sedona and PySpark to load STAC data from the Sentinel-2 collection via a specified URL. It then explodes the “assets” map into key-value pairs, extracting the “href” and “rast” fields from the “value” struct. The resulting DataFrame is ordered by the “datetime” field in descending order. Finally, it counts the number of rows in the processed DataFrame to verify the output. Note: if you need to load the image using the out-db reader from S3, you need to setup the correct S3 credential provider in Sedona config if the provider of the data requries non-anonymous access. See the docs on our Storage Integration.Check the number of rows loaded by the STAC reader and explode it to araster dataframe
Integrate with OutDB Raster
This code filters thedf_rast DataFrame to select rows where the href column ends with .tif, limits the results to 4 rows, and converts the rast field into an image using the RS_AsImage function. The resulting DataFrame, which contains the generated images, is then displayed using SedonaUtils.display_image.

