Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .condarc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
channels:
- conda-forge
channel_priority: strict
show_channel_urls: true
21 changes: 0 additions & 21 deletions .github/workflows/binder-cache.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/binder-warmup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Binder cache warmup

on:
push:
branches: [ main ]
schedule:
- cron: "0 3 * * 0" # weekly, Sunday 03:00 UTC
workflow_dispatch:

jobs:
warmup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trigger mybinder.org build
run: |
set -eux
REF="${{ github.ref_name }}"
if [ -z "$REF" ] || [ "$REF" = "refs/heads/" ]; then REF="main"; fi
curl -LsS -o /dev/null -w "%{http_code}\n" \
"https://mybinder.org/build/gh/${{ github.repository }}/$REF" || true
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,43 @@ Many thanks to banesullivan's [localtileserver](https://github.com/banesullivan/
<img src="https://mybinder.org/badge_logo.svg" alt="Launch on Binder" height="28">
</a>

What happens when you click the button (suggested to right click -> open in new tab):
- A temporary, free session is launched on mybinder.org (a community, shared service) that builds a Docker image from this repo’s environment files.
- First launch after a change can take several minutes while the image builds. Subsequent launches are faster (cached), but caches may be evicted at any time.
- Sessions are ephemeral (typically 1–2 hours) and resources are limited. Your session will shut down if idle or when it times out.
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 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]
- NDVI and a basic built-up index [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 a STAC catalog (Microsoft Planetary Computer) for relevant items.
- It selects a recent, low‑cloud Sentinel‑2 scene and optionally a time‑aligned Sentinel‑1 scene.
- On the fly, it computes quicklook products (RGB, NDVI, built‑up index), and prepares tiles from in‑memory COGs.
- Tiles are served inside the session and displayed via ipyleaflet (no data leaves your browser other than tile requests to the Binder session)
- 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

Expand All @@ -56,4 +65,4 @@ What happens when you click the button (suggested to right click -> open in new
- 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
- `voila notebooks/app.ipynb`
15 changes: 9 additions & 6 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ dependencies:
- voila
- ipywidgets
- ipyleaflet
- numpy
- numpy=2.3.*
- pandas
- xarray
- geopandas
- rioxarray
- rasterio
- shapely
- xarray=2025.10.*
- geopandas=1.1.*
- rioxarray=0.19.*
- rasterio=1.4.*
- shapely=2.1.*
- gdal=3.10.*
- matplotlib
- odc-stac
- pystac-client
- planetary-computer
- localtileserver
- jupyter-server-proxy
- pip:
- -e ..
10 changes: 0 additions & 10 deletions binder/postBuild

This file was deleted.

38 changes: 0 additions & 38 deletions dev.pixi.toml

This file was deleted.

Loading