eGSIM Shakemap Service
The eGSIM shakemap is comprised of a backend service (api.py
) and a front end response site (front-end
).
Docker
You can run the shakemap service in a docker container:
docker-compose build
docker-compose up
Note, that the front-end is not yet integrated in the docker-compose.yml
. The service exposes port 8082.
Dependencies
apt install gmt libhdf5-dev pkg-config postgresql
pip3 install -r requirements.txt
vs30 model available at USGS. Export an environment variable VS30PATH
pointing to that file.
Shortcut: wget https://earthquake.usgs.gov/static/lfs/data/global_vs30_grd.zip
Furthermore, npm
is required for the front-end, as well as the vue
command line client. Install the latter with
npm install -g @vue/cli@latest
Start services manually
Spawning the service at port 8082:
python3 src/api.py
Starting the front end:
cd front-end/shakemap
npm install # This needs to be done just once or if new dependencies were added
npm run serve
Starting the API documentation:
cd front-end/api_documentation
git clone https://github.com/swagger-api/swagger-node
npm start
Go to open http://localhost:8081/docs
API
Either post request QuakeML formatted strings or use get requests on endpoint /shakemap
.
You can manually query the api with e.g. curl pointing a quakeml against the API:
curl -X POST -H "Content-Type: application/json" -d @coquimbo.quakeml http://localhost:8082/shakemap\?gmpe=BindiEtAl2014Rjb\&imt\=PGA