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

Add basic layer_times CGI script as workaround for no time information

parent 11fe4582
No related branches found
No related tags found
No related merge requests found
......@@ -50,11 +50,12 @@ RUN cd /build_deps && apt-get -y install apache2 libapache2-mod-fcgid && \
COPY site-conf /etc/apache2/sites-available/cspp_geo.conf
# disable the default which would conflict with our custom
RUN a2ensite cspp_geo && a2dissite 000-default
COPY cgi-bin/* /usr/lib/cgi-bin/
# Point apache to the mapserver binary
RUN ln -s /usr/local/bin/mapserv /usr/lib/cgi-bin/mapserv && \
chown ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/mapserv && \
chown -h ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/mapserv
chown ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/* && \
chown -h ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/*
COPY mapfiles/ /work/mapfiles/
COPY html/ /var/www/html/
......
#!/usr/bin/env python3
import cgi
import json
import fiona
form = cgi.FieldStorage()
layer = form['layer'].value
with fiona.open(layer, 'r') as shp_file:
times = [x['properties']['time'] for x in shp_file]
print("Content-Type: application/json")
print() # blank line, end of headers
print(json.dumps(times))
......@@ -30,7 +30,13 @@
# Custom CSPP Geo
# LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
# /wms/goes16/abi/fldk/
RewriteRule "^/wms/([^/]+)/([^/]+)/([^/]+)/l1b?(.*)" "/cgi-bin/mapserv?map=/work/mapfiles/$1_$2_$3_l1b.map&$4" [PT,QSA]
# /wms_times/g16/abi/radf/true_color
RewriteRule "^/wms_times/([^/]+)/([^/]+)/([^/]+)/([^/]+)" "/cgi-bin/layer_times.py?layer=/data/tiles/$1/$2/$3/$4/$4.shp" [PT,QSA]
# FIXME: We need to include the sector
# /data/goes/grb/goes16/2020/2020_01_21_021/abi/L1b/RadF/GOES-16_ABI_RadF_C01_20200121_000016_GOES-East.tif
# "/data/tiles/g16/abi/radf/true_color/true_color"
LogLevel alert rewrite:trace6
</VirtualHost>
......
......@@ -12,3 +12,18 @@ docker push gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/tile_gen:late
```bash
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
```
To run the version of tile generation that remaps to EPSG:4326:
```bash
docker run -d --rm --network cspp-geo-rabbit --cpus 6 --name cspp-geo-tilegen-g16-radf-ll -e AMQPFIND_TOPIC="data.goes.g16.abi.radf.l1b.geotiff.complete" -e TILE_ARGS="--remap --shape-file {product}_LL.shp" -v cspp-geo-abi-l1b-geotiffs:/data gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/tile_gen:latest ./run.sh
```
NOTE: For full disk the above can take a really long time and fall behind.
It may be best to limit this to one or two products for testing by adding:
```
-e G2G_PRODUCTS="true_color"
```
And adding more CPUs.
\ No newline at end of file
......@@ -48,7 +48,11 @@ run_tile_gen() {
# and resample geotiff if necessary
# FUTURE: TileDB will be updated in-place
# generate_tiles.py will make a temporary directory
out_dir="${dst_dir}/tiles/${satellite_family}/${satellite_id}/${instrument}"
out_dir="${dst_dir}/tiles/${satellite_id}/${instrument}/${data_type}"
# if we are going to remap, separate the geotiffs and shapefile from unremapped
if [[ ${TILE_ARGS} == *"--remap" ]]; then
out_dir="${out_dir}_ll"
fi
mkdir -p ${out_dir}
# add string formatting portion to separate add 'product' sub-directory
out_dir="${out_dir}/{product}"
......
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