EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 413a6b8c authored by Mussab Abdalla's avatar Mussab Abdalla
Browse files

check gdal vsiswift readings

parent 73e0e803
No related branches found
No related tags found
1 merge request!29Preprocessor test
......@@ -42,7 +42,6 @@ docker stack deploy -c ../docker-compose.emg.yml -c ../docker-compose.emg.dev.ym
apk update && apk add bash postgresql-dev gcc g++ python3 python3-dev musl-dev py-pip libffi-dev openssl-dev make gdal gdal-dev
pip3 install -r requirements.txt
python3 preprocessor_test.py
./docker-stack-wait.sh -n renderer -n registrar -n preprocessor -n ingestor -n sftp emg-pvs
docker service ls
......
import sys
import os
from dotenv import load_dotenv
from osgeo import gdal
version_num = int(gdal.VersionInfo('VERSION_NUM'))
print(version_num)
if version_num < 1100000:
sys.exit('ERROR: Python bindings of GDAL 1.10 or later required')
\ No newline at end of file
# ST_AUTH_VERSION=3
# OS_AUTH_URL_SHORT=https://auth.cloud.ovh.net/
# OS_AUTH_URL=https://auth.cloud.ovh.net/v3/
# OS_USERNAME=xqNChf3Rz5vs
# OS_TENANT_NAME=7398560954290261
# OS_TENANT_ID=1b418c4359064774af5d55da3f4bcac0
# OS_REGION_NAME=SERCO-DIAS1
# load_dotenv(dotenv_path='../env/emg_obs.env')
# gdal.SetConfigOption('SWIFT_AUTH_V3_URL', os.environ['ST_AUTH_VERSION'])
# gdal.SetConfigOption('SWIFT_USER', os.environ['OS_AUTH_URL_SHORT'])
# gdal.SetConfigOption('SWIFT_KEY', os.environ['OS_AUTH_URL'])
# gdal.SetConfigOption('SWIFT_STORAGE_URL', os.environ['OS_USERNAME'])
# gdal.SetConfigOption('SWIFT_AUTH_TOKEN', os.environ[''])
image = gdal.Open('/vsiswift/preprocessor_results/KS03_AIS_PSH_1G_20160101T113020_20160101T113022_KGS_019339_75CE.tar/K3_20160101113014_19339_02281264_L1G.tif', gdal.GA_ReadOnly)
srcband = image.GetRasterBand(1)
print ("[ NO DATA VALUE ] = ", srcband.GetNoDataValue())
print ("[ MIN ] = ", srcband.GetMinimum())
print ("[ MAX ] = ", srcband.GetMaximum())
print ("[ SCALE ] = ", srcband.GetScale())
print ("[ UNIT TYPE ] = ", srcband.GetUnitType())
......@@ -28,6 +28,5 @@ while read key value ; do
fi
done < preprocessor_test.txt
gdalinfo /vsiswift/preprocessor_results/KS03_AIS_PSH_1G_20160101T113020_20160101T113022_KGS_019339_75CE.tar/K3_20160101113014_19339_02281264_L1G.tif
python3 preprocessor_test.py
rm preprocessor_test.txt
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment