Skip to content

Commit

Permalink
fix "self.crs" issue
Browse files Browse the repository at this point in the history
  • Loading branch information
osundwajeff committed Sep 17, 2024
1 parent 5e01c83 commit 34cc195
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_index_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ def test_generate_raster(self):
country_boundary = QgsVectorLayer(boundary_path, "test_boundary", "ogr")
self.assertTrue(country_boundary.isValid(), "The boundary layer is not valid.")

crs = QgsCoordinateReferenceSystem("EPSG:32620") # UTM Zone 20N

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

0 comments on commit 34cc195

Please sign in to comment.