Skip to content

Commit

Permalink
Merge pull request #342 from kartoza/osundwajeff/issue322
Browse files Browse the repository at this point in the history
Test release artifacts
  • Loading branch information
osundwajeff authored Oct 1, 2024
2 parents e158627 + 6bc1d27 commit 86eb1dc
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
echo " " >> docs/repository/plugins.xml
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --add safe.directory /__w/GEEST/GEEST
git config --global --add safe.directory /__w/GEEST2/GEEST2
git add -A
git commit -m "Update on plugins.xml"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Applying the GEEST in the pilot countries has yielded valuable insights, particu

During the development phase the plugin is available to install via
a dedicated plugin repository
[https://raw.githubusercontent.com/samweli/GEEST/release/docs/repository/plugins.xml](https://raw.githubusercontent.com/samweli/GEEST/release/docs/repository/plugins.xml)
[https://raw.githubusercontent.com/kartozs/GEEST2/release/docs/repository/plugins.xml](https://raw.githubusercontent.com/kartoza/GEEST2/release/docs/repository/plugins.xml)

### Install from QGIS plugin repository

Expand Down
2 changes: 1 addition & 1 deletion admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def _get_existing_releases(
:returns: List of github releases
:rtype: List[GithubRelease]
"""
base_url = "https://api.github.com/repos/" "kartoza/GEEST/releases"
base_url = "https://api.github.com/repos/" "kartoza/GEEST2/releases"
response = httpx.get(base_url)
result = []
if response.status_code == 200:
Expand Down
5 changes: 2 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"author": "Kartoza",
"email": "info@kartoza.com",
"description": "Gender Enabling Environments Spatial Tool",
"version": "0.1",
"version": "0.1.1",
"changelog": "",
"server": false,
"plugin_dependencies": "ORS Tools==1.8.3"
"server": false
}
}
15 changes: 10 additions & 5 deletions geest/core/buffering.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from qgis.core import (
QgsVectorLayer,
QgsProcessingFeedback,
QgsCoordinateReferenceSystem,
QgsMessageLog,
Qgis,
)
import processing

Expand Down Expand Up @@ -34,8 +35,10 @@ def _check_and_reproject_layer(self):
QgsVectorLayer: The input layer, either reprojected or unchanged.
"""
if self.input_layer.crs() != self.crs:
print(
f"Reprojecting layer from {self.input_layer.crs().authid()} to {self.crs.authid()}"
QgsMessageLog.logMessage(
f"Reprojecting layer from {self.input_layer.crs().authid()} to {self.crs.authid()}",
"Geest",
level=Qgis.Info,
)
reproject_result = processing.run(
"native:reprojectlayer",
Expand All @@ -61,8 +64,10 @@ def create_buffer(self):
"""
# Check if the output file already exists and delete it if necessary
if os.path.exists(self.output_path):
print(
f"Warning: {self.output_path} already exists. It will be overwritten."
QgsMessageLog.logMessage(
f"Warning: {self.output_path} already exists. It will be overwritten.",
"Geest",
level=Qgis.Warning,
)
os.remove(self.output_path)

Expand Down
24 changes: 19 additions & 5 deletions geest/core/create_grids.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from qgis.core import QgsVectorLayer, QgsProcessingFeedback
from qgis.core import QgsVectorLayer, QgsProcessingFeedback, QgsMessageLog, Qgis
import processing


Expand Down Expand Up @@ -30,7 +30,11 @@ def create_grids(self, layer, output_dir, crs, merged_output_path):
"""
# Check if the merged grid already exists
if os.path.exists(merged_output_path):
print(f"Merged grid already exists: {merged_output_path}")
QgsMessageLog.logMessage(
f"Merged grid already exists: {merged_output_path}",
"Geest",
level=Qgis.Info,
)
return merged_output_path
else:
layer = QgsVectorLayer(layer, "country_layer", "ogr")
Expand Down Expand Up @@ -77,7 +81,11 @@ def create_grids(self, layer, output_dir, crs, merged_output_path):

# Check if the grid already exists
if os.path.exists(grid_output_path):
print(f"Grid file already exists: {grid_output_path}")
QgsMessageLog.logMessage(
f"Grid file already exists: {grid_output_path}",
"Geest",
level=Qgis.Info,
)
grid_layer = QgsVectorLayer(
grid_output_path, "grid_layer", "ogr"
) # Load the existing grid layer
Expand All @@ -91,7 +99,11 @@ def create_grids(self, layer, output_dir, crs, merged_output_path):
clip_result = processing.run("native:clip", clip_params)
grid_layer = clip_result["OUTPUT"] # The clipped grid
else:
print(f"Creating grid: {grid_output_path}")
QgsMessageLog.logMessage(
f"Creating grid: {grid_output_path}",
"Geest",
level=Qgis.Info,
)
# Define grid creation parameters
grid_params = {
"TYPE": 2, # Rectangle (polygon)
Expand Down Expand Up @@ -120,7 +132,9 @@ def create_grids(self, layer, output_dir, crs, merged_output_path):
all_grids.append(grid_layer)

# Merge all grids into a single layer
print(f"Merging grids into: {merged_output_path}")
QgsMessageLog.logMessage(
f"Merging grids into: {merged_output_path}", "Geest", level=Qgis.Info
)
merge_params = {
"LAYERS": all_grids,
"CRS": crs,
Expand Down
8 changes: 6 additions & 2 deletions geest/core/index_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
QgsProcessingFeedback,
QgsRectangle,
QgsCoordinateReferenceSystem,
QgsMessageLog,
Qgis,
)
import processing

Expand Down Expand Up @@ -48,8 +50,10 @@ def generate_raster(self):
"""
# Check if the output file already exists and delete it if necessary
if os.path.exists(self.output_path):
print(
f"Warning: {self.output_path} already exists. It will be overwritten."
QgsMessageLog.logMessage(
f"Warning: {self.output_path} already exists. It will be overwritten.",
"Geest",
level=Qgis.Warning,
)

# Calculate the raster value based on index_value and index_scale
Expand Down

0 comments on commit 86eb1dc

Please sign in to comment.