Skip to content

Commit 36b6091

Browse files
committed
Replace gdal_merge with gdalwarp, clean up report
1 parent 42c3285 commit 36b6091

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

workflow/envs/default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313
- fiona=1.10.1
1414
- rasterio=1.4.3
1515
- rioxarray=0.19.0
16+
- gdal=3.10.3
1617
- libgdal-arrow-parquet=3.10.3
1718
- libgdal-hdf5=3.10.3
1819
- matplotlib=3.10.3

workflow/rules/process.smk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ rule aggregate_area_potential:
9494
"../envs/default.yaml"
9595
shell:
9696
"""
97-
gdal_merge -o "{output.aggregated_area_potential}" -a_nodata -1 {input}
97+
gdalwarp --config GDAL_CACHEMAX 3000 -wm 3000 -of GTiff -co COMPRESS=LZW {input} "{output.aggregated_area_potential}"
9898
"""
9999

100100

workflow/scripts/report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def report(shapes, area_potentials, csv_path, html_path):
3333
.squeeze()
3434
.drop_vars(["band", "spatial_ref"])
3535
)
36-
dataframes.append(da_area_potential.groupby(regions).sum().to_pandas())
36+
df_ = da_area_potential.groupby(regions).sum().to_pandas()
37+
df_.name = area_potential_file
38+
dataframes.append(df_)
3739
del da_area_potential
3840

3941
df = pd.concat(dataframes, axis=1)

0 commit comments

Comments
 (0)