Skip to content

Commit

Permalink
Use db-name corrected gs workspace in terria
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeParky committed Nov 26, 2024
1 parent e3ec3ef commit 94bb57c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions otakaro/pollution_model/medusa_process_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ def _format_number(number: float) -> Union[int, float]:
# Present the user with the scenario details for visualization
response.outputs['scenarioDetails'].data = scenario_details

geoserver_url = f"{EnvVar.GEOSERVER_HOST}:{EnvVar.GEOSERVER_PORT}/geoserver/db-pollution/ows"
geoserver_workspace = f"{EnvVar.POSTGRES_DB}-pollution"
geoserver_url = f"{EnvVar.GEOSERVER_HOST}:{EnvVar.GEOSERVER_PORT}/geoserver/{geoserver_workspace}/ows"

# Add Geoserver JSON Catalog entries to WPS response for use by Terria
response.outputs['roofs'].data = json.dumps({
"type": "wfs",
"name": "MEDUSA Roof Surfaces",
"url": geoserver_url,
"typeNames": "db-pollution:medusa2_model_output_buildings",
"typeNames": f"{geoserver_workspace}:medusa2_model_output_buildings",
"parameters": {
"cql_filter": f"scenario_id={scenario_id}",
},
Expand All @@ -122,7 +123,7 @@ def _format_number(number: float) -> Union[int, float]:
"type": "wfs",
"name": "MEDUSA Road Surfaces",
"url": geoserver_url,
"typeNames": "db-pollution:medusa2_model_output_roads",
"typeNames": f"{geoserver_workspace}:medusa2_model_output_roads",
"parameters": {
"cql_filter": f"scenario_id={scenario_id}",
},
Expand Down

0 comments on commit 94bb57c

Please sign in to comment.