Open mvmaltitz opened 3 months ago
Found the issue is due to the difference in metadata for each raster layer.
Proposed workaround : loop through all the layers and find the largest transform :
def find_largest_transform(raster_files):
transforms = []
for raster_file in raster_files:
with rasterio.open(raster_file) as src:
transforms.append(src.transform)
largest_transform = max(transforms, key=lambda t: abs(t.a * t.e - t.b * t.d))
return largest_transform
largest_transform = find_largest_transform(rasLayers)
meta1.update(transform=largest_transform)
Please ensure the testing is performed using every possible combination of data inputs for each factor (eg. For Safety: use all options, iteratively). Thanks! @osundwajeff @mvmaltitz @dragosgontariu
Input layers:
Results:
@dragosgontariu
@javaftw @osundwajeff
I get the following error message and no place score error.
@timlinux
Using self and manually generated other Factors that failed during process via Plugin, the Place score aggregation also experiencing an error with trigger Python error below
2024-09-12T23:18:14 WARNING Traceback (most recent call last):
File "C:\Users/benny/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gender_indicator_tool\gender_indicator_tool.py", line 6320, in place_characterization_aggregation
(np.where(WLK_ras != -9999, WLK_ras, 0) * WLK_weight / 100) +
ValueError: operands could not be broadcast together with shapes (10756,4352) (10756,4364)
And Python warning below
2024-09-12T23:18:14 WARNING warning:C:\Users/benny/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gender_indicator_tool\gender_indicator_tool.py:6320: RuntimeWarning: overflow encountered in multiply
(np.where(WLK_ras != -9999, WLK_ras, 0) * WLK_weight / 100) +
traceback: File "C:\Users/benny/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gender_indicator_tool\gender_indicator_tool.py", line 6320, in place_characterization_aggregation
(np.where(WLK_ras != -9999, WLK_ras, 0) * WLK_weight / 100) +
I am getting the following output which is incorrect and makes the output smaller that it should be:
The inputs are: