diff --git a/mapserver/Dockerfile b/mapserver/Dockerfile index 855decd7a7a5a9f7f695bd449782fca087944ce2..4982922f612c61545f4c07e9763f387df8934e28 100644 --- a/mapserver/Dockerfile +++ b/mapserver/Dockerfile @@ -60,6 +60,12 @@ RUN ln -s /usr/local/bin/mapserv /usr/lib/cgi-bin/mapserv && \ COPY mapfiles/ /work/mapfiles/ COPY html/ /var/www/html/ +# Add our own custom EPSG codes (HACK) +# GOES-16 ABI Full Disk = EPSG:930916 +# GOES-17 ABI Full Disk = EPSG:930917 +COPY sql/ /work/sql/ +RUN sqlite3 -init /work/sql/goesr_crs.sql /usr/local/share/proj/proj.db + # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL WINCH diff --git a/mapserver/README.md b/mapserver/README.md index f925f355156b5a6de637777d748d56734ef877e6..7361c7f4a16ccdd6fa4854c5ed4fcdf4007097d9 100644 --- a/mapserver/README.md +++ b/mapserver/README.md @@ -3,9 +3,23 @@ ## Usage ```bash -docker run -p 8888:80 -d --name cspp-geo-mapserver -v cspp-geo-abi-l1b-geotiffs:/data gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/mapserver:latest +docker run -p 8888:80 -d --rm --name cspp-geo-mapserver -v cspp-geo-abi-l1b-geotiffs:/data gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/mapserver:latest ``` Then the main mapserv CGI script can be accessed with: http://localhost:8888/cgi-bin/mapserv + +## Special Notes + +This image has had its installation of the PROJ library modified to include +new non-standard EPSG codes to support the projections of certain satellite +instruments. These additions are part of the Dockerfile build process and +include the following definitions: + +1. EPSG:930916 - The GOES-16 ABI Fixed Grid geostationary coordinate reference + system. The numbers are meant to represent "GEOG16" while also attempting + to avoid conflicts with future additions to the official EPSG database. +2. EPSG:930917 - The GOES-17 ABI Fixed Grid geostationary coordinate reference + system. The numbers are meant to represent "GEOG17" while also attempting + to avoid conflicts with future additions to the official EPSG database. diff --git a/mapserver/mapfiles/g16_abi_radf_l1b.map b/mapserver/mapfiles/g16_abi_radf_l1b.map index e90aa7a5af4f8b4abf10e835c3ae5fcb873a1c9c..d989dc4c112317afecca7c6e324e3ec384f5784b 100644 --- a/mapserver/mapfiles/g16_abi_radf_l1b.map +++ b/mapserver/mapfiles/g16_abi_radf_l1b.map @@ -4,7 +4,7 @@ MAP EXTENT -180 -90 180 90 PROJECTION - "init=epsg:4326" + "init=epsg:930916" END WEB @@ -34,7 +34,7 @@ MAP # Comment below to default to transparency # OFFSITE 0 0 0 PROJECTION - "auto" + "init=epsg:930916" END METADATA "wms_title" "GOES-16 ABI True Color" @@ -91,6 +91,9 @@ MAP TILEINDEX "true_color_index" # Comment below to default to transparency # OFFSITE 0 0 0 + PROJECTION + "init=epsg:930916" + END METADATA "wms_title" "GOES-16 ABI True Color" "wms_extent" "-180 -90 180 90" diff --git a/mapserver/sql/goesr_crs.sql b/mapserver/sql/goesr_crs.sql new file mode 100644 index 0000000000000000000000000000000000000000..0cbf495a70ae4aa8f38bd1da6fc4c3a9cd036e3e --- /dev/null +++ b/mapserver/sql/goesr_crs.sql @@ -0,0 +1,2 @@ +INSERT INTO projected_crs (auth_name, code, name, description, scope, coordinate_system_auth_name, coordinate_system_code, geodetic_crs_auth_name, geodetic_crs_code, conversion_auth_name, conversion_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated) VALUES ('EPSG', '930917', 'GOES-17 ABI Fixed Grid', 'GOES-17 (GOES-WEST) ABI Fixed Grid in the Geostationary projection', null, null, null, 'EPSG', '4269', null, null, null, null, 'PROJCRS["GOES-17 ABI Fixed Grid",BASEGEOGCRS["GOES-17 ABI Fixed Grid",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]],ID["EPSG",6269]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8901]]],CONVERSION["unknown",METHOD["Geostationary Satellite (Sweep X)"],PARAMETER["Longitude of natural origin",-137,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Satellite Height",35786023,LENGTHUNIT["metre",1,ID["EPSG",9001]]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]]]', 0); +INSERT INTO projected_crs (auth_name, code, name, description, scope, coordinate_system_auth_name, coordinate_system_code, geodetic_crs_auth_name, geodetic_crs_code, conversion_auth_name, conversion_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated) VALUES ('EPSG', '930916', 'GOES-16 ABI Fixed Grid', 'GOES-16 (GOES-WEST) ABI Fixed Grid in the Geostationary projection', null, null, null, 'EPSG', '4269', null, null, null, null, 'PROJCRS["GOES-16 ABI Fixed Grid",BASEGEOGCRS["GOES-16 ABI Fixed Grid",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]],ID["EPSG",6269]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8901]]],CONVERSION["unknown",METHOD["Geostationary Satellite (Sweep X)"],PARAMETER["Longitude of natural origin",-75,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Satellite Height",35786023,LENGTHUNIT["metre",1,ID["EPSG",9001]]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]]]', 0); \ No newline at end of file diff --git a/tile_gen/README.md b/tile_gen/README.md index 290548a15e052dc7dfa86435a706bc86343685b9..ac6fa4d140449483cfe400b8ab3699813fab4f5f 100644 --- a/tile_gen/README.md +++ b/tile_gen/README.md @@ -10,7 +10,7 @@ docker push gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/tile_gen:late ## Usage ```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 +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 ./run.sh ``` To run the version of tile generation that remaps to EPSG:4326: diff --git a/tile_gen/run.sh b/tile_gen/run.sh index 18f1bf4923cad42b1d593a401181728e7c863b17..449169bbe594746a7cd09bca1f245ccb7579816b 100755 --- a/tile_gen/run.sh +++ b/tile_gen/run.sh @@ -69,7 +69,7 @@ run_tile_gen() { 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}}" +# json_info="{path: ${glob_pattern}, satellite_family: ${satellite_family}, satellite_ID: ${satellite_id}, instrument: ${instrument}, data_type: ${data_type}}" json_info="{\"path\": \"${glob_pattern}\", \"satellite_family\": \"${satellite_family}\", \"satellite_ID\": \"${satellite_id}\", \"instrument\": \"${instrument}\", \"data_type\": \"${data_type}\"}" echo -e "[[\"$amqpsend_topic\", $json_info]]" | python3 /work/amqpfind/amqpsend.py ${AMQPSEND_ARGS} echo "Done generating tiles for ${path}"