generated from kamangir/blue-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from kamangir/palisades-2025-01-21-02nsc2
π§π½βπ QGIS refactors for palisades
- Loading branch information
Showing
7 changed files
with
82 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
if not QGIS_is_live: | ||
from ..logger import Q_log | ||
from ..application import BLUE_GEO_QGIS_APPLICATION | ||
from ..QGIS import QGIS | ||
from ..objects import Q_file_path_in_object | ||
from ..project import Q_project | ||
from ..logger import Q_log_error, Q_verbose | ||
|
||
|
||
class BLUE_GEO_QGIS_APPLICATION_PALISADES(BLUE_GEO_QGIS_APPLICATION): | ||
def __init__(self): | ||
super().__init__("palisades", "π§π½βπ") | ||
|
||
def help_(self): | ||
Q_log( | ||
"palisades.load", | ||
"load the layers of the palisades object.", | ||
icon=self.icon, | ||
) | ||
|
||
@property | ||
def load(self): | ||
metadata = Q_project.metadata | ||
if Q_verbose: | ||
self.log(f"metadata: {metadata}") | ||
|
||
if "predict" not in metadata: | ||
Q_log_error("predict not found in metadata.") | ||
return | ||
|
||
reference_filename = metadata["predict"]["reference_filename"] | ||
datacube_id = metadata["predict"]["datacube_id"] | ||
if not Q_project.add_layer( | ||
filename=Q_file_path_in_object( | ||
filename=reference_filename, | ||
object_name=datacube_id, | ||
), | ||
layer_name=f"input-{reference_filename}", | ||
): | ||
return | ||
|
||
output_filename = metadata["predict"]["output_filename"] | ||
if not Q_project.add_layer( | ||
filename=Q_file_path_in_object( | ||
filename=output_filename, | ||
object_name=Q_project.name, | ||
), | ||
layer_name=f"predict-{output_filename}", | ||
template_name="prediction-template", | ||
): | ||
return | ||
|
||
|
||
palisades = BLUE_GEO_QGIS_APPLICATION_PALISADES() | ||
QGIS.add_app(palisades) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters