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

Merge branch 'doc-update-readmes' into 'master'

Bug fixes and README updates

See merge request cspp_geo/cspp-geo-web-viewer!11
parents 2b8d503b 5a9e49d1
No related branches found
No related tags found
No related merge requests found
# MapServer # MapServer
## Build
```bash
docker build -t gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/mapserver:latest mapserver/
```
## Usage ## Usage
```bash ```bash
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 docker run -p 8888:80 -d --rm --name cspp-geo-mapserver --network cspp-geo-rabbit -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: Then the main mapserv CGI script can be accessed with:
http://localhost:8888/cgi-bin/mapserv http://localhost:8888/cgi-bin/mapserv
where MapServer parameters can be appended to the end (after a `?`). However,
an easier to access API is available:
```bash
http://localhost:8888/wms/<satellite>/<instrument>/<sector>/<data_level>?...
```
An example URL of this including MapServer parameters is:
```bash
http://localhost:8888/wms/g16/abi/radf/l1b?request=GetMap&service=WMS&version=1.1.1&srs=EPSG:930916&layers=true_color_test&bbox=-5000000,-5000000,5000000,5000000&format=image/png&WIDTH=1000&HEIGHT=1000&TIME=2020-01-21T16:00:16
```
## Special Notes ## Special Notes
This image has had its installation of the PROJ library modified to include This image has had its installation of the PROJ library modified to include
......
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import cgi import cgi
import json import json
import fiona import fiona
form = cgi.FieldStorage() form = cgi.FieldStorage()
layer = form['layer'].value layer = form['layer'].value
with fiona.open(layer, 'r') as shp_file: if not os.path.isfile(layer):
times = [x['properties']['time'] for x in shp_file] times = []
else:
with fiona.open(layer, 'r') as shp_file:
times = [x['properties']['time'] for x in shp_file]
print("Content-Type: application/json") print("Content-Type: application/json")
print("Access-Control-Allow-Origin: *") print("Access-Control-Allow-Origin: *")
......
...@@ -110,7 +110,7 @@ def index(input_files, output_shapefile): ...@@ -110,7 +110,7 @@ def index(input_files, output_shapefile):
shutil.rmtree(tmp_dir, ignore_errors=True) shutil.rmtree(tmp_dir, ignore_errors=True)
times_removed = current_times - new_times times_removed = current_times - new_times
times_added = new_times = current_times times_added = new_times - current_times
return sorted(times_removed), sorted(times_added) return sorted(times_removed), sorted(times_added)
......
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