From 90383d4574f43025ec297cdf90a03f8cd9c10cb9 Mon Sep 17 00:00:00 2001 From: Tariq Soliman Date: Wed, 10 Apr 2024 15:22:09 -0700 Subject: [PATCH] #529 Viewshed set initial target and observer heights, also doc improvements (#530) --- docs/pages/Setup/ENVs/ENVs.md | 14 +++++++------- docs/pages/Setup/Installation/Installation.md | 12 ++++++++++-- src/essence/Tools/Viewshed/ViewshedTool.js | 13 +++++++++++-- src/essence/Tools/Viewshed/config.json | 4 +++- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/docs/pages/Setup/ENVs/ENVs.md b/docs/pages/Setup/ENVs/ENVs.md index b961bdee..5962b832 100644 --- a/docs/pages/Setup/ENVs/ENVs.md +++ b/docs/pages/Setup/ENVs/ENVs.md @@ -15,7 +15,7 @@ Environment variables are set within `MMGIS/.env`. A sample file `MMGIS/sample.e The kind of server running (apache is deprecated) | string enum | default `''` -- _node:_ A node express server running NodeJS > 10.10 +- _node:_ A node express server running NodeJS v20.11.1+ - _apache (deprecated):_ Served through Apache. Some or all functionality may not work #### `AUTH=` @@ -58,6 +58,12 @@ User of Postgres database | string | default `null` Password of Postgres database | string | default `null` +## Optional Variables + +#### `PORT=` + +Port to run on | positive integer | default `3000` + #### `DB_POOL_MAX=` Max number connections in the database's pool. CPUs \* 4 is a good number | integer | default `10` @@ -74,12 +80,6 @@ How many milliseconds for an incoming connection to wait for a DB connection bef A list of CSSO LDAP groups that have access | string[] | default `[]` -## Optional Variables - -#### `PORT=` - -Port to run on | positive integer | default `3000` - #### `VERBOSE_LOGGING=` Potentially logs a bunch of extra stuff for development purposes | bool | default `false` diff --git a/docs/pages/Setup/Installation/Installation.md b/docs/pages/Setup/Installation/Installation.md index 693aead9..428a89e3 100644 --- a/docs/pages/Setup/Installation/Installation.md +++ b/docs/pages/Setup/Installation/Installation.md @@ -12,6 +12,14 @@ nav_order: 1 ## Installing with Docker +`/` will always refer to the repo's root directory + +1. Clone the repo + `git clone https://github.com/NASA-AMMOS/MMGIS` + +1. From within `/` + `npm install` + ### Building To build the Docker image, run: @@ -19,7 +27,7 @@ To build the Docker image, run: ### Running -This repo contains a `docker-compose.yml` file that defines a service for the application and a PostgreSQL database with PostGIS installed +This repo contains a `/docker-compose.yml` file that defines a service for the application and a PostgreSQL database with PostGIS installed - Copy `/sample.env` to `.env` `cp sample.env .env` @@ -46,7 +54,7 @@ This repo contains a `docker-compose.yml` file that defines a service for the ap - On the host machine, create a `Missions` directory and copy the contents of `./Missions` to your directory. - Via the docker-compose.yml, map this directory to `/usr/src/app/Missions` in the container. For example, if the host directory is `./Missions`, the volume mapping would be `- ./Missions:/usr/src/app/Missions` -Run: `docker-compose up` +Run: `docker-compose up -d` ### First Time UI Setup diff --git a/src/essence/Tools/Viewshed/ViewshedTool.js b/src/essence/Tools/Viewshed/ViewshedTool.js index 7a1779d8..3a66240f 100644 --- a/src/essence/Tools/Viewshed/ViewshedTool.js +++ b/src/essence/Tools/Viewshed/ViewshedTool.js @@ -263,8 +263,17 @@ let ViewshedTool = { resolution: initObj.resolution != null ? initObj.resolution : 1, invert: initObj.invert != null ? initObj.invert : 0, targetHeight: - initObj.targetHeight != null ? initObj.targetHeight : 0, - height: initObj.height != null ? initObj.height : 2, + initObj.targetHeight != null + ? initObj.targetHeight + : ViewshedTool?.vars?.defaultTargetHeight != null + ? ViewshedTool.vars.defaultTargetHeight + : 0, + height: + initObj.height != null + ? initObj.height + : ViewshedTool?.vars?.defaultObserverHeight != null + ? ViewshedTool.vars.defaultObserverHeight + : 2, centerAzimuth: initObj.centerAzimuth || 0, FOVAzimuth: initObj.FOVAzimuth != null ? initObj.FOVAzimuth : 360, centerElevation: initObj.centerElevation || 0, diff --git a/src/essence/Tools/Viewshed/config.json b/src/essence/Tools/Viewshed/config.json index 223565b8..d81c8139 100644 --- a/src/essence/Tools/Viewshed/config.json +++ b/src/essence/Tools/Viewshed/config.json @@ -24,7 +24,9 @@ "elFOV": 30 }, { "...": "..." } - ] + ], + "defaultObserverHeight": 2, + "defaultTargetHeight": 0 } }, "hasVars": true,