Skip to content

Commit

Permalink
Add some example Pacific datacube setup configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgleith committed Jun 22, 2023
1 parent 30db4cb commit 651eeb1
Show file tree
Hide file tree
Showing 5 changed files with 782 additions and 1 deletion.
70 changes: 70 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.PHONY: up products index-sentinel-1

# BBOX over Samoa and Tonga
BBOX := -180.0,-20.0,-170.0,-10.0

up:
docker compose up

products:
dc-sync-products products.csv

index-all: index-landsat-5 index-landsat-7 index-landsat-8 index-landsat-9 index-sentinel-1 index-sentinel-2 index-nasadem index-esri-lc

index-esri-lc:
stac-to-dc \
--catalog-href=https://planetarycomputer.microsoft.com/api/stac/v1/ \
--collections=io-lulc-9-class \
--bbox=${BBOX}

index-nasadem:
stac-to-dc \
--catalog-href=https://planetarycomputer.microsoft.com/api/stac/v1/ \
--collections=nasadem \
--bbox=${BBOX}

index-sentinel-1:
stac-to-dc \
--catalog-href='https://planetarycomputer.microsoft.com/api/stac/v1/' \
--bbox='$(BBOX)' \
--datetime='2023-01-01/2023-12-31' \
--collections='sentinel-1-rtc'

index-sentinel-2:
stac-to-dc \
--catalog-href='https://planetarycomputer.microsoft.com/api/stac/v1/' \
--bbox='$(BBOX)' \
--datetime='2023-01-01/2023-12-31' \
--collections='sentinel-2-l2a'

index-landsat-5:
stac-to-dc \
--catalog-href=https://planetarycomputer.microsoft.com/api/stac/v1/ \
--bbox=${BBOX} \
--collections=landsat-c2-l2 \
--options="query={\"platform\":{\"in\":[\"landsat-5\"]}}" \
--rename-product=ls5_c2l2_sr

index-landsat-7:
stac-to-dc \
--catalog-href=https://planetarycomputer.microsoft.com/api/stac/v1/ \
--bbox=${BBOX} \
--collections=landsat-c2-l2 \
--options="query={\"platform\":{\"in\":[\"landsat-7\"]}}" \
--rename-product=ls7_c2l2_sr

index-landsat-8:
stac-to-dc \
--catalog-href=https://planetarycomputer.microsoft.com/api/stac/v1/ \
--bbox=${BBOX} \
--collections=landsat-c2-l2 \
--options="query={\"platform\":{\"in\":[\"landsat-8\"]}}" \
--rename-product=ls8_c2l2_sr

index-landsat-9:
stac-to-dc \
--catalog-href=https://planetarycomputer.microsoft.com/api/stac/v1/ \
--bbox=${BBOX} \
--collections=landsat-c2-l2 \
--options="query={\"platform\":{\"in\":[\"landsat-9\"]}}" \
--rename-product=ls9_c2l2_sr
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# pacific-cube-in-a-box
# Pacific Cube-in-a-Box

A simple example of the use of Microsoft Planetary Computer-hosted
data with the Open Data Cube.

## Getting started

Use the Makefile commands, or run the commands in them manually. You
need to have environment variables exported for connectivity to the
Postgres database too, which runs in Docker.

* Export environment variables:
``` bash
export DB_HOSTNAME=localhost
export DB_USERNAME=pacific
export DB_PASSWORD=secretpassword
export DB_DATABASE=odc
```
* Start the postgres DB: `make up` or `docker compose up`
* Add products: `make products` or `dc-sync-products products.csv`
* Index data individually or do it all with `make index-all`
* Now you can use any of the products. There's only one example notebook
for now, for [Sentinel-1](notebooks/Sentinel1_Basic.ipynb).


## Next steps

Todo: get OWS and Explorer working as well a little Terria to visualise OWS
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
postgis:
image: mdillon/postgis:9.6
restart: always
environment:
POSTGRES_USER: pacific
POSTGRES_PASSWORD: secretpassword
POSTGRES_DB: odc
ports:
- "5432:5432"
Loading

0 comments on commit 651eeb1

Please sign in to comment.