Skip to content

Voila and Binder interactvie web map for fetching (Xarray-standard) and visualzing COGs (localtileserver) from the Planetary Computer STAC

License

Notifications You must be signed in to change notification settings

Jack-Hayes/planetquery

Repository files navigation

PlanetQuery

Warning: This project is under active development and in an early stage. Expect frequent changes.

weeooweeoo

Draw a box anywhere on Earth and explore RGB (Sentinel‑2), SAR (Sentinel‑1), and contextual layers (ESA WorldCover). PlanetQuery is a purely Python-based web map explorer that leverages open STAC catalogs and Cloud-Optimized GeoTIFFs (COGs). Support for additional STAC catalogs is in progress.

Credit to @scottyhq, @gbrencher, and @egagli for inspiration and code logic.

Many thanks to banesullivan's localtileserver package and 'issue' replies

Try it in your browser (no install)

Launch on Binder

What happens when you click the button:

  • mybinder.org uses repo2docker to build a Docker image for this repo using binder/environment.yml and runtime.txt (Python 3.11 base)
  • The conda environment is solved/installed with mamba from conda-forge; during the build, pip installs this repo in editable mode (-e .)
  • The built image is cached by mybinder.org for the given Git ref; first builds can take several minutes, later builds are usually faster until the cache is evicted
  • Sessions are ephemeral and resource-limited; they time out when idle (~10 mins) or after a short lifetime

Notes and expectations

  • First launch: building can take several minutes; please be patient.
  • If you see "Building' or "Pending," Binder is queuing your session or compiling the environment.
  • If tiles don’t appear immediately after "Fetch & Display Data," wait a few seconds.
  • Don't sample large areas -- this will drop performace. Less than 30km2 is a good bet.
  • The app depends on external open data services; occasional slowdowns or gaps can occur.

What you can do

  • Pick a date range, draw an Area of Interest (blue) on the map, then click "Fetch & Display Data."
  • Toggle layers in the layer control:
    • RGB composite (Sentinel‑2) [lowest cloud coverage in date range is selected]
    • SAR backscatter (Sentinel‑1) [acquisition closest to Sentinel-2 image is selected]
    • Coopernicus 30-GLO DEM Multidirectional Hillshade
    • ESA WorldCover (classified land cover) [2021]
  • Draw a red Region of Interest (ROI) to sample statistics from visible layers.

How it works (high level)

  • You draw an area; the app searches the Microsoft Planetary Computer STAC API for relevant items
  • It selects a low‑cloud Sentinel‑2 scene and a time‑aligned Sentinel‑1 scene
  • It computes quicklook products:
    • Sentinel‑2 RGB
    • Sentinel‑1 VV/VH in decibels
    • Multidirectional hillshade from Copernicus GLO‑30
    • ESA WorldCover mapped to RGB colors
  • Rasters are written to in‑memory COGs and served by localtileserver running in your Binder session.
  • ipyleaflet requests tiles via Jupyter Server Proxy (e.g., /proxy/{port}); the browser only talks to the Binder pod, while the pod fetches data from the Planetary Computer.

NOTE: All layers / STAC endpoints are oprtional

Contributing

  • TBD

Development (for contributors)

  • This repo is Python-first and uses standard tools (ipywidgets, ipyleaflet, xarray, rioxarray, rasterio).
  • Local setup suggestions (pick your preferred workflow):
    • Conda/mamba: create an environment similar to binder/environment.yml, then pip install -e .
    • Or use your own stack and ensure GDAL/Rasterio/PROJ are consistent.
  • Run notebooks locally with JupyterLab or launch the Voila app:
    • voila notebooks/app.ipynb

About

Voila and Binder interactvie web map for fetching (Xarray-standard) and visualzing COGs (localtileserver) from the Planetary Computer STAC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published