Skip to content

Commit 474da8c

Browse files
authored
Add GDAL reprojection example (#51)
1 parent 9bd1123 commit 474da8c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

reproject.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
#COILED n-tasks 3111
4+
#COILED max-workers 100
5+
#COILED region us-west-2
6+
#COILED memory 8 GiB
7+
#COILED container ghcr.io/osgeo/gdal
8+
#COILED forward-aws-credentials True
9+
10+
# Install aws CLI
11+
if [ ! "$(which aws)" ]; then
12+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
13+
unzip -qq awscliv2.zip
14+
./aws/install
15+
fi
16+
17+
# Download file to be processed
18+
filename=$(aws s3 ls --no-sign-request --recursive s3://sentinel-cogs/sentinel-s2-l2a-cogs/54/E/XR/ | \
19+
grep ".tif" | \
20+
awk '{print $4}' | \
21+
awk "NR==$(($COILED_BATCH_TASK_ID + 1))")
22+
aws s3 cp --no-sign-request s3://sentinel-cogs/$filename in.tif
23+
24+
# Reproject GeoTIFF
25+
gdalwarp -t_srs EPSG:4326 in.tif out.tif
26+
27+
# Move result to processed bucket
28+
aws s3 mv out.tif s3://oss-scratch-space/sentinel-reprojected/$filename

0 commit comments

Comments
 (0)