Skip to content
Snippets Groups Projects
Commit 0d53482a authored by David Hoese's avatar David Hoese
Browse files

Change tile generation to default to /data directory for output

parent eb98aa4d
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,5 @@ docker push gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/tile_gen:late
## Usage
```bash
docker run -p 8888:80 -d gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/mapserver:latest
docker run -d ---rm --network cspp-geo-rabbit --cpus 2 --name cspp-geo-tilegen-g16-radf -e AMQPFIND_TOPIC="data.goes.g16.abi.radf.l1b.geotiff.complete" -v cspp-geo-abi-l1b-geotiffs:/data gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/tile_gen:latest
```
Then the main mapserv CGI script can be accessed with:
http://localhost:8888/cgi-bin/mapserv
......@@ -15,9 +15,6 @@
# Verify that the data mount is available
test -d "/data"
# Change to /data volume to write our output
test -d "/dst"
export AMQPFIND_ARGS=${AMQPFIND_ARGS:-"-H cspp-geo-rabbit -X satellite -u guest -p guest"}
export AMQPSEND_ARGS=${AMQPSEND_ARGS:-"-H cspp-geo-rabbit -X satellite -u guest -p guest"}
export AMQPFIND_TOPIC=${AMQPFIND_TOPIC:-'data.goes.*.abi.*.l1b.geotiff.complete'}
......@@ -26,7 +23,7 @@ export TILE_ARGS=${TILE_ARGS:-""}
export TMPDIR=${TMPDIR:-"/dst/tmp"}
run_tile_gen() {
if [ $# -ne 5 ]; then
if [[ $# -ne 5 ]]; then
echo "Unexpected number of arguments (expected 5): $#"
return 1
fi
......@@ -40,15 +37,24 @@ run_tile_gen() {
# convert path from a relative path to an absolute path
path="/data/${path}"
# if /dst isn't defined then use /data
if [[ -d "/dst" ]]; then
dst_dir="/dst"
else
dst_dir="/data"
fi
# update shapefile in a temporary directory
# and resample geotiff if necessary
# FUTURE: TileDB will be updated in-place
# generate_tiles.py will make a temporary directory
out_dir="/dst/tiles/${satellite_family}/${satellite_id}/${instrument}"
out_dir="${dst_dir}/tiles/${satellite_family}/${satellite_id}/${instrument}"
mkdir -p ${out_dir}
python3 generate_tiles.py ${TILE_ARGS} -p ${G2G_PRODUCTS} -- ${out_dir} ${path}
# OUT/<product>/<product>.shp
glob_pattern="${out_dir}/*/*.shp"
# Remove the /data prefix
glob_pattern="${glob_pattern/${dst_dir}\//}"
amqpsend_topic="data.${satellite_family}.${satellite_id}.${instrument}.${data_type}.l1b.tiledb.complete"
json_info="{path: ${glob_pattern}, satellite_family: ${satellite_family}, satellite_ID: ${satellite_id}, instrument: ${instrument}, data_type: ${data_type}}"
......
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