-
Install Tethys pltform:
- install Miniconda or Anaconda
- install
tethys-platform
withconda
conda create -n tethys -c tethysplatform -c conda-forge tethys-platform
-
Clone this project to your local computer:
git clone https://github.com/Aquaveo/tethysapp-geoglows_dashboard.git
-
Download the databases and put them under the specified paths:
Dataset Path combined_all_data_122.nc tethysapp-geoglows_dashboard/tethysapp/geoglows_dashboard/workspaces/app_workspace/hydrosos/streamflow/vpu_122
-
Install this app in Tethys:
conda activate tethys cd tethysapp-geoglows_dashboard tethys install -d
-
Create a service account registered with Google Earth Engine
-
Create Service Account Key
- See "1. Create Service Account Key" in this tutorial
-
Set Service Account Settings for the App
- see "2. Set Service Account Settings for the App" in this tutorial
-
Download the Docker Desktop for your laptop: https://www.docker.com/products/docker-desktop/
-
Download the PostGIS docker:
sudo docker run --name=tethys_postgis --env=POSTGRES_PASSWORD=mysecretpassword -p 5435:5432 -d postgis/postgis:12-2.5
-
Go to
~/.tethys/portal_config.yml
to set the PostgreSQL as the default database.DATABASES: default: ENGINE: django.db.backends.postgresql NAME: tethys_platform USER: tethys_default PASSWORD: pass HOST: localhost PORT: 5435
Please note that if you are using an environment other than
tethys
, such astethys3
ortethys4
, you'll need to navigate to the root folder of that environment and make changes to itsportal_config.yml
file. -
Run the following command to configure the database:
PGPASSWORD=mysecretpassword tethys db configure
-
Add a Persistent Store Service to Tethys Portal:
- Go to Tethys Portal Home in a web browser (e.g. http://localhost:8000/apps/)
- Select Site Admin from the drop down next to your username.
- Scroll down to the Tethys Services section and select Persistent Store Services link.
- Click on the Add Persistent Store Service button.
- Give the Persistent Store Service any name and fill out the connection information.
- Note: The username and password for the persistent store service must be a superuser to use spatial persistent stores. Note that the default installation of Tethys Portal includes a superuser named "tethys_super", password: "pass".
- Press Save to create the new Persistent Store Service.
-
Assign the new Persistent Store Service to the Geoglows Dashboard App:
- Go to Tethys Portal Home in a web browser (e.g. http://localhost:8000/apps/)
- Select Site Admin from the drop down next to your username.
- Scroll down to the Tethys Apps section and select the Installed App link.
- Select the Geoglows Dashboard link.
- Scroll down to the Persistent Store Database Settings section.
- Assign the Persistent Store Service that you created in the last step to the country_db setting.
- Press Save to save the settings.
-
View the database in pgAdmin
-
Add the
postgis
extension to the database:- Right click the
geoglows_dashboard_country_db
database -> Create -> Extension - In the General tab, use drop down menu to choose the "postgis" extension, then Save
- Right click the
-
Execute the syncstores command to create the tables in the Persistent Store database:
tethys syncstores geoglows_dashboard
-
Load the data to the database:
- Enter the folder
tethysapp-geoglows_dashboard/tethysapp/geoglows_dashboard
- Run the command
tethys manage shell < init_river_tables.py
, then wait for 3~6 hours for it to be finished
-
Install
tethys_databset_services
:conda install -c conda-forge tethys_dataset_services
-
Create
SpatialDatasetService
if one does not already exist- Ener the Site Admin page
- Scroll down to the Tethys Services section of the Admin Interface and select the link titled Spatial Dataset Services.
- Click on the Add Spatial Dataset Service button.
- Fill in the connection information to the database server.
- Note, the default username is
admin
, password isgeoserver
- Note, the default username is
- Press the Save button to save the new
SpatialDatasetService
.
-
Assign sptial dataset services
- Go back to the Site Admin page
- Scroll down to the Tethys Apps section and select the Installed App link.
- Select the Geoglows Dashboard link.
- Scroll down to the Spatial Dataset Services Settings section and and locate the
SpatialDatasetServiceSetting
- Assign the appropriate
SpatialDatasetService
to yourSpatialDatasetServiceSetting
using the drop down menu in the Spatial Dataset Service column. - Press the Save button at the bottom of the page to save your changes.
-
Start the geoserver docker container:
- If you haven't created the geoserver docker container:
tethys docker init -c geoserver
- Start the container:
tethys docker start -c geoserver
- If you haven't created the geoserver docker container:
-
Run the following script to create a HydroSOS Streamflow Layer in GeoServer, which will be used in the app:
- Enter the folder
tethysapp-geoglows_dashboard/tethysapp/geoglows_dashboard
- Run the command:
tethys manage shell < init_geoserver.py
- Enter the folder
-
Run the app in Tethys:
tethys manage start
-
Browse to http://127.0.0.1:8000/apps in a web browser and login. The default portal user is:
- username: admin
- password: pass
-
If all has gone well, you should see the app listed on the app library page. Click on the app tile to launch it.