Skip to content

Commit

Permalink
fix for test_index_score
Browse files Browse the repository at this point in the history
  • Loading branch information
osundwajeff committed Sep 16, 2024
1 parent b9d2081 commit 6f4bd24
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/test_index_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from qgis.core import (
QgsVectorLayer,
QgsCoordinateReferenceSystem,
QgsRectangle,
QgsApplication,
QgsProcessingFeedback,
)
import processing
from qgis_gender_indicator_tool.jobs.index_score import RasterizeIndexScoreValue


Expand All @@ -27,6 +27,19 @@ def test_generate_raster(self):
# Load the country boundary layer
country_boundary = QgsVectorLayer(boundary_path, "test_boundary", "ogr")
self.assertTrue(country_boundary.isValid(), "The boundary layer is not valid.")

# Reproject the vector layer if necessary
if country_boundary.crs() != self.utm_crs:
reprojected_result = processing.run(
"native:reprojectlayer",
{
"INPUT": country_boundary,
"TARGET_CRS": self.utm_crs,
"OUTPUT": "memory:",
},
feedback=QgsProcessingFeedback(),
)
country_boundary = reprojected_result["OUTPUT"]

# Define bbox and CRS
bbox = country_boundary.extent()
Expand Down

0 comments on commit 6f4bd24

Please sign in to comment.