-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert-geoparquet.sh
executable file
·30 lines (26 loc) · 1.41 KB
/
convert-geoparquet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#Note: gdal > 3.8.4
# requires aws-cli and docker installed!
my_array=()
while IFS= read -r line; do
my_array+=( "$line" )
done < <( /bin/aws s3 ls emotional-cities/geojson/dtu/ | sed -nr 's/.* ([^ ]*.)/\1/p' )
# my_array_length=${#my_array[@]}
# echo ${my_array_length}
for element in "${my_array[@]}"
do
echo "converting ${element}..."
filename=$(basename -- ${element} .geojson)
#echo ${filename}
docker run ghcr.io/osgeo/gdal:ubuntu-full-3.8.4 \
ogr2ogr --config AWS_REGION "eu-central-1" --config AWS_ACCESS_KEY_ID $AWSAccessKeyId \
--config AWS_SECRET_ACCESS_KEY $AWSSecretKey -f parquet /vsis3/emotional-cities/geoparquet/${filename}.parquet \
/vsis3/emotional-cities/geojson/dtu/${element}
done
echo "done!"
#docker run -v "${PWD}/data:/mnt" ghcr.io/osgeo/gdal:ubuntu-full-3.8.4 ogrinfo --version
#docker run -v "${PWD}/data:/mnt" ghcr.io/osgeo/gdal:ubuntu-full-3.8.4 ogr2ogr -f parquet /mnt/obs.parquet /mnt/obs.geojson
#docker run -v "${PWD}/data:/mnt" ghcr.io/osgeo/gdal:ubuntu-full-3.8.4 python3 /mnt/validate_geoparquet.py /mnt/obs.parquet
#./gpq validate data/obs.parquet
#docker run -v "${PWD}/data:/mnt" ghcr.io/osgeo/gdal:ubuntu-full-3.8.4 ./mnt/gpq validate /mnt/obs.parquet
#ogrinfo --config AWS_REGION "eu-central-1" --config AWS_ACCESS_KEY_ID $AWSAccessKeyId --config AWS_SECRET_ACCESS_KEY $AWSSecretKey /vsis3/emotional-cities/geojson/a00000009.geojson