Skip to content

Commit

Permalink
WIP serialisation of opportunities
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Jan 3, 2025
1 parent 555fb06 commit 42f53ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion geest/gui/panels/tree_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,16 @@ def update_action_text():
)
menu.addAction(add_wee_by_population_aggregate)

add_job_opportunities_mask = QAction("Add Job Opportunities Mask to Map")
add_job_opportunities_mask.triggered.connect(
lambda: self.add_to_map(
item,
key="opportunities_mask_result_file",
layer_name="Opportunities Mask",
)
)
menu.addAction(add_job_opportunities_mask)

add_study_area_layers_action = QAction("Add Study Area to Map", self)
add_study_area_layers_action.triggered.connect(self.add_study_area_to_map)
menu.addAction(add_study_area_layers_action)
Expand Down Expand Up @@ -901,7 +911,7 @@ def add_study_area_to_map(self):

def add_to_map(self, item, key="result_file", layer_name=None, qml_key=None):
"""Add the item to the map."""

log_message(item.attributesAsMarkdown())
layer_uri = item.attribute(f"{key}")
log_message(f"Adding {layer_uri} for key {key} to map")
if layer_uri:
Expand Down
6 changes: 6 additions & 0 deletions geest/gui/views/treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def loadJsonData(self, json_data):
analysis_output_filename = json_data.get("output_filename", "WEE_Score")
mask_mode = json_data.get("mask_mode", "None")
buffer_distance_m = json_data.get("buffer_distance_m", 0.0)
opportunities_mask_result_file = json_data.get(
"opportunities_mask_result_file", ""
)
opportunities_mask_result = json_data.get("opportunities_mask_result", "")
# Store special properties in the attributes dictionary
analysis_attributes = {
"analysis_name": analysis_name,
Expand All @@ -98,6 +102,8 @@ def loadJsonData(self, json_data):
"output_filename": analysis_output_filename,
"mask_mode": mask_mode,
"buffer_distance_m": buffer_distance_m,
"opportunities_mask_result_file": opportunities_mask_result_file,
"opportunities_mask_result": opportunities_mask_result,
}
for prefix in [
"aggregation",
Expand Down

0 comments on commit 42f53ab

Please sign in to comment.